diff --git a/.travis.yml b/.travis.yml
index bd06fb9..7eaf632 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -9,10 +9,9 @@ notifications:
matrix:
include:
- - python: 3.6
- python: 3.7
- python: 3.8
- # - python: 3.9
+ - python: 3.9
before_install:
- npm install npm@latest -g
@@ -38,7 +37,7 @@ deploy:
script: npx semantic-release
skip_cleanup: true
on:
- python: '3.6'
+ python: '3.7'
branch: master
- provider: pypi
@@ -47,5 +46,5 @@ deploy:
repository: https://upload.pypi.org/legacy
skip_cleanup: true
on:
- python: '3.6'
+ python: '3.7'
tags: true
diff --git a/ibm_vpc/vpc_v1.py b/ibm_vpc/vpc_v1.py
index 8f3d6a6..5fba682 100644
--- a/ibm_vpc/vpc_v1.py
+++ b/ibm_vpc/vpc_v1.py
@@ -1,6 +1,6 @@
# coding: utf-8
-# (C) Copyright IBM Corp. 2021.
+# (C) Copyright IBM Corp. 2021, 2022.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -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.43.0-49eab5c7-20211117-152138
+# IBM OpenAPI SDK Code Generator Version: 3.44.0-98838c07-20220128-151531
"""
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: 2021-11-23
+API Version: 2022-02-08
"""
from datetime import datetime
@@ -50,7 +50,7 @@ class VpcV1(BaseService):
@classmethod
def new_instance(cls,
- version: str = '2021-11-23',
+ version: str = '2022-02-08',
service_name: str = DEFAULT_SERVICE_NAME,
generation: int = 2,
) -> 'VpcV1':
@@ -75,7 +75,7 @@ def new_instance(cls,
return service
def __init__(self,
- version: str = '2021-11-23',
+ version: str = '2022-02-08',
authenticator: Authenticator = None,
generation: int = 2,
) -> None:
@@ -121,7 +121,7 @@ def list_vpcs(self,
of resources in one or more zones. VPCs are regional, and each VPC can contain
resources in multiple zones in a region.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -542,7 +542,7 @@ def list_vpc_address_prefixes(self,
This request lists all address pool prefixes for a VPC.
:param str vpc_id: The VPC identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -846,7 +846,7 @@ def list_vpc_routes(self,
:param str vpc_id: The VPC identifier.
:param str zone_name: (optional) Filters the collection to resources in the
zone with the exact specified name.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -1158,13 +1158,11 @@ def list_vpc_routing_tables(self,
built-in routes.
:param str vpc_id: The VPC identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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 bool is_default: (optional) If the supplied value is `true`, filters
- the routing table collection to only the default routing table. If the
- supplied value is `false`, filters the routing table collection to exclude
- the default routing table.
+ :param bool is_default: (optional) Filters the collection to routing tables
+ with the specified `is_default` 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 `RoutingTableCollection` object
@@ -1483,16 +1481,16 @@ def list_vpc_routing_table_routes(self,
"""
List all routes in a VPC routing table.
- This request lists all routes in a VPC routing table. If a subnet has been
- associated with this routing table, delivery of packets sent on a subnet is
- performed according to the action of the most specific matching route in the table
- (provided the subnet and route are in the same zone). If multiple equally-specific
- routes exist, traffic will be distributed across them. If no routes match,
- delivery will be controlled by the system's built-in routes.
+ This request lists all routes in a VPC routing table. If subnets are associated
+ with this routing table, delivery of packets sent on a subnet is performed
+ according to the action of the most specific matching route in the table (provided
+ the subnet and route are in the same zone). If multiple equally-specific routes
+ exist, traffic will be distributed across them. If no routes match, delivery will
+ be controlled by the system's built-in routes.
:param str vpc_id: The VPC identifier.
:param str routing_table_id: The routing table identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -1822,7 +1820,7 @@ def list_subnets(self,
addresses specified in CIDR block notation. Each subnet is within a particular
zone and cannot span multiple zones or regions.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -2442,7 +2440,7 @@ def list_subnet_reserved_ips(self,
endpoint gateway.
:param str subnet_id: The subnet identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -2511,7 +2509,8 @@ def create_subnet_reserved_ip(self,
Names must be unique within the subnet the reserved IP resides in. Names
beginning with `ibm-` are reserved for provider-owned resources.
:param ReservedIPTargetPrototype target: (optional) The target this
- reserved IP is to be bound to.
+ reserved IP is to be bound to. The target must be an endpoint gateway not
+ already bound to a reserved IP in the subnet's zone.
:param dict headers: 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
@@ -2734,14 +2733,14 @@ def list_images(self,
"""
List all images.
- This request lists all provisionable images available in the region. An image
- provides source data for a volume. Images are either system-provided, or created
- from another source, such as importing from object storage.
+ This request lists all images available in the region. An image provides source
+ data for a volume. Images are either system-provided, or created from another
+ source, such as importing from object storage.
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-supplied token determining what
+ :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
@@ -2846,8 +2845,10 @@ def delete_image(self,
This request deletes an image. This operation cannot be reversed. A
system-provided image is not allowed to be deleted. Additionally, an image cannot
- be deleted if it has a
- `status` of `pending`, `tentative`, or `deleting`.
+ be deleted if it:
+ - has a `status` of `tentative` or `deleting`
+ - has a `status` of `pending` with a `status_reasons` code of
+ `image_request_in_progress`.
:param str id: The image identifier.
:param dict headers: A `dict` containing the request headers
@@ -2998,7 +2999,7 @@ def list_operating_systems(self,
This request lists all operating systems in the region.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -3094,7 +3095,7 @@ def list_keys(self,
This request lists all keys in the region. A key contains a public SSH key which
may be installed on instances when they are created. Private keys are not stored.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -3697,7 +3698,7 @@ def list_instances(self,
This request lists all instances in the region.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -4382,8 +4383,9 @@ def create_instance_network_interface(self,
specified, it must be an available address on the network interface's
subnet. If unspecified, an available address on the subnet will be
automatically selected.
- :param List[SecurityGroupIdentity] security_groups: (optional) Collection
- of security groups.
+ :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 dict headers: 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
@@ -4769,7 +4771,7 @@ def add_instance_network_interface_floating_ip(self,
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 supplied, is ignored.
+ gateway. A request body is not required, and if provided, is ignored.
:param str instance_id: The instance identifier.
:param str network_interface_id: The network interface identifier.
@@ -4872,10 +4874,10 @@ def create_instance_volume_attachment(self,
Create a volume attachment on an instance.
This request creates a new volume attachment from a volume attachment prototype
- object. The prototype object is structured in the same way as a retrieved volume
- attachment, and contains the information necessary to create the new volume
- attachment. The creation of a new volume attachment connects a volume to an
- instance.
+ object, connecting a volume to an instance. For this request to succeed, the
+ specified volume must not be busy. The prototype object is structured in the same
+ way as a retrieved volume attachment, and contains the information necessary to
+ create the new volume attachment.
:param str instance_id: The instance identifier.
:param VolumeAttachmentPrototypeVolume volume: An existing volume to attach
@@ -4942,8 +4944,9 @@ def delete_instance_volume_attachment(self,
"""
Delete a volume attachment.
- This request deletes a volume attachment. The deletion of a volume attachment
- detaches a volume from an instance.
+ This request deletes a volume attachment. This operation cannot be reversed, but a
+ new volume attachment may subsequently be created for the volume. For this
+ request to succeed, the volume must not be busy.
:param str instance_id: The instance identifier.
:param str id: The volume attachment identifier.
@@ -5111,7 +5114,7 @@ def list_instance_groups(self,
This request lists all instance groups in the region.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -5172,15 +5175,17 @@ def create_instance_group(self,
supply the port for the load balancer pool member.
:param LoadBalancerIdentity load_balancer: (optional) The load balancer
that the load balancer pool used by this group
- is in. Must be supplied when using a load balancer pool.
- :param LoadBalancerPoolIdentity load_balancer_pool: (optional) When
+ is in. Required when using a load balancer pool.
+ :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If
specified, the load balancer pool will be managed by this
group. Instances created by this group will have a new load
balancer pool member in that pool created. Must be used with
`application_port`.
:param int membership_count: (optional) The number of instances in the
instance group.
- :param str name: (optional) The user-defined name for this instance group.
+ :param str name: (optional) The unique user-defined name for this instance
+ group. 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
@@ -5447,7 +5452,7 @@ def list_instance_group_managers(self,
This request lists all managers for an instance group.
:param str instance_group_id: The instance group identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -5718,7 +5723,7 @@ def list_instance_group_manager_actions(self,
:param str instance_group_id: The instance group identifier.
:param str instance_group_manager_id: The instance group manager
identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -6012,7 +6017,7 @@ def list_instance_group_manager_policies(self,
:param str instance_group_id: The instance group identifier.
:param str instance_group_manager_id: The instance group manager
identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -6350,7 +6355,7 @@ def list_instance_group_memberships(self,
This request lists all instance group memberships for an instance group.
:param str instance_group_id: The instance group identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -6571,7 +6576,7 @@ def list_dedicated_host_groups(self,
collection of dedicated hosts for placement of instances. Each dedicated host must
belong to one and only one group. Host groups do not span zones.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -6850,7 +6855,7 @@ def list_dedicated_host_profiles(self,
dedicated host profile specifies the hardware characteristics for a dedicated
host.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -6948,7 +6953,7 @@ def list_dedicated_hosts(self,
:param str dedicated_host_group_id: (optional) Filters the collection to
dedicated host groups with the specified identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -7363,7 +7368,7 @@ def list_placement_groups(self,
This request lists all placement groups in the region.
- :param str start: (optional) A server-supplied token determining what
+ :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
@@ -7618,34 +7623,35 @@ def update_placement_group(self,
return response
#########################
- # Volumes
+ # Bare metal servers
#########################
- def list_volume_profiles(self,
+ def list_bare_metal_server_profiles(self,
*,
start: str = None,
limit: int = None,
**kwargs
) -> DetailedResponse:
"""
- List all volume profiles.
+ List all bare metal server profiles.
- This request lists all volume profiles available in the region. A volume profile
- specifies the performance characteristics and pricing model for a volume.
+ This request lists all bare metal server profiles available in the region. A bare
+ metal server profile specifies the performance characteristics and pricing model
+ for a bare metal server.
- :param str start: (optional) A server-supplied token determining what
+ :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 `VolumeProfileCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerProfileCollection` object
"""
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_volume_profiles')
+ operation_id='list_bare_metal_server_profiles')
headers.update(sdk_headers)
params = {
@@ -7659,7 +7665,7 @@ def list_volume_profiles(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/volume/profiles'
+ url = '/bare_metal_server/profiles'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -7669,19 +7675,20 @@ def list_volume_profiles(self,
return response
- def get_volume_profile(self,
+ def get_bare_metal_server_profile(self,
name: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a volume profile.
+ Retrieve a bare metal server profile.
- This request retrieves a single volume profile specified by the name in the URL.
+ This request retrieves a single bare metal server profile specified by the name in
+ the URL.
- :param str name: The volume profile name.
+ :param str name: The bare metal server 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 `VolumeProfile` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerProfile` object
"""
if name is None:
@@ -7689,7 +7696,7 @@ def get_volume_profile(self,
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_volume_profile')
+ operation_id='get_bare_metal_server_profile')
headers.update(sdk_headers)
params = {
@@ -7704,7 +7711,7 @@ def get_volume_profile(self,
path_param_keys = ['name']
path_param_values = self.encode_path_vars(name)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/volume/profiles/{name}'.format(**path_param_dict)
+ url = '/bare_metal_server/profiles/{name}'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -7714,36 +7721,59 @@ def get_volume_profile(self,
return response
- def list_volumes(self,
+ def list_bare_metal_servers(self,
*,
start: str = None,
limit: int = None,
+ resource_group_id: str = None,
name: str = None,
- zone_name: str = None,
+ vpc_id: str = None,
+ vpc_crn: str = None,
+ vpc_name: str = None,
+ network_interfaces_subnet_id: str = None,
+ network_interfaces_subnet_crn: str = None,
+ network_interfaces_subnet_name: str = None,
+ sort: str = None,
**kwargs
) -> DetailedResponse:
"""
- List all volumes.
+ List all bare metal servers.
- This request lists all volumes in the region. Volumes are network-connected block
- storage devices that may be attached to one or more instances in the same region.
+ This request lists all bare metal servers in the region.
- :param str start: (optional) A server-supplied token determining what
+ :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 in the resource group with the specified identifier.
:param str name: (optional) Filters the collection to resources with the
exact specified name.
- :param str zone_name: (optional) Filters the collection to resources in the
- zone with the exact specified name.
+ :param str vpc_id: (optional) Filters the collection to resources in the
+ VPC with the specified identifier.
+ :param str vpc_crn: (optional) Filters the collection to resources in the
+ VPC with the specified CRN.
+ :param str vpc_name: (optional) Filters the collection to resources in the
+ VPC with the exact specified name.
+ :param str network_interfaces_subnet_id: (optional) Filters the collection
+ to bare metal servers on the subnet with the specified identifier.
+ :param str network_interfaces_subnet_crn: (optional) Filters the collection
+ to bare metal servers on the subnet with the specified CRN.
+ :param str network_interfaces_subnet_name: (optional) Filters the
+ collection to bare metal servers on the subnet with the specified name.
+ :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 `VolumeCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerCollection` object
"""
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_volumes')
+ operation_id='list_bare_metal_servers')
headers.update(sdk_headers)
params = {
@@ -7751,15 +7781,22 @@ def list_volumes(self,
'generation': self.generation,
'start': start,
'limit': limit,
+ 'resource_group.id': resource_group_id,
'name': name,
- 'zone.name': zone_name
+ 'vpc.id': vpc_id,
+ 'vpc.crn': vpc_crn,
+ 'vpc.name': vpc_name,
+ 'network_interfaces.subnet.id': network_interfaces_subnet_id,
+ 'network_interfaces.subnet.crn': network_interfaces_subnet_crn,
+ 'network_interfaces.subnet.name': network_interfaces_subnet_name,
+ 'sort': sort
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/volumes'
+ url = '/bare_metal_servers'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -7769,31 +7806,73 @@ def list_volumes(self,
return response
- def create_volume(self,
- volume_prototype: 'VolumePrototype',
+ def create_bare_metal_server(self,
+ initialization: 'BareMetalServerInitializationPrototype',
+ primary_network_interface: 'BareMetalServerPrimaryNetworkInterfacePrototype',
+ profile: 'BareMetalServerProfileIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ name: str = None,
+ network_interfaces: List['BareMetalServerNetworkInterfacePrototype'] = None,
+ resource_group: 'ResourceGroupIdentity' = None,
+ vpc: 'VPCIdentity' = None,
**kwargs
) -> DetailedResponse:
"""
- Create a volume.
-
- This request creates a new volume from a volume prototype object. The prototype
- object is structured in the same way as a retrieved volume, and contains the
- information necessary to create the new volume.
-
- :param VolumePrototype volume_prototype: The volume prototype object.
+ Create a bare metal server.
+
+ This request provisions a new bare metal server from a prototype object. The
+ prototype object is structured in the same way as a retrieved bare metal server,
+ and contains the information necessary to provision the new bare metal server. The
+ bare metal server is automatically started.
+
+ :param BareMetalServerInitializationPrototype initialization:
+ :param BareMetalServerPrimaryNetworkInterfacePrototype
+ primary_network_interface: Primary network interface for the bare metal
+ server.
+ :param BareMetalServerProfileIdentity profile: The profile to use for this
+ bare metal server.
+ :param ZoneIdentity zone: The zone this bare metal server will reside in.
+ :param str name: (optional) The unique user-defined name for this bare
+ metal server (and default system hostname). If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param List[BareMetalServerNetworkInterfacePrototype] network_interfaces:
+ (optional) The additional network interfaces to create for the bare metal
+ server.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is
+ used.
+ :param VPCIdentity vpc: (optional) The VPC the bare metal server is to be a
+ part of. If specified, it must match the
+ VPC referenced by the subnets of the server's network interfaces.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `Volume` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServer` object
"""
- if volume_prototype is None:
- raise ValueError('volume_prototype must be provided')
- if isinstance(volume_prototype, VolumePrototype):
- volume_prototype = convert_model(volume_prototype)
+ if initialization is None:
+ raise ValueError('initialization must be provided')
+ if primary_network_interface is None:
+ raise ValueError('primary_network_interface must be provided')
+ if profile is None:
+ raise ValueError('profile must be provided')
+ if zone is None:
+ raise ValueError('zone must be provided')
+ initialization = convert_model(initialization)
+ primary_network_interface = convert_model(primary_network_interface)
+ profile = convert_model(profile)
+ zone = convert_model(zone)
+ if network_interfaces is not None:
+ network_interfaces = [convert_model(x) for x in network_interfaces]
+ if resource_group is not None:
+ resource_group = convert_model(resource_group)
+ if vpc is not None:
+ vpc = convert_model(vpc)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_volume')
+ operation_id='create_bare_metal_server')
headers.update(sdk_headers)
params = {
@@ -7801,14 +7880,25 @@ def create_volume(self,
'generation': self.generation
}
- data = json.dumps(volume_prototype)
+ data = {
+ 'initialization': initialization,
+ 'primary_network_interface': primary_network_interface,
+ 'profile': profile,
+ 'zone': zone,
+ 'name': name,
+ 'network_interfaces': network_interfaces,
+ 'resource_group': resource_group,
+ 'vpc': vpc
+ }
+ 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'))
headers['Accept'] = 'application/json'
- url = '/volumes'
+ url = '/bare_metal_servers'
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -7819,28 +7909,41 @@ def create_volume(self,
return response
- def delete_volume(self,
- id: str,
+ def create_bare_metal_server_console_access_token(self,
+ bare_metal_server_id: str,
+ console_type: str,
+ *,
+ force: bool = None,
**kwargs
) -> DetailedResponse:
"""
- Delete a volume.
+ Create a console access token for a bare metal server.
- This request deletes a volume. This operation cannot be reversed. For this request
- to succeed, the volume must not be attached to any instances.
+ This request creates a new single-use console access token for a bare metal
+ server. All console configuration is provided at token create time, and the token
+ is subsequently used in the `access_token` query parameter for the WebSocket
+ request. The access token is only valid for a short period of time, and a maximum
+ of one token is valid for a given bare metal server at a time.
- :param str id: The volume identifier.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str console_type: The bare metal server console type for which this
+ token may be used.
+ :param bool force: (optional) Indicates whether to disconnect an existing
+ serial console session as the serial console cannot be shared. This has no
+ effect on VNC consoles.
: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 `BareMetalServerConsoleAccessToken` object
"""
- if id is None:
- raise ValueError('id must be provided')
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
+ if console_type is None:
+ raise ValueError('console_type must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_volume')
+ operation_id='create_bare_metal_server_console_access_token')
headers.update(sdk_headers)
params = {
@@ -7848,43 +7951,55 @@ def delete_volume(self,
'generation': self.generation
}
+ data = {
+ 'console_type': console_type,
+ 'force': force
+ }
+ 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'))
+ headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['bare_metal_server_id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/volumes/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ url = '/bare_metal_servers/{bare_metal_server_id}/console_access_token'.format(**path_param_dict)
+ request = self.prepare_request(method='POST',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def get_volume(self,
- id: str,
+ def list_bare_metal_server_disks(self,
+ bare_metal_server_id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a volume.
+ List all disks on a bare metal server.
- This request retrieves a single volume specified by the identifier in the URL.
+ This request lists all disks on a bare metal server. A disk is a block device
+ that is locally attached to the physical server. By default, the listed disks are
+ sorted by their `created_at` property values, with the newest disk first.
- :param str id: The volume identifier.
+ :param str bare_metal_server_id: The bare metal 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 `Volume` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerDiskCollection` object
"""
- if id is None:
- raise ValueError('id must be provided')
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_volume')
+ operation_id='list_bare_metal_server_disks')
headers.update(sdk_headers)
params = {
@@ -7896,10 +8011,10 @@ def get_volume(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['bare_metal_server_id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/volumes/{id}'.format(**path_param_dict)
+ url = '/bare_metal_servers/{bare_metal_server_id}/disks'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -7909,35 +8024,31 @@ def get_volume(self,
return response
- def update_volume(self,
+ def get_bare_metal_server_disk(self,
+ bare_metal_server_id: str,
id: str,
- volume_patch: 'VolumePatch',
**kwargs
) -> DetailedResponse:
"""
- Update a volume.
+ Retrieve a bare metal server disk.
- This request updates a volume with the information in a provided volume patch. The
- volume patch object is structured in the same way as a retrieved volume and
- contains only the information to be updated.
+ This request retrieves a single disk specified by the identifier in the URL.
- :param str id: The volume identifier.
- :param VolumePatch volume_patch: The volume patch.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str id: The bare metal server disk 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 `Volume` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerDisk` object
"""
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
if id is None:
raise ValueError('id must be provided')
- if volume_patch is None:
- raise ValueError('volume_patch must be provided')
- if isinstance(volume_patch, VolumePatch):
- volume_patch = convert_model(volume_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_volume')
+ operation_id='get_bare_metal_server_disk')
headers.update(sdk_headers)
params = {
@@ -7945,149 +8056,132 @@ def update_volume(self,
'generation': self.generation
}
- data = json.dumps(volume_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['bare_metal_server_id', 'id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/volumes/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='PATCH',
+ url = '/bare_metal_servers/{bare_metal_server_id}/disks/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- #########################
- # Snapshots
- #########################
-
- def delete_snapshots(self,
- source_volume_id: str,
+ def update_bare_metal_server_disk(self,
+ bare_metal_server_id: str,
+ id: str,
+ bare_metal_server_disk_patch: 'BareMetalServerDiskPatch',
**kwargs
) -> DetailedResponse:
"""
- Delete a filtered collection of snapshots.
+ Update a bare metal server disk.
- This request deletes all snapshots created from a specific source volume.
+ This request updates the bare metal server disk with the information in a provided
+ patch.
- :param str source_volume_id: Filters the collection to resources with the
- source volume with the specified identifier.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str id: The bare metal server disk identifier.
+ :param BareMetalServerDiskPatch bare_metal_server_disk_patch: The bare
+ metal server disk 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 `BareMetalServerDisk` object
"""
- if source_volume_id is None:
- raise ValueError('source_volume_id must be provided')
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ if bare_metal_server_disk_patch is None:
+ raise ValueError('bare_metal_server_disk_patch must be provided')
+ if isinstance(bare_metal_server_disk_patch, BareMetalServerDiskPatch):
+ bare_metal_server_disk_patch = convert_model(bare_metal_server_disk_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_snapshots')
+ operation_id='update_bare_metal_server_disk')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation,
- 'source_volume.id': source_volume_id
+ 'generation': self.generation
}
+ data = json.dumps(bare_metal_server_disk_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
- url = '/snapshots'
- request = self.prepare_request(method='DELETE',
+ path_param_keys = ['bare_metal_server_id', 'id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/bare_metal_servers/{bare_metal_server_id}/disks/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def list_snapshots(self,
+ def list_bare_metal_server_network_interfaces(self,
+ bare_metal_server_id: str,
*,
start: str = None,
limit: int = None,
- resource_group_id: str = None,
- name: str = None,
- source_volume_id: str = None,
- source_volume_crn: str = None,
- source_image_id: str = None,
- source_image_crn: str = None,
- sort: str = None,
**kwargs
) -> DetailedResponse:
"""
- List all snapshots.
+ List all network interfaces on a bare metal server.
- This request lists all snapshots in the region. A snapshot preserves the data of a
- volume at the time the snapshot is created.
+ 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.
- :param str start: (optional) A server-supplied token determining what
+ :param str bare_metal_server_id: The bare metal 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 in the resource group with the specified identifier.
- :param str name: (optional) Filters the collection to resources with the
- exact specified name.
- :param str source_volume_id: (optional) Filters the collection to resources
- with the source volume with the specified identifier.
- :param str source_volume_crn: (optional) Filters the collection to
- resources with the source volume with the specified CRN.
- :param str source_image_id: (optional) Filters the collection to resources
- with the source image with the specified identifier.
- This parameter also supports the values `null` and `not:null` which filter
- the collection to resources which have no source image or any existent
- source image, respectively.
- :param str source_image_crn: (optional) Filters the collection to resources
- with the source volume with the specified CRN.
- This parameter also supports the values `null` and `not:null` which filter
- the collection to resources which have no source image or any existent
- source image, respectively.
- :param str sort: (optional) Sorts the returned collection by the specified
- property name in ascending order. A `-` may be prepended to the name to
- sort in descending order. For example, the value `-created_at` sorts the
- collection by the `created_at` property in descending order, and the value
- `name` sorts it by the `name` property in ascending order.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `SnapshotCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterfaceCollection` object
"""
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_snapshots')
+ operation_id='list_bare_metal_server_network_interfaces')
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
'start': start,
- 'limit': limit,
- 'resource_group.id': resource_group_id,
- 'name': name,
- 'source_volume.id': source_volume_id,
- 'source_volume.crn': source_volume_crn,
- 'source_image.id': source_image_id,
- 'source_image.crn': source_image_crn,
- 'sort': sort
+ 'limit': limit
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/snapshots'
+ path_param_keys = ['bare_metal_server_id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -8097,42 +8191,40 @@ def list_snapshots(self,
return response
- def create_snapshot(self,
- source_volume: 'VolumeIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ def create_bare_metal_server_network_interface(self,
+ bare_metal_server_id: str,
+ bare_metal_server_network_interface_prototype: 'BareMetalServerNetworkInterfacePrototype',
**kwargs
) -> DetailedResponse:
"""
- Create a snapshot.
+ Create a network interface on a bare metal server.
- This request creates a new snapshot from a snapshot prototype object. The
- prototype object is structured in the same way as a retrieved snapshot, and
- contains the information necessary to provision the new snapshot.
+ 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.
- :param VolumeIdentity source_volume: The volume to snapshot.
- :param str name: (optional) The unique user-defined name for this snapshot.
- If unspecified, the name will be a hyphenated list of randomly-selected
- words.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is
- used.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param BareMetalServerNetworkInterfacePrototype
+ bare_metal_server_network_interface_prototype: The 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 `Snapshot` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterface` object
"""
- if source_volume is None:
- raise ValueError('source_volume must be provided')
- source_volume = convert_model(source_volume)
- if resource_group is not None:
- resource_group = convert_model(resource_group)
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
+ if bare_metal_server_network_interface_prototype is None:
+ raise ValueError('bare_metal_server_network_interface_prototype must be provided')
+ if isinstance(bare_metal_server_network_interface_prototype, BareMetalServerNetworkInterfacePrototype):
+ bare_metal_server_network_interface_prototype = convert_model(bare_metal_server_network_interface_prototype)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_snapshot')
+ operation_id='create_bare_metal_server_network_interface')
headers.update(sdk_headers)
params = {
@@ -8140,20 +8232,17 @@ def create_snapshot(self,
'generation': self.generation
}
- data = {
- 'source_volume': source_volume,
- 'name': name,
- 'resource_group': resource_group
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
+ data = json.dumps(bare_metal_server_network_interface_prototype)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/snapshots'
+ path_param_keys = ['bare_metal_server_id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces'.format(**path_param_dict)
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -8164,27 +8253,33 @@ def create_snapshot(self,
return response
- def delete_snapshot(self,
+ def delete_bare_metal_server_network_interface(self,
+ bare_metal_server_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a snapshot.
+ Delete a network interface.
- This request deletes a snapshot. This operation cannot be reversed.
+ 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.
- :param str id: The snapshot identifier.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str id: The network interface identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_snapshot')
+ operation_id='delete_bare_metal_server_network_interface')
headers.update(sdk_headers)
params = {
@@ -8195,10 +8290,10 @@ def delete_snapshot(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['bare_metal_server_id', 'id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/snapshots/{id}'.format(**path_param_dict)
+ url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}'.format(**path_param_dict)
request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
@@ -8208,27 +8303,32 @@ def delete_snapshot(self,
return response
- def get_snapshot(self,
+ def get_bare_metal_server_network_interface(self,
+ bare_metal_server_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a snapshot.
+ Retrieve a network interface.
- This request retrieves a single snapshot specified by the identifier in the URL.
+ This request retrieves a single network interface specified by the identifier in
+ the URL.
- :param str id: The snapshot identifier.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str id: The network interface identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `Snapshot` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterface` object
"""
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_snapshot')
+ operation_id='get_bare_metal_server_network_interface')
headers.update(sdk_headers)
params = {
@@ -8240,10 +8340,10 @@ def get_snapshot(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['bare_metal_server_id', 'id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/snapshots/{id}'.format(**path_param_dict)
+ url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -8253,33 +8353,41 @@ def get_snapshot(self,
return response
- def update_snapshot(self,
+ def update_bare_metal_server_network_interface(self,
+ bare_metal_server_id: str,
id: str,
- snapshot_patch: 'SnapshotPatch',
+ bare_metal_server_network_interface_patch: 'BareMetalServerNetworkInterfacePatch',
**kwargs
) -> DetailedResponse:
"""
- Update a snapshot.
+ Update a network interface.
- This request updates a snapshot's name.
+ 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.
- :param str id: The snapshot identifier.
- :param SnapshotPatch snapshot_patch: The snapshot patch.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str id: The network interface identifier.
+ :param BareMetalServerNetworkInterfacePatch
+ bare_metal_server_network_interface_patch: The 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 `Snapshot` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerNetworkInterface` object
"""
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
if id is None:
raise ValueError('id must be provided')
- if snapshot_patch is None:
- raise ValueError('snapshot_patch must be provided')
- if isinstance(snapshot_patch, SnapshotPatch):
- snapshot_patch = convert_model(snapshot_patch)
+ if bare_metal_server_network_interface_patch is None:
+ raise ValueError('bare_metal_server_network_interface_patch must be provided')
+ if isinstance(bare_metal_server_network_interface_patch, BareMetalServerNetworkInterfacePatch):
+ bare_metal_server_network_interface_patch = convert_model(bare_metal_server_network_interface_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_snapshot')
+ operation_id='update_bare_metal_server_network_interface')
headers.update(sdk_headers)
params = {
@@ -8287,17 +8395,17 @@ def update_snapshot(self,
'generation': self.generation
}
- data = json.dumps(snapshot_patch)
+ data = json.dumps(bare_metal_server_network_interface_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['bare_metal_server_id', 'id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/snapshots/{id}'.format(**path_param_dict)
+ url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{id}'.format(**path_param_dict)
request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
@@ -8307,33 +8415,32 @@ def update_snapshot(self,
response = self.send(request, **kwargs)
return response
- #########################
- # Geography
- #########################
-
- def list_regions(self,
+ def list_bare_metal_server_network_interface_floating_ips(self,
+ bare_metal_server_id: str,
+ network_interface_id: str,
**kwargs
) -> DetailedResponse:
"""
- List all regions.
+ List all floating IPs associated with a network interface.
- 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 floating IPs associated with a network interface.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str network_interface_id: The network interface identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `RegionCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIPUnpaginatedCollection` object
"""
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
+ if network_interface_id is None:
+ raise ValueError('network_interface_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_regions')
+ operation_id='list_bare_metal_server_network_interface_floating_ips')
headers.update(sdk_headers)
params = {
@@ -8345,7 +8452,10 @@ def list_regions(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/regions'
+ path_param_keys = ['bare_metal_server_id', 'network_interface_id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id, network_interface_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -8355,27 +8465,36 @@ def list_regions(self,
return response
- def get_region(self,
- name: str,
+ def remove_bare_metal_server_network_interface_floating_ip(self,
+ bare_metal_server_id: str,
+ network_interface_id: str,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a region.
+ Disassociate a floating IP from a network interface.
- This request retrieves a single region specified by the name in the URL.
+ This request disassociates the specified floating IP from the specified network
+ interface.
- :param str name: The region name.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str network_interface_id: The 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.
- :rtype: DetailedResponse with `dict` result representing a `Region` object
+ :rtype: DetailedResponse
"""
- if name is None:
- raise ValueError('name must be provided')
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
+ if network_interface_id is None:
+ raise ValueError('network_interface_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_region')
+ operation_id='remove_bare_metal_server_network_interface_floating_ip')
headers.update(sdk_headers)
params = {
@@ -8385,13 +8504,12 @@ def get_region(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
- path_param_keys = ['name']
- path_param_values = self.encode_path_vars(name)
+ path_param_keys = ['bare_metal_server_id', 'network_interface_id', 'id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id, network_interface_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/regions/{name}'.format(**path_param_dict)
- request = self.prepare_request(method='GET',
+ url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -8400,29 +8518,36 @@ def get_region(self,
return response
- def list_region_zones(self,
- region_name: str,
+ def get_bare_metal_server_network_interface_floating_ip(self,
+ bare_metal_server_id: str,
+ network_interface_id: str,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- List all zones in a region.
+ Retrieve associated floating IP.
- 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 a retrieves a specified floating IP address if it is associated with
+ the network interface and bare metal server specified in the URL.
- :param str region_name: The region name.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str network_interface_id: The 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.
- :rtype: DetailedResponse with `dict` result representing a `ZoneCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object
"""
- if region_name is None:
- raise ValueError('region_name must be provided')
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
+ if network_interface_id is None:
+ raise ValueError('network_interface_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_region_zones')
+ operation_id='get_bare_metal_server_network_interface_floating_ip')
headers.update(sdk_headers)
params = {
@@ -8434,10 +8559,10 @@ def list_region_zones(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['region_name']
- path_param_values = self.encode_path_vars(region_name)
+ path_param_keys = ['bare_metal_server_id', 'network_interface_id', 'id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id, network_interface_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/regions/{region_name}/zones'.format(**path_param_dict)
+ url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -8447,32 +8572,40 @@ def list_region_zones(self,
return response
- def get_region_zone(self,
- region_name: str,
- name: str,
+ def add_bare_metal_server_network_interface_floating_ip(self,
+ bare_metal_server_id: str,
+ network_interface_id: str,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a zone.
+ Associate a floating IP with a network interface.
- This request retrieves a single zone specified by the region and zone names in the
- URL.
+ 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.
- :param str region_name: The region name.
- :param str name: The zone name.
+ :param str bare_metal_server_id: The bare metal server identifier.
+ :param str network_interface_id: The 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.
- :rtype: DetailedResponse with `dict` result representing a `Zone` object
+ :rtype: DetailedResponse with `dict` result representing a `FloatingIP` object
"""
- if region_name is None:
- raise ValueError('region_name must be provided')
- if name is None:
- raise ValueError('name must be provided')
+ if bare_metal_server_id is None:
+ raise ValueError('bare_metal_server_id must be provided')
+ if network_interface_id is None:
+ raise ValueError('network_interface_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_region_zone')
+ operation_id='add_bare_metal_server_network_interface_floating_ip')
headers.update(sdk_headers)
params = {
@@ -8484,11 +8617,11 @@ def get_region_zone(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['region_name', 'name']
- path_param_values = self.encode_path_vars(region_name, name)
+ path_param_keys = ['bare_metal_server_id', 'network_interface_id', 'id']
+ path_param_values = self.encode_path_vars(bare_metal_server_id, network_interface_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/regions/{region_name}/zones/{name}'.format(**path_param_dict)
- request = self.prepare_request(method='GET',
+ url = '/bare_metal_servers/{bare_metal_server_id}/network_interfaces/{network_interface_id}/floating_ips/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PUT',
url=url,
headers=headers,
params=params)
@@ -8496,56 +8629,45 @@ def get_region_zone(self,
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,
+ def delete_bare_metal_server(self,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- List all public gateways.
+ Delete a bare metal server.
- 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.
+ 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
+ implicitly disassociated.
- :param str start: (optional) A server-supplied 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 in the resource group with the specified identifier.
+ :param str id: The bare metal 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 `PublicGatewayCollection` object
+ :rtype: DetailedResponse
"""
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_public_gateways')
+ operation_id='delete_bare_metal_server')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation,
- 'start': start,
- 'limit': limit,
- 'resource_group.id': resource_group_id
+ 'generation': self.generation
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
- url = '/public_gateways'
- request = self.prepare_request(method='GET',
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/bare_metal_servers/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -8554,55 +8676,28 @@ def list_public_gateways(self,
return response
- def create_public_gateway(self,
- vpc: 'VPCIdentity',
- zone: 'ZoneIdentity',
- *,
- floating_ip: 'PublicGatewayFloatingIPPrototype' = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ def get_bare_metal_server(self,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- Create a public gateway.
+ Retrieve a bare metal server.
- 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 retrieves a single bare metal server specified by the identifier in
+ the URL.
- :param VPCIdentity vpc: The VPC this public gateway will serve.
- :param ZoneIdentity zone: The zone this public gateway will reside in.
- :param PublicGatewayFloatingIPPrototype floating_ip: (optional)
- :param str name: (optional) The user-defined name for this public gateway.
- Names must be unique within the VPC the public gateway resides in. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param 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 bare metal 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 `PublicGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServer` 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 id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_public_gateway')
+ operation_id='get_bare_metal_server')
headers.update(sdk_headers)
params = {
@@ -8610,56 +8705,53 @@ def create_public_gateway(self,
'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'))
headers['Accept'] = 'application/json'
- url = '/public_gateways'
- request = self.prepare_request(method='POST',
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/bare_metal_servers/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def delete_public_gateway(self,
+ def update_bare_metal_server(self,
id: str,
+ bare_metal_server_patch: 'BareMetalServerPatch',
**kwargs
) -> DetailedResponse:
"""
- Delete a public gateway.
+ Update a bare metal server.
- 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 updates a bare metal server with the information in a provided patch.
+ The bare metal server patch object is structured in the same way as a retrieved
+ bare metal server and contains only the information to be updated.
- :param str id: The public gateway identifier.
+ :param str id: The bare metal server identifier.
+ :param BareMetalServerPatch bare_metal_server_patch: The bare metal server
+ 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 `BareMetalServer` object
"""
if id is None:
raise ValueError('id must be provided')
+ if bare_metal_server_patch is None:
+ raise ValueError('bare_metal_server_patch must be provided')
+ if isinstance(bare_metal_server_patch, BareMetalServerPatch):
+ bare_metal_server_patch = convert_model(bare_metal_server_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_public_gateway')
+ operation_id='update_bare_metal_server')
headers.update(sdk_headers)
params = {
@@ -8667,36 +8759,43 @@ def delete_public_gateway(self,
'generation': self.generation
}
+ data = json.dumps(bare_metal_server_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='DELETE',
+ url = '/bare_metal_servers/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def get_public_gateway(self,
+ def get_bare_metal_server_initialization(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a public gateway.
+ Retrieve initialization configuration for a bare metal server.
- This request retrieves a single public gateway specified by the identifier in the
- URL.
+ This request retrieves configuration variables used to initialize the bare metal
+ server, such as the image used, SSH keys, and any configured usernames and
+ passwords. These attributes can subsequently be changed manually by the user and
+ so are not guaranteed to be current.
- :param str id: The public gateway identifier.
+ :param str id: The bare metal 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 `PublicGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `BareMetalServerInitialization` object
"""
if id is None:
@@ -8704,7 +8803,7 @@ def get_public_gateway(self,
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_public_gateway')
+ operation_id='get_bare_metal_server_initialization')
headers.update(sdk_headers)
params = {
@@ -8719,7 +8818,7 @@ def get_public_gateway(self,
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 = '/bare_metal_servers/{id}/initialization'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -8729,33 +8828,28 @@ def get_public_gateway(self,
return response
- def update_public_gateway(self,
+ def restart_bare_metal_server(self,
id: str,
- public_gateway_patch: 'PublicGatewayPatch',
**kwargs
) -> DetailedResponse:
"""
- Update a public gateway.
+ Restart a bare metal server.
- This request updates a public gateway's name.
+ This request restarts a bare metal server. It will run immediately regardless of
+ the state of the server.
- :param str id: The public gateway identifier.
- :param PublicGatewayPatch public_gateway_patch: The public gateway patch.
+ :param str id: The bare metal 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 `PublicGateway` object
+ :rtype: DetailedResponse
"""
if id is None:
raise ValueError('id must be provided')
- if public_gateway_patch is None:
- raise ValueError('public_gateway_patch must be provided')
- if isinstance(public_gateway_patch, PublicGatewayPatch):
- public_gateway_patch = convert_model(public_gateway_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_public_gateway')
+ operation_id='restart_bare_metal_server')
headers.update(sdk_headers)
params = {
@@ -8763,74 +8857,14 @@ def update_public_gateway(self,
'generation': self.generation
}
- data = json.dumps(public_gateway_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- 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)
- request = self.prepare_request(method='PATCH',
- url=url,
- headers=headers,
- params=params,
- data=data)
-
- response = self.send(request, **kwargs)
- return response
-
- #########################
- # Floating IPs
- #########################
-
-
- def list_floating_ips(self,
- *,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- **kwargs
- ) -> DetailedResponse:
- """
- List all floating IPs.
-
- This request lists all floating IPs in the region. Floating IPs allow inbound and
- outbound traffic from the Internet to an instance.
-
- :param str start: (optional) A server-supplied 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 in the resource group with 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 `FloatingIPCollection` object
- """
-
- headers = {}
- sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
- service_version='V1',
- 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
- }
-
- if 'headers' in kwargs:
- headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
-
- url = '/floating_ips'
- request = self.prepare_request(method='GET',
+ url = '/bare_metal_servers/{id}/restart'.format(**path_param_dict)
+ request = self.prepare_request(method='POST',
url=url,
headers=headers,
params=params)
@@ -8839,30 +8873,28 @@ def list_floating_ips(self,
return response
- def create_floating_ip(self,
- floating_ip_prototype: 'FloatingIPPrototype',
+ def start_bare_metal_server(self,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- Reserve a floating IP.
+ Start a bare metal server.
- This request reserves a new floating IP.
+ This request starts a bare metal server. It will run immediately provided the
+ server is stopped.
- :param FloatingIPPrototype floating_ip_prototype: The floating IP prototype
- object.
+ :param str id: The bare metal 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 `FloatingIP` object
+ :rtype: DetailedResponse
"""
- 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 id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_floating_ip')
+ operation_id='start_bare_metal_server')
headers.update(sdk_headers)
params = {
@@ -8870,36 +8902,38 @@ def create_floating_ip(self,
'generation': self.generation
}
- data = json.dumps(floating_ip_prototype)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
- url = '/floating_ips'
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/bare_metal_servers/{id}/start'.format(**path_param_dict)
request = self.prepare_request(method='POST',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def delete_floating_ip(self,
+ def stop_bare_metal_server(self,
id: str,
+ type: str,
**kwargs
) -> DetailedResponse:
"""
- Release a floating IP.
+ Stop a bare metal server.
- 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 stops a bare metal server. It will run immediately provided the
+ server is running. Note: A soft stop may not complete as it relies on the
+ operating system to perform the operation.
- :param str id: The floating IP identifier.
+ :param str id: The bare metal server identifier.
+ :param str type: The type of stop operation:
+ - `soft`: signal running operating system to quiesce and shutdown cleanly
+ - `hard`: immediately stop the server.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
@@ -8907,10 +8941,12 @@ def delete_floating_ip(self,
if id is None:
raise ValueError('id must be provided')
+ if type is None:
+ raise ValueError('type 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='stop_bare_metal_server')
headers.update(sdk_headers)
params = {
@@ -8918,59 +8954,72 @@ def delete_floating_ip(self,
'generation': self.generation
}
+ data = {
+ 'type': type
+ }
+ 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'))
path_param_keys = ['id']
path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/floating_ips/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ url = '/bare_metal_servers/{id}/stop'.format(**path_param_dict)
+ request = self.prepare_request(method='POST',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
+ #########################
+ # Volumes
+ #########################
- def get_floating_ip(self,
- id: str,
+
+ def list_volume_profiles(self,
+ *,
+ start: str = None,
+ limit: int = None,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a floating IP.
+ List all volume profiles.
- This request retrieves a single floating IP specified by the identifier in the
- URL.
+ This request lists all volume profiles available in the region. A volume profile
+ specifies the performance characteristics and pricing model for a volume.
- :param str id: The floating IP 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 `FloatingIP` object
+ :rtype: DetailedResponse with `dict` result representing a `VolumeProfileCollection` object
"""
- if id is None:
- raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_floating_ip')
+ operation_id='list_volume_profiles')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit
}
if 'headers' in kwargs:
headers.update(kwargs.get('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 = '/floating_ips/{id}'.format(**path_param_dict)
+ url = '/volume/profiles'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -8980,33 +9029,27 @@ def get_floating_ip(self,
return response
- def update_floating_ip(self,
- id: str,
- floating_ip_patch: 'FloatingIPPatch',
+ def get_volume_profile(self,
+ name: str,
**kwargs
) -> DetailedResponse:
"""
- Update a floating IP.
+ Retrieve a volume profile.
- This request updates a floating IP's name and/or target.
+ This request retrieves a single volume profile specified by the name in the URL.
- :param str id: The floating IP identifier.
- :param FloatingIPPatch floating_ip_patch: The floating IP patch.
+ :param str name: The volume 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 `FloatingIP` object
+ :rtype: DetailedResponse with `dict` result representing a `VolumeProfile` object
"""
- if id is None:
- 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 name is None:
+ raise ValueError('name must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_floating_ip')
+ operation_id='get_volume_profile')
headers.update(sdk_headers)
params = {
@@ -9014,60 +9057,53 @@ def update_floating_ip(self,
'generation': self.generation
}
- data = json.dumps(floating_ip_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('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 = '/floating_ips/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='PATCH',
+ url = '/volume/profiles/{name}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- #########################
- # Network ACLs
- #########################
-
- def list_network_acls(self,
+ def list_volumes(self,
*,
start: str = None,
limit: int = None,
- resource_group_id: str = None,
+ name: str = None,
+ zone_name: str = None,
**kwargs
) -> DetailedResponse:
"""
- List all network ACLs.
+ List all volumes.
- 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 lists all volumes in the region. Volumes are network-connected block
+ storage devices that may be attached to one or more instances in the same region.
- :param str start: (optional) A server-supplied token determining what
+ :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 in the resource group with the specified identifier.
+ :param str name: (optional) Filters the collection to resources with the
+ exact specified name.
+ :param str zone_name: (optional) Filters the collection to resources in the
+ zone with the exact specified name.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `NetworkACLCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `VolumeCollection` object
"""
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_network_acls')
+ operation_id='list_volumes')
headers.update(sdk_headers)
params = {
@@ -9075,14 +9111,15 @@ def list_network_acls(self,
'generation': self.generation,
'start': start,
'limit': limit,
- 'resource_group.id': resource_group_id
+ 'name': name,
+ 'zone.name': zone_name
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/network_acls'
+ url = '/volumes'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -9092,31 +9129,31 @@ def list_network_acls(self,
return response
- def create_network_acl(self,
- *,
- network_acl_prototype: 'NetworkACLPrototype' = None,
+ def create_volume(self,
+ volume_prototype: 'VolumePrototype',
**kwargs
) -> DetailedResponse:
"""
- Create a network ACL.
+ Create a volume.
- This request creates a new network ACL from a network ACL prototype object. The
- prototype object is structured in the same way as a retrieved network ACL, and
- contains the information necessary to create the new network ACL.
+ This request creates a new volume from a volume prototype object. The prototype
+ object is structured in the same way as a retrieved volume, and contains the
+ information necessary to create the new volume.
- :param NetworkACLPrototype network_acl_prototype: (optional) The network
- ACL prototype object.
+ :param VolumePrototype volume_prototype: The volume 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
+ :rtype: DetailedResponse with `dict` result representing a `Volume` object
"""
- if network_acl_prototype is not None and isinstance(network_acl_prototype, NetworkACLPrototype):
- network_acl_prototype = convert_model(network_acl_prototype)
+ if volume_prototype is None:
+ raise ValueError('volume_prototype must be provided')
+ if isinstance(volume_prototype, VolumePrototype):
+ volume_prototype = convert_model(volume_prototype)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_network_acl')
+ operation_id='create_volume')
headers.update(sdk_headers)
params = {
@@ -9124,14 +9161,14 @@ def create_network_acl(self,
'generation': self.generation
}
- data = json.dumps(network_acl_prototype)
+ data = json.dumps(volume_prototype)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/network_acls'
+ url = '/volumes'
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -9142,18 +9179,17 @@ def create_network_acl(self,
return response
- def delete_network_acl(self,
+ def delete_volume(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a network ACL.
+ Delete a volume.
- This request deletes a network ACL. This operation cannot be reversed. For this
- request to succeed, the network ACL must not be the default network ACL for any
- VPCs, and the network ACL must not be attached to any subnets.
+ This request deletes a volume. This operation cannot be reversed. For this request
+ to succeed, the volume must not be attached to any instances.
- :param str id: The network ACL identifier.
+ :param str id: The volume identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
@@ -9164,7 +9200,7 @@ def delete_network_acl(self,
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_network_acl')
+ operation_id='delete_volume')
headers.update(sdk_headers)
params = {
@@ -9178,7 +9214,7 @@ def delete_network_acl(self,
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 = '/volumes/{id}'.format(**path_param_dict)
request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
@@ -9188,20 +9224,19 @@ def delete_network_acl(self,
return response
- def get_network_acl(self,
+ def get_volume(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a network ACL.
+ Retrieve a volume.
- This request retrieves a single network ACL specified by the identifier in the
- URL.
+ This request retrieves a single volume specified by the identifier in the URL.
- :param str id: The network ACL identifier.
+ :param str id: The volume 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 `Volume` object
"""
if id is None:
@@ -9209,7 +9244,7 @@ def get_network_acl(self,
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_network_acl')
+ operation_id='get_volume')
headers.update(sdk_headers)
params = {
@@ -9224,7 +9259,7 @@ def get_network_acl(self,
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 = '/volumes/{id}'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -9234,33 +9269,35 @@ def get_network_acl(self,
return response
- def update_network_acl(self,
+ def update_volume(self,
id: str,
- network_acl_patch: 'NetworkACLPatch',
+ volume_patch: 'VolumePatch',
**kwargs
) -> DetailedResponse:
"""
- Update a network ACL.
+ Update a volume.
- This request updates a network ACL's name.
+ This request updates a volume with the information in a provided volume patch. The
+ volume patch object is structured in the same way as a retrieved volume and
+ contains only the information to be updated.
- :param str id: The network ACL identifier.
- :param NetworkACLPatch network_acl_patch: The network ACL patch.
+ :param str id: The volume identifier.
+ :param VolumePatch volume_patch: The volume 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 `NetworkACL` object
+ :rtype: DetailedResponse with `dict` result representing a `Volume` object
"""
if id is None:
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 volume_patch is None:
+ raise ValueError('volume_patch must be provided')
+ if isinstance(volume_patch, VolumePatch):
+ volume_patch = convert_model(volume_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_network_acl')
+ operation_id='update_volume')
headers.update(sdk_headers)
params = {
@@ -9268,7 +9305,7 @@ def update_network_acl(self,
'generation': self.generation
}
- data = json.dumps(network_acl_patch)
+ data = json.dumps(volume_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -9278,7 +9315,7 @@ def update_network_acl(self,
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 = '/volumes/{id}'.format(**path_param_dict)
request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
@@ -9288,58 +9325,46 @@ def update_network_acl(self,
response = self.send(request, **kwargs)
return response
+ #########################
+ # Snapshots
+ #########################
+
- def list_network_acl_rules(self,
- network_acl_id: str,
- *,
- start: str = None,
- limit: int = None,
- direction: str = None,
+ def delete_snapshots(self,
+ source_volume_id: str,
**kwargs
) -> DetailedResponse:
"""
- List all rules for a network ACL.
+ Delete a filtered collection of snapshots.
- 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 deletes all snapshots created from a specific source volume.
- :param str network_acl_id: The network ACL identifier.
- :param str start: (optional) A server-supplied 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 the
- specified direction.
+ :param str source_volume_id: Filters the collection to resources with the
+ source volume with 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 `NetworkACLRuleCollection` object
+ :rtype: DetailedResponse
"""
- if network_acl_id is None:
- raise ValueError('network_acl_id must be provided')
+ if source_volume_id is None:
+ raise ValueError('source_volume_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_network_acl_rules')
+ operation_id='delete_snapshots')
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
- 'start': start,
- 'limit': limit,
- 'direction': direction
+ 'source_volume.id': source_volume_id
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
- 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 = '/snapshots'
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -9348,89 +9373,126 @@ def list_network_acl_rules(self,
return response
- def create_network_acl_rule(self,
- network_acl_id: str,
- network_acl_rule_prototype: 'NetworkACLRulePrototype',
+ def list_snapshots(self,
+ *,
+ start: str = None,
+ limit: int = None,
+ resource_group_id: str = None,
+ name: str = None,
+ source_volume_id: str = None,
+ source_volume_crn: str = None,
+ source_image_id: str = None,
+ source_image_crn: str = None,
+ sort: str = None,
**kwargs
) -> DetailedResponse:
"""
- Create a rule for a network ACL.
+ List all snapshots.
- 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 lists all snapshots in the region. A snapshot preserves the data of a
+ volume at the time the snapshot is created.
- :param str network_acl_id: The network ACL identifier.
- :param NetworkACLRulePrototype network_acl_rule_prototype: The network ACL
- rule prototype object.
+ :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 in the resource group with the specified identifier.
+ :param str name: (optional) Filters the collection to resources with the
+ exact specified name.
+ :param str source_volume_id: (optional) Filters the collection to resources
+ with the source volume with the specified identifier.
+ :param str source_volume_crn: (optional) Filters the collection to
+ resources with the source volume with the specified CRN.
+ :param str source_image_id: (optional) Filters the collection to resources
+ with the source image with the specified identifier.
+ This parameter also supports the values `null` and `not:null` which filter
+ the collection to resources which have no source image or any existent
+ source image, respectively.
+ :param str source_image_crn: (optional) Filters the collection to resources
+ with the source volume with the specified CRN.
+ This parameter also supports the values `null` and `not:null` which filter
+ the collection to resources which have no source image or any existent
+ source image, respectively.
+ :param str sort: (optional) Sorts the returned collection by the specified
+ property name in ascending order. A `-` may be prepended to the name to
+ sort in descending order. For example, the value `-created_at` sorts the
+ collection by the `created_at` property in descending order, and the value
+ `name` sorts it by the `name` property in ascending order.
:param dict headers: 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 `SnapshotCollection` object
"""
- if network_acl_id is None:
- 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_network_acl_rule')
+ operation_id='list_snapshots')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'resource_group.id': resource_group_id,
+ 'name': name,
+ 'source_volume.id': source_volume_id,
+ 'source_volume.crn': source_volume_crn,
+ 'source_image.id': source_image_id,
+ 'source_image.crn': source_image_crn,
+ 'sort': sort
}
- data = json.dumps(network_acl_rule_prototype)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- 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 = '/snapshots'
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def delete_network_acl_rule(self,
- network_acl_id: str,
- id: str,
+ def create_snapshot(self,
+ source_volume: 'VolumeIdentity',
+ *,
+ name: str = None,
+ resource_group: 'ResourceGroupIdentity' = None,
**kwargs
) -> DetailedResponse:
"""
- Delete a network ACL rule.
+ Create a snapshot.
- This request deletes a rule. This operation cannot be reversed.
+ This request creates a new snapshot from a snapshot prototype object. The
+ prototype object is structured in the same way as a retrieved snapshot, and
+ contains the information necessary to provision the new snapshot.
- :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
+ :param VolumeIdentity source_volume: The volume to snapshot.
+ :param str name: (optional) The unique user-defined name for this snapshot.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is
+ used.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `Snapshot` object
"""
- if network_acl_id is None:
- raise ValueError('network_acl_id must be provided')
- if id is None:
- raise ValueError('id must be provided')
+ if source_volume is None:
+ raise ValueError('source_volume must be provided')
+ source_volume = convert_model(source_volume)
+ if resource_group is not None:
+ resource_group = convert_model(resource_group)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_network_acl_rule')
+ operation_id='create_snapshot')
headers.update(sdk_headers)
params = {
@@ -9438,47 +9500,51 @@ def delete_network_acl_rule(self,
'generation': self.generation
}
+ data = {
+ 'source_volume': source_volume,
+ 'name': name,
+ 'resource_group': resource_group
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='DELETE',
+ url = '/snapshots'
+ request = self.prepare_request(method='POST',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def get_network_acl_rule(self,
- network_acl_id: str,
+ def delete_snapshot(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a network ACL rule.
+ Delete a snapshot.
- This request retrieves a single rule specified by the identifier in the URL.
+ This request deletes a snapshot. This operation cannot be reversed.
- :param str network_acl_id: The network ACL identifier.
- :param str id: The rule identifier.
+ :param str id: The snapshot 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
"""
- if network_acl_id is None:
- raise ValueError('network_acl_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_network_acl_rule')
+ operation_id='delete_snapshot')
headers.update(sdk_headers)
params = {
@@ -9488,13 +9554,12 @@ def get_network_acl_rule(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='GET',
+ url = '/snapshots/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -9503,40 +9568,27 @@ def get_network_acl_rule(self,
return response
- def update_network_acl_rule(self,
- network_acl_id: str,
+ def get_snapshot(self,
id: str,
- network_acl_rule_patch: 'NetworkACLRulePatch',
**kwargs
) -> DetailedResponse:
"""
- Update a network ACL rule.
+ Retrieve a snapshot.
- 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 retrieves a single snapshot specified by the identifier in the URL.
- :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 snapshot 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 `Snapshot` object
"""
- if network_acl_id is None:
- raise ValueError('network_acl_id must be provided')
if id is None:
raise ValueError('id must be provided')
- if network_acl_rule_patch is None:
- raise ValueError('network_acl_rule_patch must be provided')
- if isinstance(network_acl_rule_patch, NetworkACLRulePatch):
- network_acl_rule_patch = convert_model(network_acl_rule_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_network_acl_rule')
+ operation_id='get_snapshot')
headers.update(sdk_headers)
params = {
@@ -9544,143 +9596,104 @@ def update_network_acl_rule(self,
'generation': self.generation
}
- data = json.dumps(network_acl_rule_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='PATCH',
+ url = '/snapshots/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- #########################
- # Security groups
- #########################
-
- def list_security_groups(self,
- *,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- vpc_id: str = None,
- vpc_crn: str = None,
- vpc_name: str = None,
+ def update_snapshot(self,
+ id: str,
+ snapshot_patch: 'SnapshotPatch',
**kwargs
) -> DetailedResponse:
"""
- List all security groups.
+ Update a snapshot.
- 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 updates a snapshot's name.
- :param str start: (optional) A server-supplied 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 in the resource group with the specified identifier.
- :param str vpc_id: (optional) Filters the collection to resources in the
- VPC with the specified identifier.
- :param str vpc_crn: (optional) Filters the collection to resources in the
- VPC with the specified CRN.
- :param str vpc_name: (optional) Filters the collection to resources in the
- VPC with the exact specified name.
+ :param str id: The snapshot identifier.
+ :param SnapshotPatch snapshot_patch: The snapshot 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 `SecurityGroupCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `Snapshot` object
"""
+ if id is None:
+ raise ValueError('id must be provided')
+ if snapshot_patch is None:
+ raise ValueError('snapshot_patch must be provided')
+ if isinstance(snapshot_patch, SnapshotPatch):
+ snapshot_patch = convert_model(snapshot_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_security_groups')
+ operation_id='update_snapshot')
headers.update(sdk_headers)
params = {
'version': self.version,
- '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
+ 'generation': self.generation
}
+ data = json.dumps(snapshot_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/security_groups'
- request = self.prepare_request(method='GET',
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/snapshots/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
+ #########################
+ # Geography
+ #########################
+
- def create_security_group(self,
- vpc: 'VPCIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
- rules: List['SecurityGroupRulePrototype'] = None,
+ def list_regions(self,
**kwargs
) -> DetailedResponse:
"""
- Create a security group.
+ List all regions.
- 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 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 VPCIdentity vpc: The VPC this security group is to be a part of.
- :param str name: (optional) The user-defined name for this security group.
- If unspecified, the name will be a hyphenated list of randomly-selected
- words. Names must be unique within the VPC the security group resides in.
- :param 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 `RegionCollection` object
"""
- 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_security_group')
+ operation_id='list_regions')
headers.update(sdk_headers)
params = {
@@ -9688,55 +9701,41 @@ def create_security_group(self,
'generation': self.generation
}
- data = {
- '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)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/security_groups'
- request = self.prepare_request(method='POST',
+ url = '/regions'
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def delete_security_group(self,
- id: str,
+ def get_region(self,
+ name: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a security group.
+ Retrieve a region.
- This request deletes a security group. A security group cannot be deleted if it is
- referenced by any network interfaces or other security group rules. Additionally,
- a VPC's default security group cannot be deleted. This operation cannot be
- reversed.
+ This request retrieves a single region specified by the name in the URL.
- :param str id: The security group identifier.
+ :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
+ :rtype: DetailedResponse with `dict` result representing a `Region` object
"""
- if id is None:
- raise ValueError('id must be provided')
+ if name is None:
+ raise ValueError('name must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_security_group')
+ operation_id='get_region')
headers.update(sdk_headers)
params = {
@@ -9746,12 +9745,13 @@ def delete_security_group(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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 = '/security_groups/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ url = '/regions/{name}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
params=params)
@@ -9760,28 +9760,29 @@ def delete_security_group(self,
return response
- def get_security_group(self,
- id: str,
+ def list_region_zones(self,
+ region_name: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a security group.
+ List all zones in a region.
- This request retrieves a single security group specified by the identifier in the
- URL path.
+ 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 id: The security group identifier.
+ :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 `SecurityGroup` object
+ :rtype: DetailedResponse with `dict` result representing a `ZoneCollection` object
"""
- if id is None:
- raise ValueError('id must be provided')
+ if region_name is None:
+ raise ValueError('region_name must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_security_group')
+ operation_id='list_region_zones')
headers.update(sdk_headers)
params = {
@@ -9793,10 +9794,10 @@ def get_security_group(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(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 = '/security_groups/{id}'.format(**path_param_dict)
+ url = '/regions/{region_name}/zones'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -9806,35 +9807,32 @@ def get_security_group(self,
return response
- def update_security_group(self,
- id: str,
- security_group_patch: 'SecurityGroupPatch',
+ def get_region_zone(self,
+ region_name: str,
+ name: str,
**kwargs
) -> DetailedResponse:
"""
- Update a security group.
+ Retrieve a zone.
- 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 retrieves a single zone specified by the region and zone names in the
+ URL.
- :param str id: The security group identifier.
- :param SecurityGroupPatch security_group_patch: The security group patch.
+ :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 `SecurityGroup` object
+ :rtype: DetailedResponse with `dict` result representing a `Zone` object
"""
- if id is None:
- 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 region_name is None:
+ raise ValueError('region_name must be provided')
+ if name is None:
+ raise ValueError('name must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_security_group')
+ operation_id='get_region_zone')
headers.update(sdk_headers)
params = {
@@ -9842,72 +9840,71 @@ def update_security_group(self,
'generation': self.generation
}
- data = json.dumps(security_group_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(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 = '/security_groups/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='PATCH',
+ url = '/regions/{region_name}/zones/{name}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
+ #########################
+ # Public gateways
+ #########################
- def list_security_group_network_interfaces(self,
- security_group_id: str,
+
+ def list_public_gateways(self,
*,
start: str = None,
limit: int = None,
+ resource_group_id: str = None,
**kwargs
) -> DetailedResponse:
"""
- List all network interfaces associated with a security group.
+ List all public gateways.
- This request lists all network interfaces associated with a security group, to
- which the rules in the security group are applied.
+ 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 security_group_id: The security group identifier.
- :param str start: (optional) A server-supplied token determining what
+ :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 in the resource group with 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 `NetworkInterfaceCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `PublicGatewayCollection` object
"""
- if security_group_id is None:
- raise ValueError('security_group_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_security_group_network_interfaces')
+ operation_id='list_public_gateways')
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
'start': start,
- 'limit': limit
+ 'limit': limit,
+ 'resource_group.id': resource_group_id
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id']
- path_param_values = self.encode_path_vars(security_group_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{security_group_id}/network_interfaces'.format(**path_param_dict)
+ url = '/public_gateways'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -9917,35 +9914,55 @@ def list_security_group_network_interfaces(self,
return response
- def remove_security_group_network_interface(self,
- security_group_id: str,
- id: str,
+ def create_public_gateway(self,
+ vpc: 'VPCIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ floating_ip: 'PublicGatewayFloatingIPPrototype' = None,
+ name: str = None,
+ resource_group: 'ResourceGroupIdentity' = None,
**kwargs
) -> DetailedResponse:
"""
- Remove a network interface from a security group.
+ Create a public gateway.
- This request removes a network interface from a security group. Security groups
- are stateful, so any changes to a network interface's security groups are applied
- to new connections. Existing connections are not affected. If the network
- interface being removed has no other security groups, it will be attached to the
- VPC's default security group.
+ 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 str security_group_id: The security group identifier.
- :param str id: The network interface identifier.
+ :param VPCIdentity vpc: The VPC this public gateway will serve.
+ :param ZoneIdentity zone: The zone this public gateway will reside in.
+ :param PublicGatewayFloatingIPPrototype floating_ip: (optional)
+ :param str name: (optional) The user-defined name for this public gateway.
+ Names must be unique within the VPC the public gateway resides in. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param 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 `PublicGateway` object
"""
- if security_group_id is None:
- raise ValueError('security_group_id must be provided')
- if id is None:
- raise ValueError('id must be provided')
+ 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 = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='remove_security_group_network_interface')
+ operation_id='create_public_gateway')
headers.update(sdk_headers)
params = {
@@ -9953,49 +9970,56 @@ def remove_security_group_network_interface(self,
'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'))
+ headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{security_group_id}/network_interfaces/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ url = '/public_gateways'
+ request = self.prepare_request(method='POST',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def get_security_group_network_interface(self,
- security_group_id: str,
+ def delete_public_gateway(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a network interface in a security group.
+ Delete a public gateway.
- This request retrieves a single network interface specified by the identifier in
- the URL path. The network interface must be an existing member of the security
- group.
+ 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 security_group_id: The security group identifier.
- :param str id: The network interface 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 `NetworkInterface` object
+ :rtype: DetailedResponse
"""
- if security_group_id is None:
- raise ValueError('security_group_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_security_group_network_interface')
+ operation_id='delete_public_gateway')
headers.update(sdk_headers)
params = {
@@ -10005,13 +10029,12 @@ def get_security_group_network_interface(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_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}/network_interfaces/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='GET',
+ url = '/public_gateways/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -10020,34 +10043,28 @@ def get_security_group_network_interface(self,
return response
- def add_security_group_network_interface(self,
- security_group_id: str,
+ def get_public_gateway(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Add a network interface to a security group.
+ Retrieve a public gateway.
- This request adds an existing network interface to an existing security group.
- When a network interface is added to a security group, the security group rules
- are applied to the network interface. A request body is not required, and if
- supplied, is ignored.
+ This request retrieves a single public gateway specified by the identifier in the
+ URL.
- :param str security_group_id: The security group identifier.
- :param str id: The network interface 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 `NetworkInterface` object
+ :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object
"""
- if security_group_id is None:
- raise ValueError('security_group_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='add_security_group_network_interface')
+ operation_id='get_public_gateway')
headers.update(sdk_headers)
params = {
@@ -10059,11 +10076,11 @@ def add_security_group_network_interface(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_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}/network_interfaces/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='PUT',
+ url = '/public_gateways/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
params=params)
@@ -10072,29 +10089,33 @@ def add_security_group_network_interface(self,
return response
- def list_security_group_rules(self,
- security_group_id: str,
+ def update_public_gateway(self,
+ id: str,
+ public_gateway_patch: 'PublicGatewayPatch',
**kwargs
) -> DetailedResponse:
"""
- List all rules in a security group.
+ Update a public gateway.
- 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 updates a public gateway's name.
- :param str security_group_id: The security group identifier.
+ :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 `SecurityGroupRuleCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `PublicGateway` object
"""
- if security_group_id is None:
- raise ValueError('security_group_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ 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='list_security_group_rules')
+ operation_id='update_public_gateway')
headers.update(sdk_headers)
params = {
@@ -10102,14 +10123,73 @@ def list_security_group_rules(self,
'generation': self.generation
}
+ data = json.dumps(public_gateway_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id']
- path_param_values = self.encode_path_vars(security_group_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'.format(**path_param_dict)
+ url = '/public_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
+
+ #########################
+ # Floating IPs
+ #########################
+
+
+ def list_floating_ips(self,
+ *,
+ start: str = None,
+ limit: int = None,
+ resource_group_id: str = None,
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ List all floating IPs.
+
+ This request lists all floating IPs in the region. Floating IPs allow inbound and
+ outbound traffic from the Internet to an instance.
+
+ :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 in the resource group with 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 `FloatingIPCollection` object
+ """
+
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ 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
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
+
+ url = '/floating_ips'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -10119,42 +10199,30 @@ def list_security_group_rules(self,
return response
- def create_security_group_rule(self,
- security_group_id: str,
- security_group_rule_prototype: 'SecurityGroupRulePrototype',
+ def create_floating_ip(self,
+ 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 should allow. Security group rules are stateful, such
- that reverse traffic in response to allowed traffic is automatically permitted. A
- rule allowing inbound TCP traffic on port 80 also allows outbound TCP traffic on
- port 80 without the need for an additional rule.
+ 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 security_group_id is None:
- 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)
params = {
@@ -10162,17 +10230,14 @@ def create_security_group_rule(self,
'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:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id']
- path_param_values = self.encode_path_vars(security_group_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict)
+ url = '/floating_ips'
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -10183,33 +10248,29 @@ def create_security_group_rule(self,
return response
- def delete_security_group_rule(self,
- security_group_id: str,
+ def delete_floating_ip(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a security group rule.
+ Release 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 security_group_id is None:
- raise ValueError('security_group_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_security_group_rule')
+ operation_id='delete_floating_ip')
headers.update(sdk_headers)
params = {
@@ -10220,10 +10281,10 @@ def delete_security_group_rule(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_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,
headers=headers,
@@ -10233,32 +10294,28 @@ def delete_security_group_rule(self,
return response
- def get_security_group_rule(self,
- security_group_id: str,
+ def get_floating_ip(self,
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 security_group_id is None:
- raise ValueError('security_group_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_security_group_rule')
+ operation_id='get_floating_ip')
headers.update(sdk_headers)
params = {
@@ -10270,10 +10327,10 @@ def get_security_group_rule(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_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,
headers=headers,
@@ -10283,40 +10340,33 @@ def get_security_group_rule(self,
return response
- def update_security_group_rule(self,
- security_group_id: str,
+ def update_floating_ip(self,
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 security_group_id is None:
- raise ValueError('security_group_id must be provided')
if id is None:
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)
params = {
@@ -10324,17 +10374,17 @@ def update_security_group_rule(self,
'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:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_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,
headers=headers,
@@ -10344,52 +10394,55 @@ def update_security_group_rule(self,
response = self.send(request, **kwargs)
return response
+ #########################
+ # Network ACLs
+ #########################
+
- def list_security_group_targets(self,
- security_group_id: str,
+ def list_network_acls(self,
*,
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-supplied token determining what
+ :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 in the resource group with 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 security_group_id is None:
- raise ValueError('security_group_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_security_group_targets')
+ operation_id='list_network_acls')
headers.update(sdk_headers)
params = {
'version': self.version,
'generation': self.generation,
'start': start,
- 'limit': limit
+ 'limit': limit,
+ 'resource_group.id': resource_group_id
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id']
- path_param_values = self.encode_path_vars(security_group_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/security_groups/{security_group_id}/targets'.format(**path_param_dict)
+ url = '/network_acls'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -10399,37 +10452,79 @@ def list_security_group_targets(self,
return response
- def delete_security_group_target_binding(self,
- security_group_id: str,
+ def create_network_acl(self,
+ *,
+ network_acl_prototype: 'NetworkACLPrototype' = None,
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ Create a network ACL.
+
+ This request creates a new network ACL from a network ACL prototype object. The
+ prototype object is structured in the same way as a retrieved network ACL, and
+ contains the information necessary to create the new network ACL.
+
+ :param NetworkACLPrototype network_acl_prototype: (optional) 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 not None and 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'))
+ 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:
"""
- 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 supplied
- target identifier can be:
- - A network interface identifier
- - An application load balancer 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 security_group_id is None:
- raise ValueError('security_group_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_security_group_target_binding')
+ operation_id='delete_network_acl')
headers.update(sdk_headers)
params = {
@@ -10440,10 +10535,10 @@ def delete_security_group_target_binding(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_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,
headers=headers,
@@ -10453,32 +10548,28 @@ def delete_security_group_target_binding(self,
return response
- def get_security_group_target(self,
- security_group_id: str,
+ def get_network_acl(self,
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 security_group_id is None:
- raise ValueError('security_group_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_security_group_target')
+ operation_id='get_network_acl')
headers.update(sdk_headers)
params = {
@@ -10490,10 +10581,10 @@ def get_security_group_target(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['security_group_id', 'id']
- path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_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,
headers=headers,
@@ -10503,36 +10594,33 @@ def get_security_group_target(self,
return response
- def create_security_group_target_binding(self,
- security_group_id: str,
+ def update_network_acl(self,
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 supplied target
- identifier can be:
- - A network interface identifier
- - An application load balancer 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 supplied, 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 security_group_id is None:
- raise ValueError('security_group_id must be provided')
if id is None:
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)
params = {
@@ -10540,64 +10628,77 @@ def create_security_group_target_binding(self,
'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'))
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)
- request = self.prepare_request(method='PUT',
+ url = '/network_acls/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- #########################
- # VPN gateways
- #########################
-
- def list_ike_policies(self,
+ 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 start: (optional) A server-supplied token determining what
+ :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 the
+ specified direction.
:param dict headers: 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 network_acl_id is None:
+ 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)
params = {
'version': self.version,
'generation': self.generation,
'start': start,
- 'limit': limit
+ 'limit': limit,
+ 'direction': direction
}
if 'headers' in kwargs:
headers.update(kwargs.get('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,
headers=headers,
@@ -10607,51 +10708,36 @@ def list_ike_policies(self,
return response
- def create_ike_policy(self,
- authentication_algorithm: str,
- dh_group: int,
- encryption_algorithm: str,
- ike_version: int,
- *,
- key_lifetime: int = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ def create_network_acl_rule(self,
+ 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 user-defined name for this IKE policy.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) 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 network_acl_id is None:
+ 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)
params = {
@@ -10659,24 +10745,17 @@ def create_ike_policy(self,
'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:
headers.update(kwargs.get('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,
headers=headers,
@@ -10687,29 +10766,31 @@ def create_ike_policy(self,
return response
- def delete_ike_policy(self,
+ 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 network_acl_id is None:
+ raise ValueError('network_acl_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_ike_policy')
+ operation_id='delete_network_acl_rule')
headers.update(sdk_headers)
params = {
@@ -10720,10 +10801,10 @@ def delete_ike_policy(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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,
headers=headers,
@@ -10733,27 +10814,31 @@ def delete_ike_policy(self,
return response
- def get_ike_policy(self,
+ 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 network_acl_id is None:
+ raise ValueError('network_acl_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_ike_policy')
+ operation_id='get_network_acl_rule')
headers.update(sdk_headers)
params = {
@@ -10765,10 +10850,10 @@ def get_ike_policy(self,
headers.update(kwargs.get('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,
headers=headers,
@@ -10778,33 +10863,40 @@ def get_ike_policy(self,
return response
- def update_ike_policy(self,
+ 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 network_acl_id is None:
+ raise ValueError('network_acl_id must be provided')
if id is None:
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)
params = {
@@ -10812,17 +10904,17 @@ def update_ike_policy(self,
'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:
headers.update(kwargs.get('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,
headers=headers,
@@ -10832,89 +10924,69 @@ def update_ike_policy(self,
response = self.send(request, **kwargs)
return response
-
- def list_ike_policy_connections(self,
- id: str,
- **kwargs
- ) -> DetailedResponse:
- """
- List all VPN gateway connections that use a specified IKE policy.
-
- This request lists all VPN gateway connections that use a policy.
-
- :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 id is None:
- raise ValueError('id must be provided')
- headers = {}
- sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
- service_version='V1',
- operation_id='list_ike_policy_connections')
- headers.update(sdk_headers)
-
- params = {
- 'version': self.version,
- 'generation': self.generation
- }
-
- if 'headers' in kwargs:
- headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
-
- path_param_keys = ['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
+ #########################
+ # Security groups
+ #########################
- def list_ipsec_policies(self,
+ def list_security_groups(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 IPsec policies.
+ List all security groups.
- 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-supplied token determining what
+ :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 in the resource group with the specified identifier.
+ :param str vpc_id: (optional) Filters the collection to resources in the
+ VPC with the specified identifier.
+ :param str vpc_crn: (optional) Filters the collection to resources in the
+ VPC with the specified CRN.
+ :param str vpc_name: (optional) Filters the collection to resources in the
+ VPC with the exact specified name.
:param dict headers: 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)
params = {
'version': self.version,
'generation': self.generation,
'start': start,
- 'limit': limit
+ 'limit': limit,
+ 'resource_group.id': resource_group_id,
+ 'vpc.id': vpc_id,
+ 'vpc.crn': vpc_crn,
+ 'vpc.name': vpc_name
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/ipsec_policies'
+ url = '/security_groups'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -10924,47 +10996,51 @@ def list_ipsec_policies(self,
return response
- def create_ipsec_policy(self,
- authentication_algorithm: str,
- encryption_algorithm: str,
- pfs: str,
+ def create_security_group(self,
+ 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
+ network interfaces on instances in that VPC can be added to the security group.
- :param str authentication_algorithm: The authentication algorithm.
- :param str encryption_algorithm: The encryption algorithm.
- :param str pfs: Perfect Forward Secrecy.
- :param int key_lifetime: (optional) The key lifetime in seconds.
- :param str name: (optional) The user-defined name for this IPsec policy.
+ :param VPCIdentity vpc: The VPC this security group is to be a part of.
+ :param str name: (optional) The user-defined name for this security group.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words. Names must be unique within the VPC the security group resides in.
:param 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)
params = {
@@ -10973,12 +11049,10 @@ def create_ipsec_policy(self,
}
data = {
- 'authentication_algorithm': authentication_algorithm,
- 'encryption_algorithm': encryption_algorithm,
- 'pfs': pfs,
- 'key_lifetime': key_lifetime,
+ 'vpc': vpc,
'name': name,
- 'resource_group': resource_group
+ 'resource_group': resource_group,
+ 'rules': rules
}
data = {k: v for (k, v) in data.items() if v is not None}
data = json.dumps(data)
@@ -10988,7 +11062,7 @@ def create_ipsec_policy(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/ipsec_policies'
+ url = '/security_groups'
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -10999,18 +11073,19 @@ def create_ipsec_policy(self,
return response
- def delete_ipsec_policy(self,
+ 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 network interfaces or other security group 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
@@ -11021,7 +11096,7 @@ def delete_ipsec_policy(self,
headers = {}
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)
params = {
@@ -11035,7 +11110,7 @@ def delete_ipsec_policy(self,
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,
headers=headers,
@@ -11045,20 +11120,20 @@ def delete_ipsec_policy(self,
return response
- def get_ipsec_policy(self,
+ 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 id is None:
@@ -11066,7 +11141,7 @@ def get_ipsec_policy(self,
headers = {}
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)
params = {
@@ -11081,7 +11156,7 @@ def get_ipsec_policy(self,
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,
headers=headers,
@@ -11091,33 +11166,35 @@ def get_ipsec_policy(self,
return response
- def update_ipsec_policy(self,
+ 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 id is None:
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)
params = {
@@ -11125,7 +11202,7 @@ def update_ipsec_policy(self,
'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:
@@ -11135,7 +11212,7 @@ def update_ipsec_policy(self,
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,
headers=headers,
@@ -11146,42 +11223,51 @@ def update_ipsec_policy(self,
return response
- def list_ipsec_policy_connections(self,
- id: str,
+ def list_security_group_network_interfaces(self,
+ security_group_id: str,
+ *,
+ start: str = None,
+ limit: int = None,
**kwargs
) -> DetailedResponse:
"""
- List all VPN gateway connections that use a specified IPsec policy.
+ List all network interfaces associated with a security group.
- This request lists all VPN gateway connections that use a policy.
+ This request lists all network interfaces associated with a security group, to
+ which the rules in the security group are applied.
- :param str id: The IPsec policy identifier.
+ :param str security_group_id: The security group identifier.
+ :param str start: (optional) A server-provided token determining what
+ resource to start the page on.
+ :param int limit: (optional) The number of resources to return on a page.
:param dict headers: 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 `NetworkInterfaceCollection` object
"""
- if id is None:
- raise ValueError('id must be provided')
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_ipsec_policy_connections')
+ operation_id='list_security_group_network_interfaces')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit
}
if 'headers' in kwargs:
headers.update(kwargs.get('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)
+ url = '/security_groups/{security_group_id}/network_interfaces'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -11191,52 +11277,50 @@ def list_ipsec_policy_connections(self,
return response
- def list_vpn_gateways(self,
- *,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
- mode: str = None,
+ def remove_security_group_network_interface(self,
+ security_group_id: str,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- List all VPN gateways.
+ Remove a network interface from a security group.
- This request lists all VPN gateways in the region.
+ This request removes a network interface from a security group. Security groups
+ are stateful, so any changes to a network interface's security groups are applied
+ to new connections. Existing connections are not affected. If the network
+ interface being removed has no other security groups, it will be attached to the
+ VPC's default security group.
- :param str start: (optional) A server-supplied 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 in the resource group with the specified identifier.
- :param str mode: (optional) Filters the collection to VPN gateways with the
- specified mode.
+ :param str security_group_id: The security group identifier.
+ :param str id: The network interface identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `VPNGatewayCollection` object
+ :rtype: DetailedResponse
"""
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_gateways')
+ operation_id='remove_security_group_network_interface')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation,
- 'start': start,
- 'limit': limit,
- 'resource_group.id': resource_group_id,
- 'mode': mode
+ 'generation': self.generation
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
- url = '/vpn_gateways'
- request = self.prepare_request(method='GET',
+ path_param_keys = ['security_group_id', 'id']
+ path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/security_groups/{security_group_id}/network_interfaces/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -11245,30 +11329,33 @@ def list_vpn_gateways(self,
return response
- def create_vpn_gateway(self,
- vpn_gateway_prototype: 'VPNGatewayPrototype',
+ def get_security_group_network_interface(self,
+ security_group_id: str,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- Create a VPN gateway.
+ Retrieve a network interface in a security group.
- This request creates a new VPN gateway.
+ This request retrieves a single network interface specified by the identifier in
+ the URL path. The network interface must be an existing member of the security
+ group.
- :param VPNGatewayPrototype vpn_gateway_prototype: The VPN gateway prototype
- object.
+ :param str security_group_id: The security group identifier.
+ :param str id: The network interface identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `NetworkInterface` 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 security_group_id is None:
+ raise ValueError('security_group_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_vpn_gateway')
+ operation_id='get_security_group_network_interface')
headers.update(sdk_headers)
params = {
@@ -11276,48 +11363,51 @@ def create_vpn_gateway(self,
'generation': self.generation
}
- data = json.dumps(vpn_gateway_prototype)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/vpn_gateways'
- request = self.prepare_request(method='POST',
+ path_param_keys = ['security_group_id', 'id']
+ path_param_values = self.encode_path_vars(security_group_id, id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/security_groups/{security_group_id}/network_interfaces/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def delete_vpn_gateway(self,
+ def add_security_group_network_interface(self,
+ security_group_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a VPN gateway.
+ Add a network interface to a security group.
- 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 adds an existing network interface to an existing security group.
+ When a network interface is added to a security group, the security group rules
+ are applied to the network interface. A request body is not required, and if
+ provided, is ignored.
- :param str id: The VPN gateway identifier.
+ :param str security_group_id: The security group identifier.
+ :param str id: The network interface identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse
+ :rtype: DetailedResponse with `dict` result representing a `NetworkInterface` object
"""
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_vpn_gateway')
+ operation_id='add_security_group_network_interface')
headers.update(sdk_headers)
params = {
@@ -11327,12 +11417,13 @@ def delete_vpn_gateway(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='DELETE',
+ url = '/security_groups/{security_group_id}/network_interfaces/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PUT',
url=url,
headers=headers,
params=params)
@@ -11341,28 +11432,29 @@ def delete_vpn_gateway(self,
return response
- def get_vpn_gateway(self,
- id: str,
+ def list_security_group_rules(self,
+ security_group_id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a VPN gateway.
+ List all rules in a security group.
- This request retrieves a single VPN gateway specified by the identifier in the
- URL.
+ 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 VPN gateway 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 `VPNGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRuleCollection` object
"""
- if id is None:
- raise ValueError('id must be provided')
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_vpn_gateway')
+ operation_id='list_security_group_rules')
headers.update(sdk_headers)
params = {
@@ -11374,10 +11466,10 @@ def get_vpn_gateway(self,
headers.update(kwargs.get('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 = '/vpn_gateways/{id}'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -11387,33 +11479,42 @@ def get_vpn_gateway(self,
return response
- def update_vpn_gateway(self,
- id: str,
- vpn_gateway_patch: 'VPNGatewayPatch',
+ def create_security_group_rule(self,
+ security_group_id: str,
+ security_group_rule_prototype: 'SecurityGroupRulePrototype',
**kwargs
) -> DetailedResponse:
"""
- Update a VPN gateway.
+ Create a rule for a security group.
- This request updates the properties of an existing 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 should allow. Security group rules are stateful, such
+ that reverse traffic in response to allowed traffic is automatically permitted. A
+ rule allowing inbound TCP traffic on port 80 also allows outbound TCP traffic on
+ port 80 without the need for an additional rule.
- :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 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 id is None:
- 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_id is None:
+ 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='update_vpn_gateway')
+ operation_id='create_security_group_rule')
headers.update(sdk_headers)
params = {
@@ -11421,18 +11522,18 @@ def update_vpn_gateway(self,
'generation': self.generation
}
- data = json.dumps(vpn_gateway_patch)
- headers['content-type'] = 'application/merge-patch+json'
+ data = json.dumps(security_group_rule_prototype)
+ headers['content-type'] = 'application/json'
if 'headers' in kwargs:
headers.update(kwargs.get('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 = '/vpn_gateways/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='PATCH',
+ url = '/security_groups/{security_group_id}/rules'.format(**path_param_dict)
+ request = self.prepare_request(method='POST',
url=url,
headers=headers,
params=params,
@@ -11442,48 +11543,48 @@ def update_vpn_gateway(self,
return response
- def list_vpn_gateway_connections(self,
- vpn_gateway_id: str,
- *,
- status: str = None,
+ def delete_security_group_rule(self,
+ security_group_id: str,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- List all connections of a VPN gateway.
+ Delete a security group rule.
- This request lists all connections of a VPN gateway.
+ 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 vpn_gateway_id: The VPN gateway identifier.
- :param str status: (optional) Filters the collection to VPN gateway
- connections with the specified status.
+ :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 `VPNGatewayConnectionCollection` object
+ :rtype: DetailedResponse
"""
- if vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_gateway_connections')
+ operation_id='delete_security_group_rule')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation,
- 'status': status
+ 'generation': self.generation
}
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='GET',
+ url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -11492,34 +11593,32 @@ def list_vpn_gateway_connections(self,
return response
- def create_vpn_gateway_connection(self,
- vpn_gateway_id: str,
- vpn_gateway_connection_prototype: 'VPNGatewayConnectionPrototype',
+ def get_security_group_rule(self,
+ security_group_id: str,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- Create a connection for a VPN gateway.
+ Retrieve a security group rule.
- This request creates a new VPN gateway connection.
+ This request retrieves a single security group rule specified by the identifier in
+ the URL path.
- :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 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 `VPNGatewayConnection` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object
"""
- if vpn_gateway_id is None:
- 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 security_group_id is None:
+ raise ValueError('security_group_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_vpn_gateway_connection')
+ operation_id='get_security_group_rule')
headers.update(sdk_headers)
params = {
@@ -11527,54 +11626,57 @@ def create_vpn_gateway_connection(self,
'generation': self.generation
}
- data = json.dumps(vpn_gateway_connection_prototype)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='POST',
+ url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def delete_vpn_gateway_connection(self,
- vpn_gateway_id: str,
+ def update_security_group_rule(self,
+ security_group_id: str,
id: str,
+ security_group_rule_patch: 'SecurityGroupRulePatch',
**kwargs
) -> DetailedResponse:
"""
- Delete a VPN gateway connection.
+ Update a security group rule.
- 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 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 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 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
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupRule` object
"""
- if vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
if id is None:
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)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_vpn_gateway_connection')
+ operation_id='update_security_group_rule')
headers.update(sdk_headers)
params = {
@@ -11582,63 +11684,72 @@ def delete_vpn_gateway_connection(self,
'generation': self.generation
}
+ data = json.dumps(security_group_rule_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='DELETE',
+ url = '/security_groups/{security_group_id}/rules/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def get_vpn_gateway_connection(self,
- vpn_gateway_id: str,
- id: str,
+ def list_security_group_targets(self,
+ security_group_id: str,
+ *,
+ start: str = None,
+ limit: int = None,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a VPN gateway connection.
+ List all targets associated with a security group.
- This request retrieves a single VPN gateway connection specified by the identifier
- in the URL.
+ 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 id: The VPN gateway connection identifier.
+ :param str security_group_id: The security group identifier.
+ :param str start: (optional) A server-provided token determining what
+ resource to start the page on.
+ :param int limit: (optional) The number of resources to return on a page.
:param dict headers: 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 `SecurityGroupTargetCollection` object
"""
- if vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
- if id is None:
- raise ValueError('id must be provided')
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_vpn_gateway_connection')
+ operation_id='list_security_group_targets')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit
}
if 'headers' in kwargs:
headers.update(kwargs.get('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']
+ 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/{id}'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/targets'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -11648,38 +11759,38 @@ def get_vpn_gateway_connection(self,
return response
- def update_vpn_gateway_connection(self,
- vpn_gateway_id: str,
+ def delete_security_group_target_binding(self,
+ security_group_id: str,
id: str,
- vpn_gateway_connection_patch: 'VPNGatewayConnectionPatch',
**kwargs
) -> DetailedResponse:
"""
- Update a VPN gateway connection.
+ Remove a target from a security group.
- This request updates the properties of an existing 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 network interface identifier
+ - An application load balancer identifier
+ - An endpoint gateway 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 str id: The VPN gateway connection identifier.
- :param VPNGatewayConnectionPatch vpn_gateway_connection_patch: The VPN
- gateway connection patch.
+ :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 vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
if id is None:
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='delete_security_group_target_binding')
headers.update(sdk_headers)
params = {
@@ -11687,52 +11798,48 @@ def update_vpn_gateway_connection(self,
'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'))
- 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)
- request = self.prepare_request(method='PATCH',
+ url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def list_vpn_gateway_connection_local_cidrs(self,
- vpn_gateway_id: str,
+ def get_security_group_target(self,
+ security_group_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- List all local CIDRs for a VPN gateway connection.
+ Retrieve a security group target.
- This request lists all local CIDRs for a VPN gateway connection.
+ 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 with `dict` result representing a `VPNGatewayConnectionLocalCIDRs` object
+ :rtype: DetailedResponse with `dict` result representing a `SecurityGroupTargetReference` object
"""
- if vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_gateway_connection_local_cidrs')
+ operation_id='get_security_group_target')
headers.update(sdk_headers)
params = {
@@ -11744,10 +11851,10 @@ def list_vpn_gateway_connection_local_cidrs(self,
headers.update(kwargs.get('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}/local_cidrs'.format(**path_param_dict)
+ url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -11757,39 +11864,37 @@ def list_vpn_gateway_connection_local_cidrs(self,
return response
- def remove_vpn_gateway_connection_local_cidr(self,
- vpn_gateway_id: str,
+ def create_security_group_target_binding(self,
+ security_group_id: str,
id: str,
- cidr_prefix: str,
- prefix_length: str,
**kwargs
) -> DetailedResponse:
"""
- Remove a local CIDR from a VPN gateway connection.
+ Add a target to a security group.
- This request removes a CIDR from a VPN gateway connection.
+ This request adds a resource to an existing security group. The specified target
+ identifier can be:
+ - A network interface identifier
+ - An application load balancer identifier
+ - An endpoint gateway 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 cidr_prefix: The address prefix part of the CIDR.
- :param str prefix_length: The prefix length part of the CIDR.
+ :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 vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
+ if security_group_id is None:
+ raise ValueError('security_group_id must be provided')
if id is None:
raise ValueError('id must be provided')
- if cidr_prefix is None:
- raise ValueError('cidr_prefix must be provided')
- if prefix_length is None:
- 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='create_security_group_target_binding')
headers.update(sdk_headers)
params = {
@@ -11799,12 +11904,13 @@ def remove_vpn_gateway_connection_local_cidr(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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 = ['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}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ url = '/security_groups/{security_group_id}/targets/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PUT',
url=url,
headers=headers,
params=params)
@@ -11812,55 +11918,48 @@ def remove_vpn_gateway_connection_local_cidr(self,
response = self.send(request, **kwargs)
return response
+ #########################
+ # VPN gateways
+ #########################
+
- def check_vpn_gateway_connection_local_cidr(self,
- vpn_gateway_id: str,
- id: str,
- cidr_prefix: str,
- prefix_length: str,
+ def list_ike_policies(self,
+ *,
+ start: str = None,
+ limit: int = None,
**kwargs
) -> DetailedResponse:
"""
- Check if the specified local CIDR exists on a VPN gateway connection.
+ List all IKE policies.
- This request succeeds if a CIDR exists on the specified VPN gateway connection and
- fails otherwise.
+ 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 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 `IKEPolicyCollection` object
"""
- if vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
- if id is None:
- raise ValueError('id must be provided')
- if cidr_prefix is None:
- raise ValueError('cidr_prefix must be provided')
- if prefix_length is None:
- 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='list_ike_policies')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit
}
if 'headers' in kwargs:
headers.update(kwargs.get('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}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ url = '/ike_policies'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -11870,41 +11969,51 @@ def check_vpn_gateway_connection_local_cidr(self,
return response
- def add_vpn_gateway_connection_local_cidr(self,
- vpn_gateway_id: str,
- id: str,
- cidr_prefix: str,
- prefix_length: str,
+ def create_ike_policy(self,
+ 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:
"""
- Set a local CIDR on a VPN gateway connection.
+ Create an IKE policy.
- This request adds the specified CIDR to the specified VPN gateway connection. A
- request body is not required, and if supplied, is ignored. This request succeeds
- if the CIDR already exists on the specified VPN gateway connection.
+ This request creates a new IKE policy.
- :param str vpn_gateway_id: The VPN gateway identifier.
- :param str id: The VPN gateway connection identifier.
- :param str cidr_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.
+ :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 user-defined name for this IKE policy.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) 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 `IKEPolicy` object
"""
- if vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
- if id is None:
- raise ValueError('id must be provided')
- if cidr_prefix is None:
- raise ValueError('cidr_prefix must be provided')
- if prefix_length is None:
- raise ValueError('prefix_length 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='add_vpn_gateway_connection_local_cidr')
+ operation_id='create_ike_policy')
headers.update(sdk_headers)
params = {
@@ -11912,47 +12021,57 @@ def add_vpn_gateway_connection_local_cidr(self,
'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'))
+ 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}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
- request = self.prepare_request(method='PUT',
+ url = '/ike_policies'
+ request = self.prepare_request(method='POST',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def list_vpn_gateway_connection_peer_cidrs(self,
- vpn_gateway_id: str,
+ def delete_ike_policy(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- List all peer CIDRs for a VPN gateway connection.
+ Delete an IKE policy.
- This request lists all peer CIDRs for a VPN gateway connection.
+ 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 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
"""
- if vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_vpn_gateway_connection_peer_cidrs')
+ operation_id='delete_ike_policy')
headers.update(sdk_headers)
params = {
@@ -11962,13 +12081,12 @@ def list_vpn_gateway_connection_peer_cidrs(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='GET',
+ url = '/ike_policies/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -11977,39 +12095,27 @@ def list_vpn_gateway_connection_peer_cidrs(self,
return response
- def remove_vpn_gateway_connection_peer_cidr(self,
- vpn_gateway_id: str,
+ def get_ike_policy(self,
id: str,
- cidr_prefix: str,
- prefix_length: str,
**kwargs
) -> DetailedResponse:
"""
- Remove a peer CIDR from a VPN gateway connection.
+ Retrieve an IKE policy.
- This request removes a CIDR from a VPN gateway connection.
+ 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 vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
if id is None:
raise ValueError('id must be provided')
- if cidr_prefix is None:
- raise ValueError('cidr_prefix must be provided')
- if prefix_length is None:
- 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='get_ike_policy')
headers.update(sdk_headers)
params = {
@@ -12019,12 +12125,13 @@ def remove_vpn_gateway_connection_peer_cidr(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ url = '/ike_policies/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
params=params)
@@ -12033,40 +12140,33 @@ def remove_vpn_gateway_connection_peer_cidr(self,
return response
- def check_vpn_gateway_connection_peer_cidr(self,
- vpn_gateway_id: str,
+ def update_ike_policy(self,
id: str,
- cidr_prefix: str,
- prefix_length: str,
+ ike_policy_patch: 'IKEPolicyPatch',
**kwargs
) -> DetailedResponse:
"""
- Check if the specified peer CIDR exists on a VPN gateway connection.
+ Update an IKE policy.
- This request succeeds if a CIDR exists on the specified VPN gateway connection and
- fails otherwise.
+ 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 vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
if id is None:
raise ValueError('id must be provided')
- if cidr_prefix is None:
- raise ValueError('cidr_prefix must be provided')
- if prefix_length is None:
- 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='check_vpn_gateway_connection_peer_cidr')
+ operation_id='update_ike_policy')
headers.update(sdk_headers)
params = {
@@ -12074,57 +12174,48 @@ def check_vpn_gateway_connection_peer_cidr(self,
'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'))
+ 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}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
- request = self.prepare_request(method='GET',
+ url = '/ike_policies/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def add_vpn_gateway_connection_peer_cidr(self,
- vpn_gateway_id: str,
+ def list_ike_policy_connections(self,
id: str,
- cidr_prefix: str,
- prefix_length: str,
**kwargs
) -> DetailedResponse:
"""
- Set a peer CIDR on a VPN gateway connection.
+ List all VPN gateway connections that use a specified IKE policy.
- This request adds the specified CIDR to the specified VPN gateway connection. A
- request body is not required, and if supplied, is ignored. This request succeeds
- if the CIDR already exists on the specified VPN gateway connection.
+ 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 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 `VPNGatewayConnectionCollection` object
"""
- if vpn_gateway_id is None:
- raise ValueError('vpn_gateway_id must be provided')
if id is None:
raise ValueError('id must be provided')
- if cidr_prefix is None:
- raise ValueError('cidr_prefix must be provided')
- if prefix_length is None:
- 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='list_ike_policy_connections')
headers.update(sdk_headers)
params = {
@@ -12134,108 +12225,12 @@ def add_vpn_gateway_connection_peer_cidr(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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)
- request = self.prepare_request(method='PUT',
- url=url,
- headers=headers,
- params=params)
-
- response = self.send(request, **kwargs)
- return response
-
- #########################
- # Load balancers
- #########################
-
-
- def list_load_balancer_profiles(self,
- *,
- start: str = None,
- limit: int = None,
- **kwargs
- ) -> DetailedResponse:
- """
- List all load balancer profiles.
-
- 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 start: (optional) A server-supplied 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 `LoadBalancerProfileCollection` object
- """
-
- headers = {}
- sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
- service_version='V1',
- 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:
- headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
-
- url = '/load_balancer/profiles'
- request = self.prepare_request(method='GET',
- url=url,
- headers=headers,
- params=params)
-
- response = self.send(request, **kwargs)
- return response
-
-
- def get_load_balancer_profile(self,
- name: str,
- **kwargs
- ) -> DetailedResponse:
- """
- Retrieve a load balancer profile.
-
- This request retrieves a load balancer profile specified by the name in the URL.
-
- :param str name: The load balancer profile name.
- :param dict headers: A `dict` containing the request headers
- :return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfile` object
- """
-
- if name is None:
- raise ValueError('name must be provided')
- headers = {}
- sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
- service_version='V1',
- operation_id='get_load_balancer_profile')
- headers.update(sdk_headers)
-
- params = {
- 'version': self.version,
- 'generation': self.generation
- }
-
- if 'headers' in kwargs:
- headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
-
- path_param_keys = ['name']
- path_param_values = self.encode_path_vars(name)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancer/profiles/{name}'.format(**path_param_dict)
+ url = '/ike_policies/{id}/connections'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -12245,29 +12240,29 @@ def get_load_balancer_profile(self,
return response
- def list_load_balancers(self,
+ def list_ipsec_policies(self,
*,
start: str = None,
limit: int = None,
**kwargs
) -> DetailedResponse:
"""
- List all load balancers.
+ List all IPsec policies.
- This request lists all load balancers in the region.
+ This request lists all IPsec policies in the region.
- :param str start: (optional) A server-supplied token determining what
+ :param str start: (optional) A server-provided token determining what
resource to start the page on.
:param int limit: (optional) The number of resources to return on a page.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `IPsecPolicyCollection` object
"""
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancers')
+ operation_id='list_ipsec_policies')
headers.update(sdk_headers)
params = {
@@ -12281,7 +12276,7 @@ def list_load_balancers(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/load_balancers'
+ url = '/ipsec_policies'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -12291,83 +12286,47 @@ def list_load_balancers(self,
return response
- def create_load_balancer(self,
- is_public: bool,
- subnets: List['SubnetIdentity'],
+ def create_ipsec_policy(self,
+ authentication_algorithm: str,
+ encryption_algorithm: str,
+ pfs: str,
*,
- listeners: List['LoadBalancerListenerPrototypeLoadBalancerContext'] = None,
- logging: 'LoadBalancerLogging' = None,
+ key_lifetime: int = 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.
+ Create an IPsec policy.
- This request creates and provisions a new load balancer.
+ This request creates a new IPsec policy.
- :param bool is_public: Indicates whether this load balancer is public or
- private.
- At present, if route mode is enabled, the load balancer must be private.
- :param List[SubnetIdentity] subnets: The subnets to provision this load
- balancer.
- :param List[LoadBalancerListenerPrototypeLoadBalancerContext] listeners:
- (optional) The listeners of this load balancer.
- :param LoadBalancerLogging logging: (optional) The logging configuration to
- use for this load balancer. See [VPC Datapath
- Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging)
- on the logging format, fields and permitted values.
- To activate logging, the load balancer profile must support the specified
- logging
- type.
- :param str name: (optional) The user-defined name for this load balancer.
- If unspecified, the name will be a hyphenated list of randomly-selected
- words.
- :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this
- load balancer.
- :param LoadBalancerProfileIdentity profile: (optional) The profile to use
- for this load balancer.
+ :param str authentication_algorithm: The authentication algorithm.
+ :param str encryption_algorithm: The encryption algorithm.
+ :param str pfs: Perfect Forward Secrecy.
+ :param int key_lifetime: (optional) The key lifetime in seconds.
+ :param str name: (optional) The user-defined name for this IPsec policy.
:param ResourceGroupIdentity resource_group: (optional) The resource group
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.
- 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 `LoadBalancer` object
+ :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object
"""
- 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 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 authentication_algorithm is None:
+ raise ValueError('authentication_algorithm must be provided')
+ if encryption_algorithm is None:
+ raise ValueError('encryption_algorithm must be provided')
+ if pfs is None:
+ raise ValueError('pfs must be provided')
if resource_group is not None:
resource_group = convert_model(resource_group)
- if security_groups is not None:
- security_groups = [convert_model(x) for x in security_groups]
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_load_balancer')
+ operation_id='create_ipsec_policy')
headers.update(sdk_headers)
params = {
@@ -12376,16 +12335,12 @@ def create_load_balancer(self,
}
data = {
- 'is_public': is_public,
- 'subnets': subnets,
- 'listeners': listeners,
- 'logging': logging,
+ 'authentication_algorithm': authentication_algorithm,
+ 'encryption_algorithm': encryption_algorithm,
+ 'pfs': pfs,
+ 'key_lifetime': key_lifetime,
'name': name,
- 'pools': pools,
- 'profile': profile,
- 'resource_group': resource_group,
- 'route_mode': route_mode,
- 'security_groups': security_groups
+ 'resource_group': resource_group
}
data = {k: v for (k, v) in data.items() if v is not None}
data = json.dumps(data)
@@ -12395,7 +12350,7 @@ def create_load_balancer(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/load_balancers'
+ url = '/ipsec_policies'
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -12406,16 +12361,18 @@ def create_load_balancer(self,
return response
- def delete_load_balancer(self,
+ def delete_ipsec_policy(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a load balancer.
+ Delete an IPsec policy.
- This request deletes a load balancer. This operation cannot be reversed.
+ This request deletes an IPsec policy. This operation cannot be reversed. For this
+ request to succeed, there must not be any VPN gateway connections using this
+ policy.
- :param str id: The load balancer identifier.
+ :param str id: The IPsec policy identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
@@ -12426,7 +12383,7 @@ def delete_load_balancer(self,
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer')
+ operation_id='delete_ipsec_policy')
headers.update(sdk_headers)
params = {
@@ -12440,7 +12397,7 @@ def delete_load_balancer(self,
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 = '/ipsec_policies/{id}'.format(**path_param_dict)
request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
@@ -12450,20 +12407,20 @@ def delete_load_balancer(self,
return response
- def get_load_balancer(self,
+ def get_ipsec_policy(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a load balancer.
+ Retrieve an IPsec policy.
- This request retrieves a single load balancer specified by the identifier in the
- URL path.
+ This request retrieves a single IPsec policy specified by the identifier in the
+ URL.
- :param str id: The load balancer identifier.
+ :param str id: The IPsec policy identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object
+ :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object
"""
if id is None:
@@ -12471,7 +12428,7 @@ def get_load_balancer(self,
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer')
+ operation_id='get_ipsec_policy')
headers.update(sdk_headers)
params = {
@@ -12486,7 +12443,7 @@ def get_load_balancer(self,
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 = '/ipsec_policies/{id}'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -12496,33 +12453,33 @@ def get_load_balancer(self,
return response
- def update_load_balancer(self,
+ def update_ipsec_policy(self,
id: str,
- load_balancer_patch: 'LoadBalancerPatch',
+ i_psec_policy_patch: 'IPsecPolicyPatch',
**kwargs
) -> DetailedResponse:
"""
- Update a load balancer.
+ Update an IPsec policy.
- This request updates a load balancer.
+ This request updates the properties of an existing IPsec policy.
- :param str id: The load balancer identifier.
- :param LoadBalancerPatch load_balancer_patch: The load balancer patch.
+ :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 `LoadBalancer` object
+ :rtype: DetailedResponse with `dict` result representing a `IPsecPolicy` object
"""
if id is None:
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)
+ if i_psec_policy_patch is None:
+ raise ValueError('i_psec_policy_patch must be provided')
+ if isinstance(i_psec_policy_patch, IPsecPolicyPatch):
+ i_psec_policy_patch = convert_model(i_psec_policy_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_load_balancer')
+ operation_id='update_ipsec_policy')
headers.update(sdk_headers)
params = {
@@ -12530,7 +12487,7 @@ def update_load_balancer(self,
'generation': self.generation
}
- data = json.dumps(load_balancer_patch)
+ data = json.dumps(i_psec_policy_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
@@ -12540,7 +12497,7 @@ def update_load_balancer(self,
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 = '/ipsec_policies/{id}'.format(**path_param_dict)
request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
@@ -12551,19 +12508,19 @@ def update_load_balancer(self,
return response
- def get_load_balancer_statistics(self,
+ def list_ipsec_policy_connections(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- List all statistics of a load balancer.
+ List all VPN gateway connections that use a specified IPsec policy.
- This request lists statistics of a load balancer.
+ This request lists all VPN gateway connections that use a policy.
- :param str id: The load balancer identifier.
+ :param str id: The IPsec policy identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerStatistics` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object
"""
if id is None:
@@ -12571,7 +12528,7 @@ def get_load_balancer_statistics(self,
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_statistics')
+ operation_id='list_ipsec_policy_connections')
headers.update(sdk_headers)
params = {
@@ -12586,7 +12543,7 @@ def get_load_balancer_statistics(self,
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 = '/ipsec_policies/{id}/connections'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -12596,42 +12553,51 @@ def get_load_balancer_statistics(self,
return response
- def list_load_balancer_listeners(self,
- load_balancer_id: str,
+ def list_vpn_gateways(self,
+ *,
+ start: str = None,
+ limit: int = None,
+ resource_group_id: str = None,
+ mode: str = None,
**kwargs
) -> DetailedResponse:
"""
- List all listeners for a load balancer.
+ List all VPN gateways.
- This request lists all listeners for a load balancer.
+ This request lists all VPN gateways 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 str resource_group_id: (optional) Filters the collection to
+ resources in the resource group with the specified identifier.
+ :param str mode: (optional) Filters the collection to VPN gateways with the
+ specified mode.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayCollection` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancer_listeners')
+ operation_id='list_vpn_gateways')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit,
+ 'resource_group.id': resource_group_id,
+ 'mode': mode
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id']
- path_param_values = self.encode_path_vars(load_balancer_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict)
+ url = '/vpn_gateways'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -12641,102 +12607,30 @@ def list_load_balancer_listeners(self,
return response
- def create_load_balancer_listener(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,
- policies: List['LoadBalancerListenerPolicyPrototype'] = None,
- port: int = None,
- port_max: int = None,
- port_min: int = None,
+ def create_vpn_gateway(self,
+ vpn_gateway_prototype: 'VPNGatewayPrototype',
**kwargs
) -> DetailedResponse:
"""
- Create a listener for a load balancer.
+ Create a VPN gateway.
- This request creates a new listener for a load balancer.
+ This request creates a new VPN gateway.
- :param str load_balancer_id: The load balancer identifier.
- :param str protocol: The listener protocol. Each listener in the load
- balancer must have a unique `port` and `protocol` combination. Additional
- restrictions:
- - If this load balancer is in the `network` family, the protocol must be
- `tcp`.
- - If this listener has `https_redirect` specified, the protocol must be
- `http`.
- - If this listener is a listener's `https_redirect` target, the protocol
- must be `https`.
- :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 used for SSL termination. It is applicable only to
- `https`
- protocol.
- :param int connection_limit: (optional) The connection limit of the
- listener.
- :param LoadBalancerPoolIdentity default_pool: (optional) The default pool
- associated with the listener. The specified pool must:
- - Belong to this load balancer
- - Have the same `protocol` as this listener
- - Not already be the default pool for another listener.
- :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect:
- (optional) The target listener that requests will be redirected to. This
- listener must have a
- `protocol` of `http`, and the target listener must have a `protocol` of
- `https`.
- :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The
- policy prototype objects for this listener.
- :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 support
- different values for `port_min` and `port_max`. When route mode is
- enabled, only a value of
- `65535` is supported for `port_max`.
- :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 support
- different values for `port_min` and `port_max`. When route mode is
- enabled, only a value of
- `1` is supported for `port_min`.
+ :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 `LoadBalancerListener` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object
"""
- if load_balancer_id is None:
- 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 vpn_gateway_prototype is None:
+ raise ValueError('vpn_gateway_prototype must be provided')
+ if isinstance(vpn_gateway_prototype, VPNGatewayPrototype):
+ vpn_gateway_prototype = convert_model(vpn_gateway_prototype)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_load_balancer_listener')
+ operation_id='create_vpn_gateway')
headers.update(sdk_headers)
params = {
@@ -12744,30 +12638,14 @@ def create_load_balancer_listener(self,
'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,
- '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)
+ data = json.dumps(vpn_gateway_prototype)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id']
- path_param_values = self.encode_path_vars(load_balancer_id)
- path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict)
+ url = '/vpn_gateways'
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -12778,33 +12656,30 @@ def create_load_balancer_listener(self,
return response
- def delete_load_balancer_listener(self,
- load_balancer_id: str,
+ def delete_vpn_gateway(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a load balancer listener.
+ Delete a VPN gateway.
- This request deletes a load balancer listener. This operation cannot be reversed.
- For this operation to succeed, the listener must not be the target of another load
- balancer listener.
+ This request deletes a VPN 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 load_balancer_id: The load balancer identifier.
- :param str id: The listener identifier.
+ :param str id: The VPN gateway identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer_listener')
+ operation_id='delete_vpn_gateway')
headers.update(sdk_headers)
params = {
@@ -12815,10 +12690,10 @@ def delete_load_balancer_listener(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- path_param_keys = ['load_balancer_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, id)
+ path_param_keys = ['id']
+ path_param_values = self.encode_path_vars(id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
+ url = '/vpn_gateways/{id}'.format(**path_param_dict)
request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
@@ -12828,32 +12703,28 @@ def delete_load_balancer_listener(self,
return response
- def get_load_balancer_listener(self,
- load_balancer_id: str,
+ def get_vpn_gateway(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a load balancer listener.
+ Retrieve a VPN gateway.
- This request retrieves a single listener specified by the identifier in the URL
- path.
+ This request retrieves a single VPN gateway specified by the identifier in the
+ URL.
- :param str load_balancer_id: The load balancer identifier.
- :param str id: The listener identifier.
+ :param str id: The VPN 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 `LoadBalancerListener` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_listener')
+ operation_id='get_vpn_gateway')
headers.update(sdk_headers)
params = {
@@ -12865,10 +12736,10 @@ def get_load_balancer_listener(self,
headers.update(kwargs.get('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_gateways/{id}'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -12878,38 +12749,33 @@ def get_load_balancer_listener(self,
return response
- def update_load_balancer_listener(self,
- load_balancer_id: str,
+ def update_vpn_gateway(self,
id: str,
- load_balancer_listener_patch: 'LoadBalancerListenerPatch',
+ vpn_gateway_patch: 'VPNGatewayPatch',
**kwargs
) -> DetailedResponse:
"""
- Update a load balancer listener.
+ Update a VPN gateway.
- This request updates a load balancer listener from a listener patch.
+ This request updates the properties of an existing VPN gateway.
- :param str load_balancer_id: The load balancer identifier.
- :param str id: The listener identifier.
- :param LoadBalancerListenerPatch load_balancer_listener_patch: The load
- balancer listener patch.
+ :param str id: The VPN 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 with `dict` result representing a `LoadBalancerListener` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGateway` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
if id is None:
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 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='update_load_balancer_listener')
+ operation_id='update_vpn_gateway')
headers.update(sdk_headers)
params = {
@@ -12917,17 +12783,17 @@ def update_load_balancer_listener(self,
'generation': self.generation
}
- data = json.dumps(load_balancer_listener_patch)
+ data = json.dumps(vpn_gateway_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
headers.update(kwargs.get('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_gateways/{id}'.format(**path_param_dict)
request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
@@ -12938,46 +12804,47 @@ def update_load_balancer_listener(self,
return response
- def list_load_balancer_listener_policies(self,
- load_balancer_id: str,
- listener_id: str,
- **kwargs
- ) -> DetailedResponse:
+ def list_vpn_gateway_connections(self,
+ vpn_gateway_id: str,
+ *,
+ status: str = None,
+ **kwargs
+ ) -> DetailedResponse:
"""
- List all policies for a load balancer listener.
+ List all connections of a VPN gateway.
- This request lists all policies for a load balancer listener.
+ This request lists all connections of a VPN gateway.
- :param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
+ :param str vpn_gateway_id: The VPN gateway identifier.
+ :param str status: (optional) Filters the collection to VPN gateway
+ connections with the specified status.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionCollection` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- raise ValueError('listener_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancer_listener_policies')
+ operation_id='list_vpn_gateway_connections')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation
+ 'generation': self.generation,
+ 'status': status
}
if 'headers' in kwargs:
headers.update(kwargs.get('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_gateway_id']
+ path_param_values = self.encode_path_vars(vpn_gateway_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_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -12987,62 +12854,34 @@ def list_load_balancer_listener_policies(self,
return response
- def create_load_balancer_listener_policy(self,
- load_balancer_id: str,
- listener_id: str,
- action: str,
- priority: int,
- *,
- name: str = None,
- rules: List['LoadBalancerListenerPolicyRulePrototype'] = None,
- target: 'LoadBalancerListenerPolicyTargetPrototype' = None,
+ def create_vpn_gateway_connection(self,
+ vpn_gateway_id: str,
+ vpn_gateway_connection_prototype: 'VPNGatewayConnectionPrototype',
**kwargs
) -> DetailedResponse:
"""
- Create a policy for a load balancer listener.
+ Create a connection for a VPN gateway.
- Creates a new policy for a load balancer listener.
+ This request creates a new VPN gateway connection.
- :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 user-defined name for this policy. Names
- must be unique within the load balancer listener the policy resides in.
- :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_gateway_id: The VPN gateway identifier.
+ :param VPNGatewayConnectionPrototype vpn_gateway_connection_prototype: The
+ VPN gateway connection prototype object.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- 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 vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
+ if vpn_gateway_connection_prototype is None:
+ raise ValueError('vpn_gateway_connection_prototype must be provided')
+ if isinstance(vpn_gateway_connection_prototype, VPNGatewayConnectionPrototype):
+ vpn_gateway_connection_prototype = convert_model(vpn_gateway_connection_prototype)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='create_load_balancer_listener_policy')
+ operation_id='create_vpn_gateway_connection')
headers.update(sdk_headers)
params = {
@@ -13050,25 +12889,17 @@ def create_load_balancer_listener_policy(self,
'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)
+ data = json.dumps(vpn_gateway_connection_prototype)
headers['content-type'] = 'application/json'
if 'headers' in kwargs:
headers.update(kwargs.get('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_gateway_id']
+ path_param_values = self.encode_path_vars(vpn_gateway_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_gateways/{vpn_gateway_id}/connections'.format(**path_param_dict)
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -13079,35 +12910,33 @@ def create_load_balancer_listener_policy(self,
return response
- def delete_load_balancer_listener_policy(self,
- load_balancer_id: str,
- listener_id: str,
+ def delete_vpn_gateway_connection(self,
+ vpn_gateway_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a load balancer listener policy.
+ Delete a VPN gateway connection.
- Deletes a policy of the load balancer listener. This operation cannot be reversed.
+ This request deletes a VPN gateway connection. This operation cannot be reversed.
+ For this request to succeed, there must not be VPC routes using this VPN
+ connection as a next hop.
- :param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str id: The policy identifier.
+ :param str vpn_gateway_id: The VPN gateway identifier.
+ :param str id: The VPN gateway connection identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- raise ValueError('listener_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer_listener_policy')
+ operation_id='delete_vpn_gateway_connection')
headers.update(sdk_headers)
params = {
@@ -13118,10 +12947,10 @@ def delete_load_balancer_listener_policy(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict)
request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
@@ -13131,35 +12960,32 @@ def delete_load_balancer_listener_policy(self,
return response
- def get_load_balancer_listener_policy(self,
- load_balancer_id: str,
- listener_id: str,
+ def get_vpn_gateway_connection(self,
+ vpn_gateway_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a load balancer listener policy.
+ Retrieve a VPN gateway connection.
- Retrieve a single policy specified by the identifier in the URL path.
+ This request retrieves a single VPN gateway connection specified by the identifier
+ in the URL.
- :param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str id: The policy identifier.
+ :param str vpn_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 `LoadBalancerListenerPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- raise ValueError('listener_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_listener_policy')
+ operation_id='get_vpn_gateway_connection')
headers.update(sdk_headers)
params = {
@@ -13171,10 +12997,10 @@ def get_load_balancer_listener_policy(self,
headers.update(kwargs.get('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_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -13184,42 +13010,38 @@ def get_load_balancer_listener_policy(self,
return response
- def update_load_balancer_listener_policy(self,
- load_balancer_id: str,
- listener_id: str,
+ def update_vpn_gateway_connection(self,
+ vpn_gateway_id: str,
id: str,
- load_balancer_listener_policy_patch: 'LoadBalancerListenerPolicyPatch',
+ vpn_gateway_connection_patch: 'VPNGatewayConnectionPatch',
**kwargs
) -> DetailedResponse:
"""
- Update a load balancer listener policy.
+ Update a VPN gateway connection.
- Updates a policy from a policy patch.
+ This request updates the properties of an existing VPN gateway connection.
- :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_gateway_id: The VPN gateway identifier.
+ :param str id: The VPN gateway connection identifier.
+ :param VPNGatewayConnectionPatch vpn_gateway_connection_patch: The VPN
+ gateway connection patch.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
- :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnection` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- raise ValueError('listener_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
if id is None:
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 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_load_balancer_listener_policy')
+ operation_id='update_vpn_gateway_connection')
headers.update(sdk_headers)
params = {
@@ -13227,17 +13049,17 @@ def update_load_balancer_listener_policy(self,
'generation': self.generation
}
- data = json.dumps(load_balancer_listener_policy_patch)
+ data = json.dumps(vpn_gateway_connection_patch)
headers['content-type'] = 'application/merge-patch+json'
if 'headers' in kwargs:
headers.update(kwargs.get('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_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict)
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}'.format(**path_param_dict)
request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
@@ -13248,35 +13070,31 @@ def update_load_balancer_listener_policy(self,
return response
- def list_load_balancer_listener_policy_rules(self,
- load_balancer_id: str,
- listener_id: str,
- policy_id: str,
+ def list_vpn_gateway_connection_local_cidrs(self,
+ vpn_gateway_id: str,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- List all rules of a load balancer listener policy.
+ List all local CIDRs for a VPN gateway connection.
- This request lists all rules of a load balancer listener policy.
+ This request lists all local CIDRs for a VPN gateway connection.
- :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_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 `LoadBalancerListenerPolicyRuleCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionLocalCIDRs` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- raise ValueError('listener_id must be provided')
- if policy_id is None:
- raise ValueError('policy_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_load_balancer_listener_policy_rules')
+ operation_id='list_vpn_gateway_connection_local_cidrs')
headers.update(sdk_headers)
params = {
@@ -13288,10 +13106,10 @@ def list_load_balancer_listener_policy_rules(self,
headers.update(kwargs.get('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_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.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,
headers=headers,
@@ -13301,60 +13119,39 @@ def list_load_balancer_listener_policy_rules(self,
return response
- def create_load_balancer_listener_policy_rule(self,
- load_balancer_id: str,
- listener_id: str,
- policy_id: str,
- condition: str,
- type: str,
- value: str,
- *,
- field: str = None,
+ def remove_vpn_gateway_connection_local_cidr(self,
+ vpn_gateway_id: str,
+ id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs
) -> DetailedResponse:
"""
- Create a rule for a load balancer listener policy.
+ Remove a local CIDR from a VPN gateway connection.
- Creates a new rule for the load balancer listener policy.
+ This request removes a CIDR from a VPN gateway connection.
- :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_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 `LoadBalancerListenerPolicyRule` object
+ :rtype: DetailedResponse
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- raise ValueError('listener_id must be provided')
- if policy_id is None:
- 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 vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ if cidr_prefix is None:
+ raise ValueError('cidr_prefix must be provided')
+ if prefix_length is None:
+ 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_listener_policy_rule')
+ operation_id='remove_vpn_gateway_connection_local_cidr')
headers.update(sdk_headers)
params = {
@@ -13362,68 +13159,56 @@ def create_load_balancer_listener_policy_rule(self,
'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'))
- 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_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/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict)
- request = self.prepare_request(method='POST',
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def delete_load_balancer_listener_policy_rule(self,
- load_balancer_id: str,
- listener_id: str,
- policy_id: str,
+ def check_vpn_gateway_connection_local_cidr(self,
+ vpn_gateway_id: str,
id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a load balancer listener policy rule.
+ Check if the specified local CIDR exists on a VPN gateway connection.
- Deletes a rule from the load balancer listener policy. This operation cannot be
- reversed.
+ This request succeeds if a CIDR exists on the specified VPN gateway connection and
+ fails otherwise.
- :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_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 load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- raise ValueError('listener_id must be provided')
- if policy_id is None:
- raise ValueError('policy_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
if id is None:
raise ValueError('id must be provided')
+ if cidr_prefix is None:
+ raise ValueError('cidr_prefix must be provided')
+ if prefix_length is None:
+ 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_listener_policy_rule')
+ operation_id='check_vpn_gateway_connection_local_cidr')
headers.update(sdk_headers)
params = {
@@ -13434,11 +13219,11 @@ def delete_load_balancer_listener_policy_rule(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id)
+ path_param_keys = ['vpn_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/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ 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,
headers=headers,
params=params)
@@ -13447,39 +13232,41 @@ def delete_load_balancer_listener_policy_rule(self,
return response
- def get_load_balancer_listener_policy_rule(self,
- load_balancer_id: str,
- listener_id: str,
- policy_id: str,
+ def add_vpn_gateway_connection_local_cidr(self,
+ vpn_gateway_id: str,
id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a load balancer listener policy rule.
+ Set a local CIDR on a VPN gateway connection.
- Retrieves a single rule specified by the identifier in the URL path.
+ This request adds the specified CIDR to the specified VPN gateway connection. A
+ request body is not required, and if provided, is ignored. This request succeeds
+ if the CIDR already exists on the specified VPN gateway connection.
- :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_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 `LoadBalancerListenerPolicyRule` object
+ :rtype: DetailedResponse
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- raise ValueError('listener_id must be provided')
- if policy_id is None:
- raise ValueError('policy_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
if id is None:
raise ValueError('id must be provided')
+ if cidr_prefix is None:
+ raise ValueError('cidr_prefix must be provided')
+ if prefix_length is None:
+ 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_listener_policy_rule')
+ operation_id='add_vpn_gateway_connection_local_cidr')
headers.update(sdk_headers)
params = {
@@ -13489,13 +13276,12 @@ def get_load_balancer_listener_policy_rule(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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_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/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='GET',
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/local_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ request = self.prepare_request(method='PUT',
url=url,
headers=headers,
params=params)
@@ -13504,46 +13290,31 @@ def get_load_balancer_listener_policy_rule(self,
return response
- def update_load_balancer_listener_policy_rule(self,
- load_balancer_id: str,
- listener_id: str,
- policy_id: str,
+ def list_vpn_gateway_connection_peer_cidrs(self,
+ vpn_gateway_id: str,
id: str,
- load_balancer_listener_policy_rule_patch: 'LoadBalancerListenerPolicyRulePatch',
**kwargs
) -> DetailedResponse:
"""
- Update a load balancer listener policy rule.
+ List all peer CIDRs for a VPN gateway connection.
- Updates a rule of the load balancer listener policy.
+ This request lists all peer CIDRs for a VPN gateway connection.
- :param str load_balancer_id: The load balancer identifier.
- :param str listener_id: The listener identifier.
- :param str policy_id: The policy identifier.
- :param str id: The rule identifier.
- :param LoadBalancerListenerPolicyRulePatch
- load_balancer_listener_policy_rule_patch: The listener policy rule patch.
+ :param str vpn_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 `LoadBalancerListenerPolicyRule` object
+ :rtype: DetailedResponse with `dict` result representing a `VPNGatewayConnectionPeerCIDRs` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if listener_id is None:
- raise ValueError('listener_id must be provided')
- if policy_id is None:
- raise ValueError('policy_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
if id is None:
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='update_load_balancer_listener_policy_rule')
+ operation_id='list_vpn_gateway_connection_peer_cidrs')
headers.update(sdk_headers)
params = {
@@ -13551,48 +13322,56 @@ def update_load_balancer_listener_policy_rule(self,
'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'))
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_gateway_id', 'id']
+ path_param_values = self.encode_path_vars(vpn_gateway_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='PATCH',
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def list_load_balancer_pools(self,
- load_balancer_id: str,
+ def remove_vpn_gateway_connection_peer_cidr(self,
+ vpn_gateway_id: str,
+ id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs
) -> DetailedResponse:
"""
- List all pools of a load balancer.
+ Remove a peer CIDR from a VPN gateway connection.
- This request lists all pools of a load balancer.
+ This request removes a CIDR from a VPN gateway connection.
- :param str load_balancer_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 `LoadBalancerPoolCollection` object
+ :rtype: DetailedResponse
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ if cidr_prefix is None:
+ raise ValueError('cidr_prefix must be provided')
+ if prefix_length is None:
+ 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_pools')
+ operation_id='remove_vpn_gateway_connection_peer_cidr')
headers.update(sdk_headers)
params = {
@@ -13602,13 +13381,12 @@ def list_load_balancer_pools(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id']
- path_param_values = self.encode_path_vars(load_balancer_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/{load_balancer_id}/pools'.format(**path_param_dict)
- request = self.prepare_request(method='GET',
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -13617,69 +13395,40 @@ def list_load_balancer_pools(self,
return response
- def create_load_balancer_pool(self,
- load_balancer_id: str,
- algorithm: str,
- health_monitor: 'LoadBalancerPoolHealthMonitorPrototype',
- protocol: str,
- *,
- members: List['LoadBalancerPoolMemberPrototype'] = None,
- name: str = None,
- proxy_protocol: str = None,
- session_persistence: 'LoadBalancerPoolSessionPersistencePrototype' = None,
+ def check_vpn_gateway_connection_peer_cidr(self,
+ vpn_gateway_id: str,
+ id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs
) -> DetailedResponse:
"""
- Create a load balancer pool.
+ Check if the specified peer CIDR exists on a VPN gateway connection.
- This request creates a new pool from a pool prototype object.
+ This request succeeds if a CIDR exists on the specified VPN gateway connection and
+ fails otherwise.
- :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`. 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 user-defined name for this load balancer
- pool. 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 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 `LoadBalancerPool` object
+ :rtype: DetailedResponse
"""
- if load_balancer_id is None:
- 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 vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ if cidr_prefix is None:
+ raise ValueError('cidr_prefix must be provided')
+ if prefix_length is None:
+ 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_pool')
+ operation_id='check_vpn_gateway_connection_peer_cidr')
headers.update(sdk_headers)
params = {
@@ -13687,63 +13436,57 @@ def create_load_balancer_pool(self,
'generation': self.generation
}
- data = {
- 'algorithm': algorithm,
- 'health_monitor': health_monitor,
- 'protocol': protocol,
- 'members': members,
- 'name': name,
- '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)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- headers['Accept'] = 'application/json'
- path_param_keys = ['load_balancer_id']
- path_param_values = self.encode_path_vars(load_balancer_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/{load_balancer_id}/pools'.format(**path_param_dict)
- request = self.prepare_request(method='POST',
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def delete_load_balancer_pool(self,
- load_balancer_id: str,
+ def add_vpn_gateway_connection_peer_cidr(self,
+ vpn_gateway_id: str,
id: str,
+ cidr_prefix: str,
+ prefix_length: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a load balancer pool.
+ Set a peer CIDR on a VPN gateway connection.
- 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 adds the specified CIDR to the specified VPN gateway connection. A
+ request body is not required, and if provided, is ignored. This request succeeds
+ if the CIDR already exists on the specified VPN gateway connection.
- :param str load_balancer_id: The load balancer identifier.
- :param str id: The pool 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
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
+ if vpn_gateway_id is None:
+ raise ValueError('vpn_gateway_id must be provided')
if id is None:
raise ValueError('id must be provided')
+ if cidr_prefix is None:
+ raise ValueError('cidr_prefix must be provided')
+ if prefix_length is None:
+ 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_pool')
+ operation_id='add_vpn_gateway_connection_peer_cidr')
headers.update(sdk_headers)
params = {
@@ -13754,11 +13497,11 @@ def delete_load_balancer_pool(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- path_param_keys = ['load_balancer_id', 'id']
- path_param_values = self.encode_path_vars(load_balancer_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 = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ url = '/vpn_gateways/{vpn_gateway_id}/connections/{id}/peer_cidrs/{cidr_prefix}/{prefix_length}'.format(**path_param_dict)
+ request = self.prepare_request(method='PUT',
url=url,
headers=headers,
params=params)
@@ -13766,47 +13509,50 @@ def delete_load_balancer_pool(self,
response = self.send(request, **kwargs)
return response
+ #########################
+ # Load balancers
+ #########################
- def get_load_balancer_pool(self,
- load_balancer_id: str,
- id: str,
+
+ def list_load_balancer_profiles(self,
+ *,
+ start: str = None,
+ limit: int = None,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a load balancer pool.
+ List all load balancer profiles.
- This request retrieves a single pool 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 id: The pool 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 `LoadBalancerPool` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfileCollection` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if id is None:
- raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_pool')
+ operation_id='list_load_balancer_profiles')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit
}
if 'headers' in kwargs:
headers.update(kwargs.get('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_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict)
+ url = '/load_balancer/profiles'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -13816,38 +13562,27 @@ def get_load_balancer_pool(self,
return response
- def update_load_balancer_pool(self,
- load_balancer_id: str,
- id: str,
- load_balancer_pool_patch: 'LoadBalancerPoolPatch',
+ def get_load_balancer_profile(self,
+ name: str,
**kwargs
) -> DetailedResponse:
"""
- Update a load balancer pool.
+ Retrieve a load balancer profile.
- This request updates a load balancer pool from a pool patch.
+ 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 id: The pool identifier.
- :param LoadBalancerPoolPatch load_balancer_pool_patch: The load balancer
- pool 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 `LoadBalancerPool` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerProfile` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if id is None:
- 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)
+ if name is None:
+ 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_pool')
+ operation_id='get_load_balancer_profile')
headers.update(sdk_headers)
params = {
@@ -13855,67 +13590,60 @@ def update_load_balancer_pool(self,
'generation': self.generation
}
- data = json.dumps(load_balancer_pool_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('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 = ['name']
+ path_param_values = self.encode_path_vars(name)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/load_balancers/{load_balancer_id}/pools/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='PATCH',
+ url = '/load_balancer/profiles/{name}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def list_load_balancer_pool_members(self,
- load_balancer_id: str,
- pool_id: str,
+ def list_load_balancers(self,
+ *,
+ start: str = None,
+ limit: int = None,
**kwargs
) -> DetailedResponse:
"""
- List all members of a load balancer pool.
+ List all load balancers.
- This request lists all members of a load balancer pool.
+ This request lists all load balancers in the region.
- :param str load_balancer_id: The load balancer identifier.
- :param str pool_id: The pool 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 `LoadBalancerPoolMemberCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerCollection` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if pool_id is None:
- 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')
+ operation_id='list_load_balancers')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation
+ 'generation': self.generation,
+ 'start': start,
+ 'limit': limit
}
if 'headers' in kwargs:
headers.update(kwargs.get('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_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'
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -13925,48 +13653,84 @@ def list_load_balancer_pool_members(self,
return response
- def create_load_balancer_pool_member(self,
- load_balancer_id: str,
- pool_id: str,
- port: int,
- target: 'LoadBalancerPoolMemberTargetPrototype',
+ def create_load_balancer(self,
+ is_public: bool,
+ subnets: List['SubnetIdentity'],
*,
- weight: int = None,
+ listeners: List['LoadBalancerListenerPrototypeLoadBalancerContext'] = None,
+ logging: 'LoadBalancerLogging' = 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 member in a load balancer pool.
+ Create a load balancer.
- This request creates a new member and adds the member to the pool.
+ This request creates and provisions a new load balancer.
- :param str load_balancer_id: The load balancer identifier.
- :param str pool_id: The pool identifier.
- :param int port: The port number of the application running in the server
- member.
- :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.
- :param int weight: (optional) Weight of the server member. Applicable only
- if the pool algorithm is
- `weighted_round_robin`.
+ :param bool is_public: Indicates whether this load balancer is public or
+ private.
+ At present, if route mode is enabled, the load balancer must be private.
+ :param List[SubnetIdentity] subnets: The subnets to provision this load
+ balancer.
+ :param List[LoadBalancerListenerPrototypeLoadBalancerContext] listeners:
+ (optional) The listeners of this load balancer.
+ :param LoadBalancerLogging logging: (optional) The logging configuration to
+ use for this load balancer. See [VPC Datapath
+ Logging](https://cloud.ibm.com/docs/vpc?topic=vpc-datapath-logging)
+ on the logging format, fields and permitted values.
+ To activate logging, the load balancer profile must support the specified
+ logging
+ type.
+ :param str name: (optional) The user-defined name for this load balancer.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param List[LoadBalancerPoolPrototype] pools: (optional) The pools of this
+ load balancer.
+ :param LoadBalancerProfileIdentity profile: (optional) The profile to use
+ for this load balancer.
+ :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 `LoadBalancerPoolMember` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if pool_id is None:
- 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)
+ 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 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_member')
+ operation_id='create_load_balancer')
headers.update(sdk_headers)
params = {
@@ -13975,9 +13739,16 @@ def create_load_balancer_pool_member(self,
}
data = {
- 'port': port,
- 'target': target,
- 'weight': weight
+ 'is_public': is_public,
+ 'subnets': subnets,
+ '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)
@@ -13987,10 +13758,7 @@ def create_load_balancer_pool_member(self,
headers.update(kwargs.get('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_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'
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -14001,38 +13769,27 @@ def create_load_balancer_pool_member(self,
return response
- def replace_load_balancer_pool_members(self,
- load_balancer_id: str,
- pool_id: str,
- members: List['LoadBalancerPoolMemberPrototype'],
+ def delete_load_balancer(self,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- Replace load balancer pool members.
+ Delete 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 deletes a load balancer. This operation cannot be reversed.
- :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 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
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if pool_id is None:
- 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 id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='replace_load_balancer_pool_members')
+ operation_id='delete_load_balancer')
headers.update(sdk_headers)
params = {
@@ -14040,60 +13797,44 @@ def replace_load_balancer_pool_members(self,
'generation': self.generation
}
- data = {
- 'members': members
- }
- data = {k: v for (k, v) in data.items() if v is not None}
- data = json.dumps(data)
- headers['content-type'] = 'application/json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- 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)
- request = self.prepare_request(method='PUT',
+ url = '/load_balancers/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- def delete_load_balancer_pool_member(self,
- load_balancer_id: str,
- pool_id: str,
+ def get_load_balancer(self,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a load balancer pool member.
+ Retrieve a load balancer.
- This request deletes a member from the pool. This operation cannot be reversed.
+ 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 pool_id: The pool identifier.
- :param str id: The member 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
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancer` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if pool_id is None:
- raise ValueError('pool_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_load_balancer_pool_member')
+ operation_id='get_load_balancer')
headers.update(sdk_headers)
params = {
@@ -14103,12 +13844,13 @@ def delete_load_balancer_pool_member(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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 = ['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/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ url = '/load_balancers/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
params=params)
@@ -14117,36 +13859,33 @@ def delete_load_balancer_pool_member(self,
return response
- def get_load_balancer_pool_member(self,
- load_balancer_id: str,
- pool_id: str,
+ def update_load_balancer(self,
id: str,
+ load_balancer_patch: 'LoadBalancerPatch',
**kwargs
) -> DetailedResponse:
"""
- Retrieve a load balancer pool member.
+ Update a load balancer.
- This request retrieves a single member specified by the identifier in the URL
- path.
+ This request updates a load balancer.
- :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 load balancer identifier.
+ :param LoadBalancerPatch load_balancer_patch: The load balancer 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 `LoadBalancer` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if pool_id is None:
- raise ValueError('pool_id must be provided')
if id is None:
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 = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_load_balancer_pool_member')
+ operation_id='update_load_balancer')
headers.update(sdk_headers)
params = {
@@ -14154,59 +13893,48 @@ def get_load_balancer_pool_member(self,
'generation': self.generation
}
+ data = json.dumps(load_balancer_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
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 = ['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/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='GET',
+ url = '/load_balancers/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def update_load_balancer_pool_member(self,
- load_balancer_id: str,
- pool_id: str,
+ def get_load_balancer_statistics(self,
id: str,
- load_balancer_pool_member_patch: 'LoadBalancerPoolMemberPatch',
**kwargs
) -> DetailedResponse:
"""
- Update a load balancer pool member.
+ List all statistics of a load balancer.
- This request updates an existing member from a member patch.
+ 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 member identifier.
- :param LoadBalancerPoolMemberPatch load_balancer_pool_member_patch: The
- load balancer pool member patch.
+ :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 `LoadBalancerPoolMember` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerStatistics` object
"""
- if load_balancer_id is None:
- raise ValueError('load_balancer_id must be provided')
- if pool_id is None:
- raise ValueError('pool_id must be provided')
if id is None:
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')
+ operation_id='get_load_balancer_statistics')
headers.update(sdk_headers)
params = {
@@ -14214,77 +13942,59 @@ def update_load_balancer_pool_member(self,
'generation': self.generation
}
- data = json.dumps(load_balancer_pool_member_patch)
- headers['content-type'] = 'application/merge-patch+json'
-
if 'headers' in kwargs:
headers.update(kwargs.get('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_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',
+ 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)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
response = self.send(request, **kwargs)
return response
- #########################
- # Endpoint gateways
- #########################
-
- def list_endpoint_gateways(self,
- *,
- name: str = None,
- start: str = None,
- limit: int = None,
- resource_group_id: str = None,
+ def list_load_balancer_listeners(self,
+ load_balancer_id: str,
**kwargs
) -> DetailedResponse:
"""
- List all endpoint gateways.
+ List all listeners for a load balancer.
- 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 listeners for a load balancer.
- :param str name: (optional) Filters the collection to resources with the
- exact specified name.
- :param str start: (optional) A server-supplied 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 in the resource group with the specified identifier.
+ :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 `EndpointGatewayCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerCollection` object
"""
+ if load_balancer_id is None:
+ 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_endpoint_gateways')
+ operation_id='list_load_balancer_listeners')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation,
- 'name': name,
- 'start': start,
- 'limit': limit,
- 'resource_group.id': resource_group_id
+ 'generation': self.generation
}
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/endpoint_gateways'
+ path_param_keys = ['load_balancer_id']
+ path_param_values = self.encode_path_vars(load_balancer_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -14294,53 +14004,107 @@ def list_endpoint_gateways(self,
return response
- def create_endpoint_gateway(self,
- target: 'EndpointGatewayTargetPrototype',
- vpc: 'VPCIdentity',
+ def create_load_balancer_listener(self,
+ load_balancer_id: str,
+ protocol: str,
*,
- ips: List['EndpointGatewayReservedIP'] = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ accept_proxy_protocol: bool = None,
+ certificate_instance: 'CertificateInstanceIdentity' = None,
+ connection_limit: int = None,
+ default_pool: 'LoadBalancerPoolIdentity' = None,
+ https_redirect: 'LoadBalancerListenerHTTPSRedirectPrototype' = None,
+ policies: List['LoadBalancerListenerPolicyPrototype'] = None,
+ port: int = None,
+ port_max: int = None,
+ port_min: int = None,
**kwargs
) -> DetailedResponse:
"""
- Create an endpoint gateway.
+ Create a listener for a load balancer.
- 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.
+ This request creates a new listener for a load balancer.
- :param EndpointGatewayTargetPrototype target: The target for this endpoint
- gateway.
- :param VPCIdentity vpc: The VPC this endpoint gateway will serve.
- :param List[EndpointGatewayReservedIP] ips: (optional) The reserved IPs to
- bind to this endpoint gateway. At most one reserved IP per zone is allowed.
- :param str name: (optional) The user-defined name for this endpoint
- gateway. If unspecified, the name will be a hyphenated list of
- randomly-selected words. Names must be unique within the VPC this endpoint
- gateway is serving.
- :param 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 protocol: The listener protocol. Each listener in the load
+ balancer must have a unique `port` and `protocol` combination. Additional
+ restrictions:
+ - If this load balancer is in the `network` family, the protocol must be
+ `tcp`.
+ - If this listener has `https_redirect` specified, the protocol must be
+ `http`.
+ - If this listener is a listener's `https_redirect` target, the protocol
+ must be `https`.
+ :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 used for SSL termination. It is applicable only to
+ `https`
+ protocol.
+ :param int connection_limit: (optional) The connection limit of the
+ listener.
+ :param LoadBalancerPoolIdentity default_pool: (optional) The default pool
+ associated with the listener. The specified pool must:
+ - Belong to this load balancer
+ - Have the same `protocol` as this listener
+ - Not already be the default pool for another listener.
+ :param LoadBalancerListenerHTTPSRedirectPrototype https_redirect:
+ (optional) The target listener that requests will be redirected to. This
+ listener must have a
+ `protocol` of `http`, and the target listener must have a `protocol` of
+ `https`.
+ :param List[LoadBalancerListenerPolicyPrototype] policies: (optional) The
+ policy prototype objects for this listener.
+ :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 `EndpointGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` 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 load_balancer_id is None:
+ 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]
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')
headers.update(sdk_headers)
params = {
@@ -14349,11 +14113,16 @@ def create_endpoint_gateway(self,
}
data = {
- 'target': target,
- 'vpc': vpc,
- 'ips': ips,
- 'name': name,
- 'resource_group': resource_group
+ 'protocol': protocol,
+ 'accept_proxy_protocol': accept_proxy_protocol,
+ 'certificate_instance': certificate_instance,
+ 'connection_limit': connection_limit,
+ 'default_pool': default_pool,
+ 'https_redirect': https_redirect,
+ '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)
@@ -14363,7 +14132,10 @@ def create_endpoint_gateway(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/endpoint_gateways'
+ path_param_keys = ['load_balancer_id']
+ path_param_values = self.encode_path_vars(load_balancer_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/load_balancers/{load_balancer_id}/listeners'.format(**path_param_dict)
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -14374,58 +14146,48 @@ def create_endpoint_gateway(self,
return response
- def list_endpoint_gateway_ips(self,
- endpoint_gateway_id: str,
- *,
- start: str = None,
- limit: int = None,
- sort: str = None,
+ def delete_load_balancer_listener(self,
+ load_balancer_id: str,
+ id: str,
**kwargs
) -> DetailedResponse:
"""
- List all reserved IPs bound to an endpoint gateway.
+ Delete a load balancer listener.
- This request lists all reserved IPs bound to an endpoint gateway.
+ 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 endpoint_gateway_id: The endpoint gateway identifier.
- :param str start: (optional) A server-supplied 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 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 `ReservedIPCollectionEndpointGatewayContext` object
+ :rtype: DetailedResponse
"""
- if endpoint_gateway_id is None:
- raise ValueError('endpoint_gateway_id must be provided')
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='list_endpoint_gateway_ips')
+ operation_id='delete_load_balancer_listener')
headers.update(sdk_headers)
params = {
'version': self.version,
- 'generation': self.generation,
- 'start': start,
- 'limit': limit,
- 'sort': sort
+ 'generation': self.generation
}
if 'headers' in kwargs:
headers.update(kwargs.get('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', 'id']
+ path_param_values = self.encode_path_vars(load_balancer_id, 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 = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -14434,33 +14196,32 @@ def list_endpoint_gateway_ips(self,
return response
- def remove_endpoint_gateway_ip(self,
- endpoint_gateway_id: str,
+ def get_load_balancer_listener(self,
+ load_balancer_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Unbind a reserved IP from an endpoint gateway.
+ Retrieve a load balancer listener.
- 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.
+ This request retrieves a single listener 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 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
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object
"""
- if endpoint_gateway_id is None:
- raise ValueError('endpoint_gateway_id must be provided')
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='remove_endpoint_gateway_ip')
+ operation_id='get_load_balancer_listener')
headers.update(sdk_headers)
params = {
@@ -14470,12 +14231,13 @@ def remove_endpoint_gateway_ip(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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', 'id']
+ path_param_values = self.encode_path_vars(load_balancer_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 = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
params=params)
@@ -14484,32 +14246,38 @@ def remove_endpoint_gateway_ip(self,
return response
- def get_endpoint_gateway_ip(self,
- endpoint_gateway_id: str,
+ def update_load_balancer_listener(self,
+ load_balancer_id: str,
id: str,
+ load_balancer_listener_patch: 'LoadBalancerListenerPatch',
**kwargs
) -> DetailedResponse:
"""
- Retrieve a reserved IP bound to an endpoint gateway.
+ Update a load balancer listener.
- This request a retrieves the specified reserved IP address if it is bound to the
- endpoint gateway specified in the URL.
+ This request updates a load balancer listener from a listener 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 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 `ReservedIP` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListener` object
"""
- if endpoint_gateway_id is None:
- raise ValueError('endpoint_gateway_id must be provided')
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
if id is None:
raise ValueError('id must be provided')
+ if load_balancer_listener_patch is None:
+ raise ValueError('load_balancer_listener_patch must be provided')
+ if isinstance(load_balancer_listener_patch, LoadBalancerListenerPatch):
+ load_balancer_listener_patch = convert_model(load_balancer_listener_patch)
headers = {}
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')
headers.update(sdk_headers)
params = {
@@ -14517,52 +14285,52 @@ def get_endpoint_gateway_ip(self,
'generation': self.generation
}
+ data = json.dumps(load_balancer_listener_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
if 'headers' in kwargs:
headers.update(kwargs.get('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', 'id']
+ path_param_values = self.encode_path_vars(load_balancer_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 = '/load_balancers/{load_balancer_id}/listeners/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def add_endpoint_gateway_ip(self,
- endpoint_gateway_id: str,
- id: str,
+ def list_load_balancer_listener_policies(self,
+ load_balancer_id: str,
+ listener_id: str,
**kwargs
) -> DetailedResponse:
"""
- Bind a reserved IP to an endpoint gateway.
+ List all policies for a load balancer listener.
- 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 policies for a load balancer listener.
- :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 dict headers: 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 `LoadBalancerListenerPolicyCollection` object
"""
- if endpoint_gateway_id is None:
- raise ValueError('endpoint_gateway_id must be provided')
- if id is None:
- raise ValueError('id must be provided')
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ raise ValueError('listener_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_policies')
headers.update(sdk_headers)
params = {
@@ -14574,11 +14342,11 @@ def add_endpoint_gateway_ip(self,
headers.update(kwargs.get('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']
+ path_param_values = self.encode_path_vars(load_balancer_id, listener_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 = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
params=params)
@@ -14587,29 +14355,62 @@ def add_endpoint_gateway_ip(self,
return response
- def delete_endpoint_gateway(self,
- id: str,
+ def create_load_balancer_listener_policy(self,
+ load_balancer_id: str,
+ listener_id: str,
+ action: str,
+ priority: int,
+ *,
+ name: str = None,
+ rules: List['LoadBalancerListenerPolicyRulePrototype'] = None,
+ target: 'LoadBalancerListenerPolicyTargetPrototype' = None,
**kwargs
) -> DetailedResponse:
"""
- Delete an endpoint gateway.
+ Create a policy for a load balancer listener.
- 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 policy for a load balancer listener.
- :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 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 user-defined name for this policy. Names
+ must be unique within the load balancer listener the policy resides in.
+ :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
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
"""
- if id is None:
- raise ValueError('id must be provided')
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ 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='delete_endpoint_gateway')
+ operation_id='create_load_balancer_listener_policy')
headers.update(sdk_headers)
params = {
@@ -14617,44 +14418,64 @@ def delete_endpoint_gateway(self,
'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'))
+ headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ 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 = '/endpoint_gateways/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='DELETE',
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies'.format(**path_param_dict)
+ request = self.prepare_request(method='POST',
url=url,
headers=headers,
- params=params)
+ params=params,
+ data=data)
response = self.send(request, **kwargs)
return response
- def get_endpoint_gateway(self,
+ def delete_load_balancer_listener_policy(self,
+ load_balancer_id: str,
+ listener_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve an endpoint gateway.
+ Delete a load balancer listener policy.
- This request retrieves a single endpoint gateway specified by the identifier in
- the URL.
+ Deletes a policy of the load balancer listener. 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 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 `EndpointGateway` object
+ :rtype: DetailedResponse
"""
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ raise ValueError('listener_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_endpoint_gateway')
+ operation_id='delete_load_balancer_listener_policy')
headers.update(sdk_headers)
params = {
@@ -14664,13 +14485,12 @@ def get_endpoint_gateway(self,
if 'headers' in kwargs:
headers.update(kwargs.get('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', '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/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='GET',
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
params=params)
@@ -14679,34 +14499,35 @@ def get_endpoint_gateway(self,
return response
- def update_endpoint_gateway(self,
+ def get_load_balancer_listener_policy(self,
+ load_balancer_id: str,
+ listener_id: str,
id: str,
- endpoint_gateway_patch: 'EndpointGatewayPatch',
**kwargs
) -> DetailedResponse:
"""
- Update an endpoint gateway.
+ Retrieve a load balancer listener policy.
- This request updates an endpoint gateway's name.
+ Retrieve a single policy 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 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 `EndpointGateway` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
"""
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ raise ValueError('listener_id must be provided')
if id is None:
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')
headers.update(sdk_headers)
params = {
@@ -14714,98 +14535,131 @@ def update_endpoint_gateway(self,
'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'))
headers['Accept'] = 'application/json'
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(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/{id}'.format(**path_param_dict)
- request = self.prepare_request(method='PATCH',
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='GET',
url=url,
headers=headers,
- params=params,
- data=data)
+ params=params)
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,
+ def update_load_balancer_listener_policy(self,
+ load_balancer_id: str,
+ listener_id: str,
+ id: str,
+ load_balancer_listener_policy_patch: 'LoadBalancerListenerPolicyPatch',
**kwargs
) -> DetailedResponse:
"""
- List all flow log collectors.
+ Update a load balancer listener policy.
- 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 policy from a policy patch.
- :param str start: (optional) A server-supplied 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 in the resource group with the specified identifier.
- :param str name: (optional) Filters the collection to resources with the
- exact specified name.
- :param str vpc_id: (optional) Filters the collection to resources in the
- VPC with the specified identifier.
- :param str vpc_crn: (optional) Filters the collection to resources in the
- VPC with the specified CRN.
- :param str vpc_name: (optional) Filters the collection to resources in the
- VPC with the exact specified name.
- :param str target_id: (optional) Filters the collection to flow log
- collectors that target the specified resource.
- :param str target_resource_type: (optional) Filters the collection to flow
- log collectors that target the specified resource type.
+ :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 `FlowLogCollectorCollection` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicy` object
"""
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ raise ValueError('listener_id must be provided')
+ if id is None:
+ 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='list_flow_log_collectors')
+ operation_id='update_load_balancer_listener_policy')
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
+ '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'))
headers['Accept'] = 'application/json'
- url = '/flow_log_collectors'
+ 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 = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{id}'.format(**path_param_dict)
+ request = self.prepare_request(method='PATCH',
+ url=url,
+ headers=headers,
+ params=params,
+ data=data)
+
+ response = self.send(request, **kwargs)
+ return response
+
+
+ def list_load_balancer_listener_policy_rules(self,
+ load_balancer_id: str,
+ listener_id: str,
+ policy_id: str,
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ List all rules of a load balancer listener policy.
+
+ This request lists all rules of a load balancer listener policy.
+
+ :param str load_balancer_id: The load balancer identifier.
+ :param str listener_id: The listener identifier.
+ :param str policy_id: The policy identifier.
+ :param dict headers: A `dict` containing the request headers
+ :return: A `DetailedResponse` containing the result, headers and HTTP status code.
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRuleCollection` object
+ """
+
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ raise ValueError('listener_id must be provided')
+ if policy_id is None:
+ raise ValueError('policy_id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='list_load_balancer_listener_policy_rules')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id']
+ path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -14815,60 +14669,60 @@ def list_flow_log_collectors(self,
return response
- def create_flow_log_collector(self,
- storage_bucket: 'CloudObjectStorageBucketIdentity',
- target: 'FlowLogCollectorTargetPrototype',
+ def create_load_balancer_listener_policy_rule(self,
+ load_balancer_id: str,
+ listener_id: str,
+ policy_id: str,
+ condition: str,
+ type: str,
+ value: str,
*,
- active: bool = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None,
+ field: str = None,
**kwargs
) -> DetailedResponse:
"""
- Create a flow log collector.
+ Create a rule for a load balancer listener policy.
- 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.
+ Creates a new rule for the load balancer listener policy.
- :param CloudObjectStorageBucketIdentity 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 unique user-defined name for this flow log
- collector. 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 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 with `dict` result representing a `FlowLogCollector` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` 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 load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ raise ValueError('listener_id must be provided')
+ if policy_id is None:
+ 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='create_flow_log_collector')
+ operation_id='create_load_balancer_listener_policy_rule')
headers.update(sdk_headers)
params = {
@@ -14877,11 +14731,10 @@ def create_flow_log_collector(self,
}
data = {
- 'storage_bucket': storage_bucket,
- 'target': target,
- 'active': active,
- 'name': name,
- 'resource_group': resource_group
+ '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)
@@ -14891,7 +14744,10 @@ def create_flow_log_collector(self,
headers.update(kwargs.get('headers'))
headers['Accept'] = 'application/json'
- url = '/flow_log_collectors'
+ path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id']
+ path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id)
+ path_param_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules'.format(**path_param_dict)
request = self.prepare_request(method='POST',
url=url,
headers=headers,
@@ -14902,30 +14758,40 @@ def create_flow_log_collector(self,
return response
- def delete_flow_log_collector(self,
+ def delete_load_balancer_listener_policy_rule(self,
+ load_balancer_id: str,
+ listener_id: str,
+ policy_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Delete a flow log collector.
+ Delete a load balancer listener policy rule.
- This request stops and deletes a flow log collector. This operation cannot be
+ Deletes a rule from the load balancer listener policy. 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 str load_balancer_id: The load balancer identifier.
+ :param str listener_id: The listener identifier.
+ :param str policy_id: The policy identifier.
+ :param str id: The rule identifier.
:param dict headers: A `dict` containing the request headers
:return: A `DetailedResponse` containing the result, headers and HTTP status code.
:rtype: DetailedResponse
"""
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ raise ValueError('listener_id must be provided')
+ if policy_id is None:
+ raise ValueError('policy_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='delete_flow_log_collector')
+ operation_id='delete_load_balancer_listener_policy_rule')
headers.update(sdk_headers)
params = {
@@ -14936,10 +14802,10 @@ def delete_flow_log_collector(self,
if 'headers' in kwargs:
headers.update(kwargs.get('headers'))
- path_param_keys = ['id']
- path_param_values = self.encode_path_vars(id)
+ path_param_keys = ['load_balancer_id', 'listener_id', 'policy_id', 'id']
+ path_param_values = self.encode_path_vars(load_balancer_id, listener_id, policy_id, id)
path_param_dict = dict(zip(path_param_keys, path_param_values))
- url = '/flow_log_collectors/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
request = self.prepare_request(method='DELETE',
url=url,
headers=headers,
@@ -14949,28 +14815,39 @@ def delete_flow_log_collector(self,
return response
- def get_flow_log_collector(self,
+ def get_load_balancer_listener_policy_rule(self,
+ load_balancer_id: str,
+ listener_id: str,
+ policy_id: str,
id: str,
**kwargs
) -> DetailedResponse:
"""
- Retrieve a flow log collector.
+ Retrieve a load balancer listener policy rule.
- This request retrieves a single flow log collector specified by the identifier in
- the URL.
+ Retrieves a single rule 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 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 `FlowLogCollector` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object
"""
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ raise ValueError('listener_id must be provided')
+ if policy_id is None:
+ raise ValueError('policy_id must be provided')
if id is None:
raise ValueError('id must be provided')
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='get_flow_log_collector')
+ operation_id='get_load_balancer_listener_policy_rule')
headers.update(sdk_headers)
params = {
@@ -14982,10 +14859,10 @@ def get_flow_log_collector(self,
headers.update(kwargs.get('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 = '/flow_log_collectors/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
request = self.prepare_request(method='GET',
url=url,
headers=headers,
@@ -14995,37 +14872,46 @@ def get_flow_log_collector(self,
return response
- def update_flow_log_collector(self,
+ def update_load_balancer_listener_policy_rule(self,
+ load_balancer_id: str,
+ listener_id: str,
+ policy_id: str,
id: str,
- flow_log_collector_patch: 'FlowLogCollectorPatch',
+ load_balancer_listener_policy_rule_patch: 'LoadBalancerListenerPolicyRulePatch',
**kwargs
) -> DetailedResponse:
"""
- Update a flow log collector.
+ Update a load balancer listener policy rule.
- 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.
+ Updates a rule of the load balancer listener policy.
- :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 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 `FlowLogCollector` object
+ :rtype: DetailedResponse with `dict` result representing a `LoadBalancerListenerPolicyRule` object
"""
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if listener_id is None:
+ raise ValueError('listener_id must be provided')
+ if policy_id is None:
+ raise ValueError('policy_id must be provided')
if id is None:
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_listener_policy_rule_patch is None:
+ raise ValueError('load_balancer_listener_policy_rule_patch must be provided')
+ if isinstance(load_balancer_listener_policy_rule_patch, LoadBalancerListenerPolicyRulePatch):
+ load_balancer_listener_policy_rule_patch = convert_model(load_balancer_listener_policy_rule_patch)
headers = {}
sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
service_version='V1',
- operation_id='update_flow_log_collector')
+ operation_id='update_load_balancer_listener_policy_rule')
headers.update(sdk_headers)
params = {
@@ -15033,17 +14919,17 @@ def update_flow_log_collector(self,
'generation': self.generation
}
- data = json.dumps(flow_log_collector_patch)
+ 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'))
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 = '/flow_log_collectors/{id}'.format(**path_param_dict)
+ url = '/load_balancers/{load_balancer_id}/listeners/{listener_id}/policies/{policy_id}/rules/{id}'.format(**path_param_dict)
request = self.prepare_request(method='PATCH',
url=url,
headers=headers,
@@ -15054,331 +14940,9515 @@ def update_flow_log_collector(self,
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.
+ def list_load_balancer_pools(self,
+ load_balancer_id: str,
+ **kwargs
+ ) -> DetailedResponse:
"""
- ADDRESS = 'address'
- CREATED_AT = 'created_at'
- NAME = 'name'
-
+ List all pools of a load balancer.
-class ListImagesEnums:
- """
- Enums for list_images parameters.
- """
+ This request lists all pools of a load balancer.
- class Visibility(str, Enum):
- """
- Filters the collection to images with the specified `visibility`.
+ :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
"""
- PRIVATE = 'private'
- PUBLIC = 'public'
+ if load_balancer_id is None:
+ 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)
-class ListSnapshotsEnums:
- """
- Enums for list_snapshots parameters.
- """
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
- 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'
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('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,
+ headers=headers,
+ params=params)
+ response = self.send(request, **kwargs)
+ return response
-class ListNetworkAclRulesEnums:
- """
- Enums for list_network_acl_rules parameters.
- """
- class Direction(str, Enum):
- """
- Filters the collection to rules with the specified direction.
+ def create_load_balancer_pool(self,
+ load_balancer_id: str,
+ algorithm: str,
+ health_monitor: 'LoadBalancerPoolHealthMonitorPrototype',
+ protocol: str,
+ *,
+ members: List['LoadBalancerPoolMemberPrototype'] = None,
+ name: str = None,
+ proxy_protocol: str = None,
+ session_persistence: 'LoadBalancerPoolSessionPersistencePrototype' = None,
+ **kwargs
+ ) -> DetailedResponse:
"""
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
+ Create a load balancer pool.
-class ListVpnGatewaysEnums:
- """
- Enums for list_vpn_gateways parameters.
- """
+ This request creates a new pool from a pool prototype object.
- class Mode(str, Enum):
- """
- Filters the collection to VPN gateways with the specified mode.
+ :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`. 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 user-defined name for this load balancer
+ pool. 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 `LoadBalancerPool` object
"""
- POLICY = 'policy'
- ROUTE = 'route'
-
-class ListEndpointGatewayIpsEnums:
- """
- Enums for list_endpoint_gateway_ips parameters.
- """
+ if load_balancer_id is None:
+ 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_load_balancer_pool')
+ 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.
- """
- ADDRESS = 'address'
- CREATED_AT = 'created_at'
- NAME = 'name'
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+ data = {
+ 'algorithm': algorithm,
+ 'health_monitor': health_monitor,
+ 'protocol': protocol,
+ 'members': members,
+ 'name': name,
+ '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)
+ headers['content-type'] = 'application/json'
-class ListFlowLogCollectorsEnums:
- """
- Enums for list_flow_log_collectors parameters.
- """
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
- class TargetResourceType(str, Enum):
- """
+ 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,
+ headers=headers,
+ params=params,
+ data=data)
+
+ response = self.send(request, **kwargs)
+ return response
+
+
+ def delete_load_balancer_pool(self,
+ load_balancer_id: str,
+ id: str,
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ Delete a load balancer pool.
+
+ 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 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 load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_load_balancer_pool')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+
+ 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/{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_load_balancer_pool(self,
+ load_balancer_id: str,
+ id: str,
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ Retrieve a load balancer pool.
+
+ This request retrieves a single pool specified by the identifier in the URL path.
+
+ :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 `LoadBalancerPool` object
+ """
+
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_load_balancer_pool')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['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/{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_load_balancer_pool(self,
+ load_balancer_id: str,
+ id: str,
+ load_balancer_pool_patch: 'LoadBalancerPoolPatch',
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ Update a load balancer pool.
+
+ This request updates a load balancer pool from a pool 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 `LoadBalancerPool` object
+ """
+
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if id is None:
+ 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 = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='update_load_balancer_pool')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ data = json.dumps(load_balancer_pool_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('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_dict = dict(zip(path_param_keys, path_param_values))
+ url = '/load_balancers/{load_balancer_id}/pools/{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_pool_members(self,
+ load_balancer_id: str,
+ pool_id: str,
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ List all members of a load balancer pool.
+
+ This request lists all members of a load balancer pool.
+
+ :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
+ """
+
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if pool_id is None:
+ 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
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('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_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)
+
+ 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.
+
+ This request creates a new member and adds the member to the pool.
+
+ :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.
+ :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
+ """
+
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if pool_id is None:
+ 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)
+
+ 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'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('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_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)
+
+ 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.
+
+ 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
+ """
+
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if pool_id is None:
+ 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)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ data = {
+ 'members': members
+ }
+ data = {k: v for (k, v) in data.items() if v is not None}
+ data = json.dumps(data)
+ headers['content-type'] = 'application/json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ 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_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)
+
+ 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.
+
+ 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
+ """
+
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if pool_id is None:
+ raise ValueError('pool_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_load_balancer_pool_member')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('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)
+
+ response = self.send(request, **kwargs)
+ return response
+
+
+ def get_load_balancer_pool_member(self,
+ load_balancer_id: str,
+ pool_id: str,
+ id: str,
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ Retrieve a load balancer pool member.
+
+ 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
+ """
+
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if pool_id is None:
+ raise ValueError('pool_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_load_balancer_pool_member')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['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)
+
+ 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.
+
+ This request updates an existing member from a member 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 dict headers: 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
+ """
+
+ if load_balancer_id is None:
+ raise ValueError('load_balancer_id must be provided')
+ if pool_id is None:
+ raise ValueError('pool_id must be provided')
+ if id is None:
+ 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
+ }
+
+ data = json.dumps(load_balancer_pool_member_patch)
+ headers['content-type'] = 'application/merge-patch+json'
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('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_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
+
+ #########################
+ # Endpoint gateways
+ #########################
+
+
+ def list_endpoint_gateways(self,
+ *,
+ name: str = None,
+ start: str = None,
+ limit: int = None,
+ resource_group_id: str = None,
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ 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 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 in the resource group with 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
+ """
+
+ 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'))
+ headers['Accept'] = 'application/json'
+
+ url = '/endpoint_gateways'
+ request = self.prepare_request(method='GET',
+ url=url,
+ headers=headers,
+ params=params)
+
+ 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:
+ """
+ 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 for this endpoint
+ gateway.
+ :param VPCIdentity vpc: The VPC this endpoint gateway will serve.
+ :param List[EndpointGatewayReservedIP] ips: (optional) The reserved IPs to
+ bind to this endpoint gateway. At most one reserved IP per zone is allowed.
+ :param str name: (optional) The user-defined name for this endpoint
+ gateway. If unspecified, the name will be a hyphenated list of
+ randomly-selected words. Names must be unique within the VPC this endpoint
+ gateway is serving.
+ :param 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
+ """
+
+ 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
+ }
+
+ 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'))
+ headers['Accept'] = 'application/json'
+
+ url = '/endpoint_gateways'
+ request = self.prepare_request(method='POST',
+ url=url,
+ headers=headers,
+ params=params,
+ data=data)
+
+ response = self.send(request, **kwargs)
+ return response
+
+
+ def list_endpoint_gateway_ips(self,
+ endpoint_gateway_id: str,
+ *,
+ start: str = None,
+ limit: int = None,
+ sort: str = None,
+ **kwargs
+ ) -> DetailedResponse:
+ """
+ List all reserved IPs bound to an endpoint gateway.
+
+ 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
+ """
+
+ if endpoint_gateway_id is None:
+ 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'))
+ 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 endpoint_gateway_id is None:
+ raise ValueError('endpoint_gateway_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='remove_endpoint_gateway_ip')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('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 a 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 endpoint_gateway_id is None:
+ raise ValueError('endpoint_gateway_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_endpoint_gateway_ip')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['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 endpoint_gateway_id is None:
+ raise ValueError('endpoint_gateway_id must be provided')
+ if id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='add_endpoint_gateway_ip')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['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 id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_endpoint_gateway')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('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 id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_endpoint_gateway')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['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 id is None:
+ 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'))
+ 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 one or more network interfaces within a VPC, depending
+ on the chosen 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 in the resource group with the specified identifier.
+ :param str name: (optional) Filters the collection to resources with the
+ exact specified name.
+ :param str vpc_id: (optional) Filters the collection to resources in the
+ VPC with the specified identifier.
+ :param str vpc_crn: (optional) Filters the collection to resources in the
+ VPC with the specified CRN.
+ :param str vpc_name: (optional) Filters the collection to resources in the
+ VPC with the exact specified name.
+ :param str target_id: (optional) Filters the collection to flow log
+ collectors that target the specified resource.
+ :param str target_resource_type: (optional) Filters the collection to flow
+ log collectors that target the specified resource type.
+ :param dict headers: 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'))
+ 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: 'CloudObjectStorageBucketIdentity',
+ 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 CloudObjectStorageBucketIdentity 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 unique user-defined name for this flow log
+ collector. 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'))
+ 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 id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='delete_flow_log_collector')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('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 id is None:
+ raise ValueError('id must be provided')
+ headers = {}
+ sdk_headers = get_sdk_headers(service_name=self.DEFAULT_SERVICE_NAME,
+ service_version='V1',
+ operation_id='get_flow_log_collector')
+ headers.update(sdk_headers)
+
+ params = {
+ 'version': self.version,
+ 'generation': self.generation
+ }
+
+ if 'headers' in kwargs:
+ headers.update(kwargs.get('headers'))
+ headers['Accept'] = 'application/json'
+
+ path_param_keys = ['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 id is None:
+ 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'))
+ 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 Visibility(str, Enum):
+ """
+ Filters the collection to images with the specified `visibility`.
+ """
+ PRIVATE = 'private'
+ PUBLIC = 'public'
+
+
+class ListBareMetalServersEnums:
+ """
+ Enums for list_bare_metal_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 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 ListNetworkAclRulesEnums:
+ """
+ Enums for list_network_acl_rules parameters.
+ """
+
+ class Direction(str, Enum):
+ """
+ Filters the collection to rules with the specified direction.
+ """
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+class ListVpnGatewaysEnums:
+ """
+ Enums for list_vpn_gateways parameters.
+ """
+
+ class Mode(str, Enum):
+ """
+ Filters the collection to VPN gateways with the specified mode.
+ """
+ POLICY = 'policy'
+ ROUTE = 'route'
+
+
+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'
+
+
+class ListFlowLogCollectorsEnums:
+ """
+ Enums for list_flow_log_collectors parameters.
+ """
+
+ class TargetResourceType(str, Enum):
+ """
Filters the collection to flow log collectors that target the specified resource
type.
"""
- INSTANCE = 'instance'
- NETWORK_INTERFACE = 'network_interface'
- SUBNET = 'subnet'
- VPC = 'vpc'
+ INSTANCE = 'instance'
+ NETWORK_INTERFACE = 'network_interface'
+ SUBNET = 'subnet'
+ VPC = 'vpc'
+
+
+##############################################################################
+# Models
+##############################################################################
+
+
+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 updated with a user-specified name.
+ :attr str name: The user-defined name for this address prefix. Names must be
+ unique within the VPC the address prefix resides in.
+ :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 updated with a user-specified
+ name.
+ :param str name: The user-defined name for this address prefix. Names must
+ be unique within the VPC the address prefix resides in.
+ :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:
+ _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(x) for x 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:
+ _dict['address_prefixes'] = [x.to_dict() for x in self.address_prefixes]
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this 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 user-defined name for this address prefix. Names
+ must be unique within the VPC the address prefix resides in.
+ """
+
+ 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 user-defined name for this address prefix.
+ Names must be unique within the VPC the address prefix resides in.
+ """
+ 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 BareMetalServer():
+ """
+ BareMetalServer.
+
+ :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 int memory: The amount of memory, truncated to whole gibibytes.
+ :attr str name: The user-defined name for this bare metal server (and default
+ system hostname).
+ :attr 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 this bare metal
+ server uses.
+ :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,
+ 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'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 int memory: The amount of memory, truncated to whole gibibytes.
+ :param str name: The user-defined name for this bare metal server (and
+ default system hostname).
+ :param 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 this bare metal
+ server uses.
+ :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.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(x) for x 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 '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(x) for x 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(x) for x 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:
+ _dict['cpu'] = self.cpu.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'disks') and self.disks is not None:
+ _dict['disks'] = [x.to_dict() for x in self.disks]
+ 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, '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:
+ _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons]
+ if hasattr(self, 'trusted_platform_module') and self.trusted_platform_module is not None:
+ _dict['trusted_platform_module'] = self.trusted_platform_module.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ _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 ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ BARE_METAL_SERVER = 'bare_metal_server'
+
+
+ class StatusEnum(str, Enum):
+ """
+ The status of the bare metal server.
+ """
+ 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(x) for x 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:
+ _dict['bare_metal_servers'] = [x.to_dict() for x in self.bare_metal_servers]
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this 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 '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')
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerConsoleAccessToken JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a BareMetalServerConsoleAccessToken object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'access_token') and self.access_token is not None:
+ _dict['access_token'] = self.access_token
+ if hasattr(self, 'console_type') and self.console_type is not None:
+ _dict['console_type'] = self.console_type
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'expires_at') and self.expires_at is not None:
+ _dict['expires_at'] = datetime_to_string(self.expires_at)
+ if hasattr(self, 'force') and self.force is not None:
+ _dict['force'] = self.force
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerConsoleAccessToken object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'BareMetalServerConsoleAccessToken') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'BareMetalServerConsoleAccessToken') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ConsoleTypeEnum(str, Enum):
+ """
+ The bare metal server console type for which this token may be used.
+ """
+ SERIAL = 'serial'
+ VNC = 'vnc'
+
+
+class BareMetalServerDisk():
+ """
+ BareMetalServerDisk.
+
+ :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.
+ 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 user-defined name for this disk.
+ :attr str resource_type: The resource type.
+ :attr int size: The size of the disk in GB (gigabytes).
+ """
+
+ def __init__(self,
+ created_at: datetime,
+ href: str,
+ id: str,
+ interface_type: str,
+ name: str,
+ resource_type: str,
+ size: int) -> None:
+ """
+ Initialize a BareMetalServerDisk 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.
+ 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 user-defined name for this disk.
+ :param str resource_type: The resource type.
+ :param int size: The size of the disk in GB (gigabytes).
+ """
+ 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
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerDisk':
+ """Initialize a BareMetalServerDisk 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 BareMetalServerDisk JSON')
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ 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 BareMetalServerDisk JSON')
+ if 'interface_type' in _dict:
+ args['interface_type'] = _dict.get('interface_type')
+ else:
+ 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 BareMetalServerDisk 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')
+ else:
+ raise ValueError('Required property \'size\' not present in BareMetalServerDisk JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerDisk object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __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: '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.
+ 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'
+ SATA = 'sata'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ BARE_METAL_SERVER_DISK = 'bare_metal_server_disk'
+
+
+class BareMetalServerDiskCollection():
+ """
+ BareMetalServerDiskCollection.
+
+ :attr List[BareMetalServerDisk] disks: Collection of the bare metal server's
+ disks.
+ """
+
+ def __init__(self,
+ disks: List['BareMetalServerDisk']) -> None:
+ """
+ Initialize a BareMetalServerDiskCollection object.
+
+ :param List[BareMetalServerDisk] disks: Collection of the bare metal
+ server's disks.
+ """
+ self.disks = disks
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskCollection':
+ """Initialize a BareMetalServerDiskCollection object from a json dictionary."""
+ args = {}
+ if 'disks' in _dict:
+ args['disks'] = [BareMetalServerDisk.from_dict(x) for x in _dict.get('disks')]
+ else:
+ raise ValueError('Required property \'disks\' not present in BareMetalServerDiskCollection JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a BareMetalServerDiskCollection object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'disks') and self.disks is not None:
+ _dict['disks'] = [x.to_dict() for x in self.disks]
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerDiskCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'BareMetalServerDiskCollection') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'BareMetalServerDiskCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class BareMetalServerDiskPatch():
+ """
+ BareMetalServerDiskPatch.
+
+ :attr str name: (optional) The user-defined name for this disk.
+ """
+
+ def __init__(self,
+ *,
+ name: str = None) -> None:
+ """
+ Initialize a BareMetalServerDiskPatch object.
+
+ :param str name: (optional) The user-defined name for this disk.
+ """
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerDiskPatch':
+ """Initialize a BareMetalServerDiskPatch 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 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 \'more_info\' not present in BareMetalServerDiskReferenceDeleted JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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(x) for x 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:
+ _dict['image'] = self.image.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ _dict['keys'] = [x.to_dict() for x in self.keys]
+ if hasattr(self, 'user_accounts') and self.user_accounts is not None:
+ user_accounts_list = []
+ for x in self.user_accounts:
+ if isinstance(x, dict):
+ user_accounts_list.append(x)
+ else:
+ user_accounts_list.append(x.to_dict())
+ _dict['user_accounts'] = user_accounts_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 BareMetalServerInitialization object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerInitialization') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class BareMetalServerInitializationPrototype():
+ """
+ BareMetalServerInitializationPrototype.
+
+ :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.
+ """
+
+ def __init__(self,
+ image: 'ImageIdentity',
+ keys: List['KeyIdentity'],
+ *,
+ user_data: str = None) -> None:
+ """
+ Initialize a BareMetalServerInitializationPrototype 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
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationPrototype':
+ """Initialize a BareMetalServerInitializationPrototype 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')
+ 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 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, '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 x in self.keys:
+ if isinstance(x, dict):
+ keys_list.append(x)
+ else:
+ keys_list.append(x.to_dict())
+ _dict['keys'] = keys_list
+ if hasattr(self, 'user_data') and self.user_data is not None:
+ _dict['user_data'] = self.user_data
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerInitializationPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerInitializationPrototype') -> 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 BareMetalServerNetworkInterface():
+ """
+ BareMetalServerNetworkInterface.
+
+ :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on
+ this interface. If false, source IP spoofing is prevented on this interface. If
+ true, source IP spoofing is allowed on this interface.
+ :attr datetime created_at: The date and time that the network interface was
+ created.
+ :attr bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :attr List[FloatingIPReference] floating_ips: (optional) The floating IPs
+ associated with this network interface.
+ :attr str href: The URL for this network interface.
+ :attr str id: The unique identifier for this network interface.
+ :attr str interface_type: The network interface type:
+ - `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.
+ :attr str mac_address: The MAC address of the interface. If absent, the value
+ is not known.
+ :attr str name: The user-defined name for this network interface.
+ :attr int port_speed: The network interface port speed in Mbps.
+ :attr str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :attr str resource_type: The resource type.
+ :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.
+ """
+
+ def __init__(self,
+ allow_ip_spoofing: bool,
+ created_at: datetime,
+ enable_infrastructure_nat: bool,
+ href: str,
+ id: str,
+ interface_type: str,
+ mac_address: str,
+ name: str,
+ port_speed: int,
+ primary_ipv4_address: str,
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
+ status: str,
+ subnet: 'SubnetReference',
+ type: str,
+ *,
+ floating_ips: List['FloatingIPReference'] = None) -> None:
+ """
+ Initialize a BareMetalServerNetworkInterface object.
+
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
+ allowed on this interface. If false, source IP spoofing is prevented on
+ this interface. If true, source IP spoofing is allowed on this interface.
+ :param datetime created_at: The date and time that the network interface
+ was created.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :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:
+ - `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.
+ :param str mac_address: The MAC address of the interface. If absent, the
+ value is not known.
+ :param str name: The user-defined name for this network interface.
+ :param int port_speed: The network interface port speed in Mbps.
+ :param str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :param str resource_type: The resource type.
+ :param 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[FloatingIPReference] floating_ips: (optional) The floating IPs
+ associated with this network interface.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']))
+ raise Exception(msg)
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterface':
+ """Initialize a BareMetalServerNetworkInterface object from a json dictionary."""
+ disc_class = cls._get_class_by_discriminator(_dict)
+ if disc_class != cls:
+ return disc_class.from_dict(_dict)
+ msg = ("Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterface'. " +
+ "The discriminator value should map to a valid subclass: {1}").format(
+ ", ".join(['BareMetalServerNetworkInterfaceByPCI', 'BareMetalServerNetworkInterfaceByVLAN']))
+ raise Exception(msg)
+
+ @classmethod
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a BareMetalServerNetworkInterface object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ @classmethod
+ def _get_class_by_discriminator(cls, _dict: Dict) -> object:
+ mapping = {}
+ mapping['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:
+ - `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.
+ """
+ PCI = 'pci'
+ VLAN = 'vlan'
+
+
+ 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 BareMetalServerNetworkInterfaceCollection():
+ """
+ BareMetalServerNetworkInterfaceCollection.
+
+ :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 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
+ except the last page.
+ :attr int total_count: The total number of resources across all pages.
+ """
+
+ def __init__(self,
+ first: 'BareMetalServerNetworkInterfaceCollectionFirst',
+ limit: int,
+ network_interfaces: List['BareMetalServerNetworkInterface'],
+ total_count: int,
+ *,
+ next: 'BareMetalServerNetworkInterfaceCollectionNext' = None) -> None:
+ """
+ Initialize a BareMetalServerNetworkInterfaceCollection object.
+
+ :param BareMetalServerNetworkInterfaceCollectionFirst first: A link to the
+ first page of resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param List[BareMetalServerNetworkInterface] network_interfaces: 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
+ except the last page.
+ """
+ self.first = first
+ self.limit = limit
+ self.network_interfaces = network_interfaces
+ self.next = next
+ self.total_count = total_count
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollection':
+ """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary."""
+ args = {}
+ if 'first' in _dict:
+ args['first'] = BareMetalServerNetworkInterfaceCollectionFirst.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')
+ else:
+ raise ValueError('Required property \'limit\' not present in BareMetalServerNetworkInterfaceCollection JSON')
+ if 'network_interfaces' in _dict:
+ args['network_interfaces'] = [BareMetalServerNetworkInterface.from_dict(x) for x in _dict.get('network_interfaces')]
+ else:
+ raise ValueError('Required property \'network_interfaces\' not present in BareMetalServerNetworkInterfaceCollection JSON')
+ if 'next' in _dict:
+ 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 BareMetalServerNetworkInterfaceCollection JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a BareMetalServerNetworkInterfaceCollection object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerNetworkInterfaceCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerNetworkInterfaceCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class BareMetalServerNetworkInterfaceCollectionFirst():
+ """
+ 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 BareMetalServerNetworkInterfaceCollectionFirst 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."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionFirst JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a BareMetalServerNetworkInterfaceCollectionFirst object from 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 BareMetalServerNetworkInterfaceCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerNetworkInterfaceCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class BareMetalServerNetworkInterfaceCollectionNext():
+ """
+ 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 BareMetalServerNetworkInterfaceCollectionNext object.
+
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceCollectionNext':
+ """Initialize a BareMetalServerNetworkInterfaceCollectionNext object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerNetworkInterfaceCollectionNext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a BareMetalServerNetworkInterfaceCollectionNext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerNetworkInterfaceCollectionNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class BareMetalServerNetworkInterfacePatch():
+ """
+ BareMetalServerNetworkInterfacePatch.
+
+ :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. A given VLAN can only be in
+ the `allowed_vlans` array for one PCI type adapter per bare metal server.
+ :attr bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :attr str name: (optional) The user-defined name for network interface. Names
+ must be unique within the instance the network interface resides in.
+ """
+
+ 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.
+
+ :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. A given VLAN
+ can only be in the `allowed_vlans` array for one PCI type adapter per bare
+ metal server.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :param str name: (optional) The user-defined name for network interface.
+ Names must be unique within the instance the network interface resides in.
+ """
+ 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."""
+ 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."""
+ 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
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerNetworkInterfacePatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerNetworkInterfacePatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class BareMetalServerNetworkInterfacePrototype():
+ """
+ BareMetalServerNetworkInterfacePrototype.
+
+ :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
+ allowed on this interface. If false, source IP spoofing is prevented on this
+ interface. If true, source IP spoofing is allowed on this interface.
+ :attr bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :attr str interface_type: The network 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.
+ - `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 str name: (optional) The user-defined name for network interface. Names
+ must be unique within the instance the network interface resides in. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :attr str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's subnet. If
+ unspecified, an available address on the subnet will be automatically selected.
+ :attr 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.
+ """
+
+ def __init__(self,
+ interface_type: str,
+ subnet: 'SubnetIdentity',
+ *,
+ allow_ip_spoofing: bool = None,
+ enable_infrastructure_nat: bool = None,
+ name: str = None,
+ primary_ipv4_address: str = None,
+ security_groups: List['SecurityGroupIdentity'] = None) -> None:
+ """
+ Initialize a BareMetalServerNetworkInterfacePrototype object.
+
+ :param str interface_type: The network 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.
+ - `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 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.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :param str name: (optional) The user-defined name for network interface.
+ Names must be unique within the instance the network interface resides in.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's
+ subnet. If unspecified, an available address on the subnet will be
+ automatically selected.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this network interface. If unspecified, the VPC's default
+ security group is used.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype', 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype']))
+ raise Exception(msg)
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototype':
+ """Initialize a BareMetalServerNetworkInterfacePrototype object from a json dictionary."""
+ disc_class = cls._get_class_by_discriminator(_dict)
+ if disc_class != cls:
+ return disc_class.from_dict(_dict)
+ msg = ("Cannot convert dictionary into an instance of base class 'BareMetalServerNetworkInterfacePrototype'. " +
+ "The discriminator value should map to a valid subclass: {1}").format(
+ ", ".join(['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['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 network 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.
+ - `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.
+ """
+ PCI = 'pci'
+ VLAN = 'vlan'
+
+
+class BareMetalServerPatch():
+ """
+ BareMetalServerPatch.
+
+ :attr str name: (optional) The user-defined name for this bare metal server (and
+ default system hostname).
+ """
+
+ def __init__(self,
+ *,
+ name: str = None) -> None:
+ """
+ Initialize a BareMetalServerPatch object.
+
+ :param str name: (optional) The user-defined name for this bare metal
+ server (and default system hostname).
+ """
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerPatch':
+ """Initialize a BareMetalServerPatch 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 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, '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 BareMetalServerPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class BareMetalServerPrimaryNetworkInterfacePrototype():
+ """
+ BareMetalServerPrimaryNetworkInterfacePrototype.
+
+ :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. A given VLAN can only be in
+ the `allowed_vlans` array for one PCI type adapter per bare metal server.
+ :attr bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :attr str interface_type: (optional) The network interface type:
+ - `pci`: a physical PCI device which can only be created or deleted when the
+ bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the pci interface
+ - Cannot directly use an IEEE 802.1q VLAN tag.
+ :attr str name: (optional) The user-defined name for network interface. Names
+ must be unique within the instance the network interface resides in. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :attr str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's subnet. If
+ unspecified, an available address on the subnet will be automatically selected.
+ :attr 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.
+ """
+
+ def __init__(self,
+ subnet: 'SubnetIdentity',
+ *,
+ allow_ip_spoofing: bool = None,
+ allowed_vlans: List[int] = None,
+ enable_infrastructure_nat: bool = None,
+ interface_type: str = None,
+ name: str = None,
+ primary_ipv4_address: str = None,
+ security_groups: List['SecurityGroupIdentity'] = None) -> None:
+ """
+ Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object.
+
+ :param SubnetIdentity subnet: The associated subnet.
+ :param bool allow_ip_spoofing: (optional) Indicates whether source IP
+ spoofing is allowed on this 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. A given VLAN
+ can only be in the `allowed_vlans` array for one PCI type adapter per bare
+ metal server.
+ :param bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :param str interface_type: (optional) The network interface type:
+ - `pci`: a physical PCI device which can only be created or deleted when
+ the bare metal
+ server is stopped
+ - Has an `allowed_vlans` property which controls the VLANs that will be
+ permitted
+ to use the pci interface
+ - Cannot directly use an IEEE 802.1q VLAN tag.
+ :param str name: (optional) The user-defined name for network interface.
+ Names must be unique within the instance the network interface resides in.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's
+ subnet. If unspecified, an available address on the subnet will be
+ automatically selected.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this network interface. If unspecified, the VPC's default
+ security group is used.
+ """
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.allowed_vlans = allowed_vlans
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.interface_type = interface_type
+ self.name = name
+ self.primary_ipv4_address = primary_ipv4_address
+ self.security_groups = security_groups
+ self.subnet = subnet
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerPrimaryNetworkInterfacePrototype':
+ """Initialize a BareMetalServerPrimaryNetworkInterfacePrototype object from a json dictionary."""
+ args = {}
+ if 'allow_ip_spoofing' 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_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ 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."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
+ _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
+ _dict['allowed_vlans'] = self.allowed_vlans
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for x in self.security_groups:
+ if isinstance(x, dict):
+ security_groups_list.append(x)
+ else:
+ security_groups_list.append(x.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerPrimaryNetworkInterfacePrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'BareMetalServerPrimaryNetworkInterfacePrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class InterfaceTypeEnum(str, Enum):
+ """
+ The network 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.
+ """
+ PCI = 'pci'
+
+
+class BareMetalServerProfile():
+ """
+ BareMetalServerProfile.
+
+ :attr BareMetalServerProfileBandwidth bandwidth:
+ :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 BareMetalServerProfileOSArchitecture os_architecture:
+ :attr str resource_type: The resource type.
+ :attr BareMetalServerProfileSupportedTrustedPlatformModuleModes
+ supported_trusted_platform_module_modes: The supported trusted platform module
+ (TPM) modes for this bare metal server profile.
+ """
+
+ def __init__(self,
+ bandwidth: 'BareMetalServerProfileBandwidth',
+ cpu_architecture: 'BareMetalServerProfileCPUArchitecture',
+ cpu_core_count: 'BareMetalServerProfileCPUCoreCount',
+ cpu_socket_count: 'BareMetalServerProfileCPUSocketCount',
+ disks: List['BareMetalServerProfileDisk'],
+ family: str,
+ href: str,
+ memory: 'BareMetalServerProfileMemory',
+ name: str,
+ os_architecture: 'BareMetalServerProfileOSArchitecture',
+ resource_type: str,
+ supported_trusted_platform_module_modes: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> None:
+ """
+ Initialize a BareMetalServerProfile object.
+
+ :param BareMetalServerProfileBandwidth bandwidth:
+ :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 BareMetalServerProfileOSArchitecture os_architecture:
+ :param str resource_type: The resource type.
+ :param BareMetalServerProfileSupportedTrustedPlatformModuleModes
+ supported_trusted_platform_module_modes: The supported trusted platform
+ module (TPM) modes for this bare metal server profile.
+ """
+ self.bandwidth = bandwidth
+ 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.memory = memory
+ self.name = name
+ 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) -> 'BareMetalServerProfile':
+ """Initialize a BareMetalServerProfile 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 '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')
+ else:
+ raise ValueError('Required property \'cpu_socket_count\' not present in BareMetalServerProfile JSON')
+ if 'disks' in _dict:
+ args['disks'] = [BareMetalServerProfileDisk.from_dict(x) for x in _dict.get('disks')]
+ else:
+ raise ValueError('Required property \'disks\' not present in BareMetalServerProfile JSON')
+ if 'family' in _dict:
+ args['family'] = _dict.get('family')
+ else:
+ 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 BareMetalServerProfile JSON')
+ if 'memory' in _dict:
+ args['memory'] = _dict.get('memory')
+ else:
+ 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 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 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 BareMetalServerProfile object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'bandwidth') and self.bandwidth is not None:
+ if isinstance(self.bandwidth, dict):
+ _dict['bandwidth'] = self.bandwidth
+ else:
+ _dict['bandwidth'] = self.bandwidth.to_dict()
+ if hasattr(self, 'cpu_architecture') and self.cpu_architecture is not None:
+ _dict['cpu_architecture'] = self.cpu_architecture.to_dict()
+ if 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:
+ _dict['disks'] = [x.to_dict() for x in self.disks]
+ 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, 'os_architecture') and self.os_architecture is not None:
+ _dict['os_architecture'] = self.os_architecture.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'supported_trusted_platform_module_modes') and self.supported_trusted_platform_module_modes is not None:
+ _dict['supported_trusted_platform_module_modes'] = self.supported_trusted_platform_module_modes.to_dict()
+ return _dict
+
+ def _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
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerProfileCPUArchitecture object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: '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 BareMetalServerProfileCPUCoreCount():
+ """
+ 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.
+
+ """
+
+ 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,
+ *,
+ next: 'BareMetalServerProfileCollectionNext' = None) -> None:
+ """
+ Initialize a BareMetalServerProfileCollection object.
+
+ :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.first = first
+ self.limit = limit
+ self.next = next
+ self.profiles = profiles
+ self.total_count = total_count
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCollection':
+ """Initialize a BareMetalServerProfileCollection object from a json dictionary."""
+ args = {}
+ 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(x) for x 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 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, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ _dict['profiles'] = [x.to_dict() for x in self.profiles]
+ 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 BareMetalServerProfileCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerProfileCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class BareMetalServerProfileCollectionFirst():
+ """
+ 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 BareMetalServerProfileCollectionFirst 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."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionFirst JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 BareMetalServerProfileCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerProfileCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class BareMetalServerProfileCollectionNext():
+ """
+ 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 BareMetalServerProfileCollectionNext 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."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in BareMetalServerProfileCollectionNext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 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 BareMetalServerProfileDisk():
+ """
+ Disks provided by this profile.
+
+ :attr BareMetalServerProfileDiskQuantity quantity:
+ :attr BareMetalServerProfileDiskSize size:
+ :attr BareMetalServerProfileDiskSupportedInterfaces supported_interface_types:
+ """
+
+ def __init__(self,
+ quantity: 'BareMetalServerProfileDiskQuantity',
+ size: 'BareMetalServerProfileDiskSize',
+ supported_interface_types: 'BareMetalServerProfileDiskSupportedInterfaces') -> None:
+ """
+ Initialize a BareMetalServerProfileDisk object.
+
+ :param BareMetalServerProfileDiskQuantity quantity:
+ :param BareMetalServerProfileDiskSize size:
+ :param BareMetalServerProfileDiskSupportedInterfaces
+ supported_interface_types:
+ """
+ self.quantity = quantity
+ self.size = size
+ self.supported_interface_types = supported_interface_types
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDisk':
+ """Initialize a BareMetalServerProfileDisk object from a json dictionary."""
+ args = {}
+ 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 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, '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:
+ _dict['supported_interface_types'] = self.supported_interface_types.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 BareMetalServerProfileDisk object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerProfileDisk') -> 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():
+ """
+ BareMetalServerProfileDiskSupportedInterfaces.
+
+ :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,
+ default: str,
+ type: str,
+ values: List[str]) -> None:
+ """
+ Initialize a BareMetalServerProfileDiskSupportedInterfaces 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.
+ """
+ self.default = default
+ self.type = type
+ self.values = values
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSupportedInterfaces':
+ """Initialize a BareMetalServerProfileDiskSupportedInterfaces 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')
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSupportedInterfaces JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 BareMetalServerProfileDiskSupportedInterfaces object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'BareMetalServerProfileDiskSupportedInterfaces') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class DefaultEnum(str, Enum):
+ """
+ The 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'
+ 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.
+ 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'
+ 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.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['BareMetalServerProfileMemoryFixed', 'BareMetalServerProfileMemoryRange', 'BareMetalServerProfileMemoryEnum', 'BareMetalServerProfileMemoryDependent']))
+ 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) -> 'BareMetalServerProfileOSArchitecture':
+ """Initialize a BareMetalServerProfileOSArchitecture 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')
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileOSArchitecture JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 BareMetalServerProfileOSArchitecture object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerProfileOSArchitecture') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ ENUM = 'enum'
+
+
+class BareMetalServerProfileReference():
+ """
+ BareMetalServerProfileReference.
+
+ :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,
+ name: str,
+ resource_type: str) -> None:
+ """
+ Initialize a BareMetalServerProfileReference 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.
+ """
+ self.href = href
+ self.name = name
+ self.resource_type = resource_type
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileReference':
+ """Initialize a BareMetalServerProfileReference 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')
+ else:
+ 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 BareMetalServerProfileReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 BareMetalServerProfileReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerProfileReference') -> 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 BareMetalServerProfileSupportedTrustedPlatformModuleModes():
+ """
+ The supported trusted platform module (TPM) modes for this bare metal server profile.
+
+ :attr str type: The type for this profile field.
+ :attr List[str] values: The supported trusted platform module (TPM) modes.
+ """
+
+ def __init__(self,
+ type: str,
+ values: List[str]) -> None:
+ """
+ Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes object.
+
+ :param str type: The type for this profile field.
+ :param List[str] values: The supported trusted platform module (TPM) modes.
+ """
+ self.type = type
+ self.values = values
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileSupportedTrustedPlatformModuleModes':
+ """Initialize a BareMetalServerProfileSupportedTrustedPlatformModuleModes 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')
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileSupportedTrustedPlatformModuleModes JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 BareMetalServerProfileSupportedTrustedPlatformModuleModes object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerProfileSupportedTrustedPlatformModuleModes') -> 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):
+ """
+ The mode for the trusted platform module (TPM):
+ - `tpm_2`: Standard TPM 2 capabilities
+ - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT)
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ """
+ TPM_2 = 'tpm_2'
+ TPM_2_WITH_TXT = 'tpm_2_with_txt'
+
+
+class BareMetalServerStatusReason():
+ """
+ BareMetalServerStatusReason.
+
+ :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.
+
+ :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()
+
+ 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__
+
+ 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.
+ """
+ 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():
+ """
+ BareMetalServerTrustedPlatformModule.
+
+ :attr bool enabled: Indicates whether the trusted platform module (TPM) is
+ enabled. If enabled, `mode` will also be set.
+ :attr str mode: (optional) The mode for the trusted platform module (TPM):
+ - `tpm_2`: Standard TPM 2 capabilities
+ - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT)
+ 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 __init__(self,
+ enabled: bool,
+ *,
+ mode: str = None) -> None:
+ """
+ Initialize a BareMetalServerTrustedPlatformModule object.
+
+ :param bool enabled: Indicates whether the trusted platform module (TPM) is
+ enabled. If enabled, `mode` will also be set.
+ :param str mode: (optional) The mode for the trusted platform module (TPM):
+ - `tpm_2`: Standard TPM 2 capabilities
+ - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology
+ (TXT)
+ 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.
+ """
+ self.enabled = enabled
+ self.mode = mode
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerTrustedPlatformModule':
+ """Initialize a BareMetalServerTrustedPlatformModule 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')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerTrustedPlatformModule object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerTrustedPlatformModule') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ModeEnum(str, Enum):
+ """
+ The mode for the trusted platform module (TPM):
+ - `tpm_2`: Standard TPM 2 capabilities
+ - `tpm_2_with_txt`: Standard TPM 2 with Intel Trusted Execution Technology (TXT)
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the resource on which the unexpected
+ property value was encountered.
+ """
+ TPM_2 = 'tpm_2'
+ TPM_2_WITH_TXT = 'tpm_2_with_txt'
+
+
+class CertificateInstanceIdentity():
+ """
+ Identifies a certificate instance by a unique property.
+
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a CertificateInstanceIdentity object.
+
+ """
+ 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) -> 'CertificateInstanceReference':
+ """Initialize a CertificateInstanceReference object from a json dictionary."""
+ args = {}
+ if 'crn' in _dict:
+ args['crn'] = _dict.get('crn')
+ else:
+ 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(['CloudObjectStorageBucketIdentityByName']))
+ raise Exception(msg)
+
+class CloudObjectStorageBucketReference():
+ """
+ CloudObjectStorageBucketReference.
+
+ :attr str name: The globally unique name of this COS bucket.
+ """
+
+ def __init__(self,
+ name: str) -> None:
+ """
+ Initialize a CloudObjectStorageBucketReference object.
+
+ :param str name: The globally unique name of this COS bucket.
+ """
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'CloudObjectStorageBucketReference':
+ """Initialize a CloudObjectStorageBucketReference object from a json dictionary."""
+ args = {}
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ else:
+ raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a CloudObjectStorageBucketReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this CloudObjectStorageBucketReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'CloudObjectStorageBucketReference') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'CloudObjectStorageBucketReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHost():
+ """
+ DedicatedHost.
+
+ :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 unique user-defined name for this dedicated host.
+ :attr DedicatedHostProfileReference profile: The profile this dedicated host
+ uses.
+ :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 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,
+ instance_placement_enabled: bool,
+ instances: List['InstanceReference'],
+ 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') -> None:
+ """
+ Initialize a DedicatedHost 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
+ 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 unique user-defined name for this dedicated host.
+ :param DedicatedHostProfileReference profile: The profile this dedicated
+ host uses.
+ :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.
+ """
+ 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.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.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) -> '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 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(x) for x 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 DedicatedHost 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(x) for x 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 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 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')
+ else:
+ raise ValueError('Required property \'state\' not present in DedicatedHost JSON')
+ if 'supported_instance_profiles' in _dict:
+ args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(x) for x in _dict.get('supported_instance_profiles')]
+ 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 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:
+ _dict['available_vcpu'] = self.available_vcpu.to_dict()
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'disks') and self.disks is not None:
+ _dict['disks'] = [x.to_dict() for x in self.disks]
+ if hasattr(self, 'group') and self.group is not None:
+ _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, 'instance_placement_enabled') and self.instance_placement_enabled is not None:
+ _dict['instance_placement_enabled'] = self.instance_placement_enabled
+ if hasattr(self, 'instances') and self.instances is not None:
+ _dict['instances'] = [x.to_dict() for x in self.instances]
+ 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:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'provisionable') and self.provisionable is not None:
+ _dict['provisionable'] = self.provisionable
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if 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:
+ _dict['supported_instance_profiles'] = [x.to_dict() for x in self.supported_instance_profiles]
+ if hasattr(self, 'vcpu') and self.vcpu is not None:
+ _dict['vcpu'] = self.vcpu.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ _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 DedicatedHost object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHost') -> 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 dedicated host.
+ """
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ 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'
+
+
+class DedicatedHostCollection():
+ """
+ DedicatedHostCollection.
+
+ :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,
+ dedicated_hosts: List['DedicatedHost'],
+ first: 'DedicatedHostCollectionFirst',
+ limit: int,
+ total_count: int,
+ *,
+ next: 'DedicatedHostCollectionNext' = None) -> None:
+ """
+ Initialize a DedicatedHostCollection object.
+
+ :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.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) -> 'DedicatedHostCollection':
+ """Initialize a DedicatedHostCollection object from a json dictionary."""
+ args = {}
+ if 'dedicated_hosts' in _dict:
+ args['dedicated_hosts'] = [DedicatedHost.from_dict(x) for x in _dict.get('dedicated_hosts')]
+ else:
+ 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 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, 'dedicated_hosts') and self.dedicated_hosts is not None:
+ _dict['dedicated_hosts'] = [x.to_dict() for x in self.dedicated_hosts]
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostCollectionFirst():
+ """
+ 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 DedicatedHostCollectionFirst object.
+
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionFirst':
+ """Initialize a DedicatedHostCollectionFirst object from a json dictionary."""
+ args = {}
+ if 'href' 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 DedicatedHostCollectionFirst object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'DedicatedHostCollectionFirst') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'DedicatedHostCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostCollectionNext():
+ """
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
+
+ :attr str href: The URL for a page of resources.
+ """
+
+ def __init__(self,
+ href: str) -> None:
+ """
+ Initialize a DedicatedHostCollectionNext object.
+
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostCollectionNext':
+ """Initialize a DedicatedHostCollectionNext object from a json dictionary."""
+ args = {}
+ if 'href' 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 user-defined or system-provided name for this disk.
+ :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 user-defined or system-provided name for this disk.
+ :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."""
+ 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(x) for x 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 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, '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:
+ _dict['instance_disks'] = [x.to_dict() for x in self.instance_disks]
+ 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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostDisk object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: '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 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():
+ """
+ DedicatedHostDiskCollection.
+
+ :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks.
+ """
+
+ def __init__(self,
+ disks: List['DedicatedHostDisk']) -> None:
+ """
+ Initialize a DedicatedHostDiskCollection object.
+
+ :param List[DedicatedHostDisk] disks: Collection of the dedicated host's
+ disks.
+ """
+ self.disks = disks
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskCollection':
+ """Initialize a DedicatedHostDiskCollection object from a json dictionary."""
+ args = {}
+ if 'disks' in _dict:
+ args['disks'] = [DedicatedHostDisk.from_dict(x) for x in _dict.get('disks')]
+ else:
+ raise ValueError('Required property \'disks\' not present in DedicatedHostDiskCollection JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'disks') and self.disks is not None:
+ _dict['disks'] = [x.to_dict() for x in self.disks]
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostDiskCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostDiskCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostDiskPatch():
+ """
+ DedicatedHostDiskPatch.
+
+ :attr str name: (optional) The user-defined name for this disk.
+ """
+
+ def __init__(self,
+ *,
+ name: str = None) -> None:
+ """
+ Initialize a DedicatedHostDiskPatch object.
+
+ :param str name: (optional) The user-defined name for this disk.
+ """
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskPatch':
+ """Initialize a DedicatedHostDiskPatch 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 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, '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 DedicatedHostDiskPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostDiskPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostGroup():
+ """
+ DedicatedHostGroup.
+
+ :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 unique user-defined name for this dedicated host group.
+ :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.
+ """
+
+ def __init__(self,
+ class_: 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'],
+ zone: 'ZoneReference') -> None:
+ """
+ Initialize a DedicatedHostGroup 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 unique user-defined name for this dedicated host
+ group.
+ :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.
+ """
+ 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) -> '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(x) for x 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(x) for x 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):
+ """Initialize a DedicatedHostGroup object from 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, '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:
+ _dict['dedicated_hosts'] = [x.to_dict() for x in self.dedicated_hosts]
+ 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:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None:
+ _dict['supported_instance_profiles'] = [x.to_dict() for x in self.supported_instance_profiles]
+ if hasattr(self, 'zone') and self.zone is not None:
+ _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 DedicatedHostGroup object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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 FamilyEnum(str, Enum):
+ """
+ The dedicated host profile family for hosts in this group.
+ """
+ BALANCED = 'balanced'
+ COMPUTE = 'compute'
+ MEMORY = 'memory'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ DEDICATED_HOST_GROUP = 'dedicated_host_group'
+
+
+class DedicatedHostGroupCollection():
+ """
+ DedicatedHostGroupCollection.
+
+ :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 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: 'DedicatedHostGroupCollectionFirst',
+ groups: List['DedicatedHostGroup'],
+ limit: int,
+ total_count: int,
+ *,
+ next: 'DedicatedHostGroupCollectionNext' = None) -> None:
+ """
+ Initialize a DedicatedHostGroupCollection object.
+
+ :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 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
+ except the last page.
+ """
+ self.first = first
+ self.groups = groups
+ 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."""
+ args = {}
+ if 'first' in _dict:
+ args['first'] = DedicatedHostGroupCollectionFirst.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(x) for x in _dict.get('groups')]
+ else:
+ raise ValueError('Required property \'groups\' not present in DedicatedHostGroupCollection JSON')
+ if 'limit' in _dict:
+ args['limit'] = _dict.get('limit')
+ else:
+ raise ValueError('Required property \'limit\' not present in DedicatedHostGroupCollection JSON')
+ if 'next' in _dict:
+ 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 DedicatedHostGroupCollection JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a DedicatedHostGroupCollection object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'groups') and self.groups is not None:
+ _dict['groups'] = [x.to_dict() for x in self.groups]
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostGroupCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostGroupCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostGroupCollectionFirst():
+ """
+ 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 DedicatedHostGroupCollectionFirst object.
+
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionFirst':
+ """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionFirst JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostGroupCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostGroupCollectionNext():
+ """
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
+
+ :attr str href: The URL for a page of resources.
+ """
+
+ def __init__(self,
+ href: str) -> None:
+ """
+ Initialize a DedicatedHostGroupCollectionNext object.
+
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionNext':
+ """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionNext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a DedicatedHostGroupCollectionNext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostGroupCollectionNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'DedicatedHostGroupCollectionNext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'DedicatedHostGroupCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostGroupIdentity():
+ """
+ Identifies a dedicated host group by a unique property.
+
+ """
+
+ 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 unique user-defined name for this dedicated host
+ group.
+ """
+
+ def __init__(self,
+ *,
+ name: str = None) -> None:
+ """
+ Initialize a DedicatedHostGroupPatch object.
+
+ :param str name: (optional) The unique user-defined name for this dedicated
+ host group.
+ """
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupPatch':
+ """Initialize a DedicatedHostGroupPatch 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 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, '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 DedicatedHostGroupPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostGroupPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostGroupPrototypeDedicatedHostByZoneContext():
+ """
+ DedicatedHostGroupPrototypeDedicatedHostByZoneContext.
+
+ :attr str name: (optional) The unique user-defined name for this dedicated host
+ group.
+ :attr ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the host's resource group is used.
+ """
+
+ def __init__(self,
+ *,
+ name: str = None,
+ resource_group: 'ResourceGroupIdentity' = None) -> None:
+ """
+ Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object.
+
+ :param str name: (optional) The unique user-defined name for this dedicated
+ host group.
+ :param ResourceGroupIdentity resource_group: (optional) The resource group
+ to use. If unspecified, the host's resource group is used.
+ """
+ self.name = name
+ self.resource_group = resource_group
+
+ @classmethod
+ 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):
+ """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object from 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()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ 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 DedicatedHostGroupReference():
+ """
+ DedicatedHostGroupReference.
+
+ :attr str crn: The CRN for this dedicated host group.
+ :attr DedicatedHostGroupReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ some supplementary information.
+ :attr str href: The URL for this dedicated host group.
+ :attr str id: The unique identifier for this dedicated host group.
+ :attr str name: The unique user-defined name for this dedicated host group.
+ :attr str resource_type: The resource type.
+ """
+
+ def __init__(self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: 'DedicatedHostGroupReferenceDeleted' = None) -> None:
+ """
+ Initialize a DedicatedHostGroupReference 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 unique user-defined name for this dedicated host
+ group.
+ :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.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) -> 'DedicatedHostGroupReference':
+ """Initialize a DedicatedHostGroupReference object from a json dictionary."""
+ args = {}
+ 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')
+ 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 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, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this 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):
+ """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__
+
+ def __ne__(self, other: 'DedicatedHostGroupReferenceDeleted') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostPatch():
+ """
+ DedicatedHostPatch.
+
+ :attr bool instance_placement_enabled: (optional) If set to true, instances can
+ be placed on this dedicated host.
+ :attr str name: (optional) The unique user-defined name for this dedicated host.
+ """
+
+ def __init__(self,
+ *,
+ instance_placement_enabled: bool = None,
+ name: str = None) -> None:
+ """
+ Initialize a DedicatedHostPatch object.
+
+ :param bool instance_placement_enabled: (optional) If set to true,
+ instances can be placed on this dedicated host.
+ :param str name: (optional) The unique user-defined name for this dedicated
+ host.
+ """
+ self.instance_placement_enabled = instance_placement_enabled
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostPatch':
+ """Initialize a DedicatedHostPatch 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')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostProfile():
+ """
+ DedicatedHostProfile.
+
+ :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:
+ """
+
+ 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') -> None:
+ """
+ Initialize a DedicatedHostProfile 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:
+ """
+ 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
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfile':
+ """Initialize a DedicatedHostProfile 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(x) for x 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(x) for x 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')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'class_') and self.class_ is not None:
+ _dict['class'] = self.class_
+ if hasattr(self, 'disks') and self.disks is not None:
+ _dict['disks'] = [x.to_dict() for x in self.disks]
+ 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:
+ _dict['supported_instance_profiles'] = [x.to_dict() for x in self.supported_instance_profiles]
+ if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None:
+ _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()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostProfile object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostProfile') -> 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():
+ """
+ DedicatedHostProfileCollection.
+
+ :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.
+ """
+
+ def __init__(self,
+ first: 'DedicatedHostProfileCollectionFirst',
+ limit: int,
+ profiles: List['DedicatedHostProfile'],
+ total_count: int,
+ *,
+ next: 'DedicatedHostProfileCollectionNext' = None) -> None:
+ """
+ Initialize a DedicatedHostProfileCollection 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.
+ """
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.profiles = profiles
+ self.total_count = total_count
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollection':
+ """Initialize a DedicatedHostProfileCollection 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(x) for x 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')
+ else:
+ raise ValueError('Required property \'total_count\' not present in DedicatedHostProfileCollection JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a DedicatedHostProfileCollection object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ _dict['profiles'] = [x.to_dict() for x in self.profiles]
+ 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 DedicatedHostProfileCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostProfileCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostProfileCollectionFirst():
+ """
+ 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 DedicatedHostProfileCollectionFirst object.
+
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionFirst':
+ """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionFirst JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostProfileCollectionFirst object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'DedicatedHostProfileCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostProfileCollectionNext():
+ """
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
+
+ :attr str href: The URL for a page of resources.
+ """
+
+ def __init__(self,
+ href: str) -> None:
+ """
+ Initialize a DedicatedHostProfileCollectionNext object.
+
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionNext':
+ """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionNext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostProfileCollectionNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'DedicatedHostProfileCollectionNext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'DedicatedHostProfileCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostProfileDisk():
+ """
+ Disks provided by this profile.
+
+ :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,
+ interface_type: 'DedicatedHostProfileDiskInterface',
+ quantity: 'DedicatedHostProfileDiskQuantity',
+ size: 'DedicatedHostProfileDiskSize',
+ supported_instance_interface_types: 'DedicatedHostProfileDiskSupportedInterfaces') -> None:
+ """
+ Initialize a DedicatedHostProfileDisk 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:
+ """
+ self.interface_type = interface_type
+ self.quantity = quantity
+ self.size = size
+ self.supported_instance_interface_types = supported_instance_interface_types
+
+ @classmethod
+ 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'] = DedicatedHostProfileDiskQuantity.from_dict(_dict.get('quantity'))
+ else:
+ raise ValueError('Required property \'quantity\' not present in DedicatedHostProfileDisk JSON')
+ if 'size' in _dict:
+ args['size'] = DedicatedHostProfileDiskSize.from_dict(_dict.get('size'))
+ 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'))
+ else:
+ raise ValueError('Required property \'supported_instance_interface_types\' not present in DedicatedHostProfileDisk JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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:
+ _dict['interface_type'] = self.interface_type.to_dict()
+ if hasattr(self, 'quantity') and self.quantity is not None:
+ _dict['quantity'] = self.quantity.to_dict()
+ if hasattr(self, 'size') and self.size is not None:
+ _dict['size'] = self.size.to_dict()
+ if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None:
+ _dict['supported_instance_interface_types'] = self.supported_instance_interface_types.to_dict()
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostProfileDisk object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostProfileDisk') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostProfileDiskInterface():
+ """
+ DedicatedHostProfileDiskInterface.
+
+ :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.
+ """
+
+ def __init__(self,
+ type: str,
+ value: str) -> None:
+ """
+ Initialize a DedicatedHostProfileDiskInterface 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.
+ """
+ self.type = type
+ self.value = value
+
+ @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')
+ else:
+ raise ValueError('Required property \'type\' not present in DedicatedHostProfileDiskInterface JSON')
+ if 'value' in _dict:
+ args['value'] = _dict.get('value')
+ else:
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskInterface JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 DedicatedHostProfileDiskInterface object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: '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.
+ """
+ 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():
+ """
+ The number of disks of this type 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.
+ """
+
+ def __init__(self,
+ type: str,
+ value: int) -> None:
+ """
+ Initialize a DedicatedHostProfileDiskQuantity object.
+
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
+ """
+ self.type = type
+ self.value = value
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskQuantity':
+ """Initialize a DedicatedHostProfileDiskQuantity 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')
+ else:
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskQuantity JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 DedicatedHostProfileDiskQuantity object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostProfileDiskQuantity') -> 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():
+ """
+ The size of the disk in GB (gigabytes).
+
+ :attr str type: The type for this profile field.
+ :attr int value: The size of the disk in GB (gigabytes).
+ """
+
+ def __init__(self,
+ type: str,
+ value: int) -> None:
+ """
+ Initialize a DedicatedHostProfileDiskSize object.
+
+ :param str type: The type for this profile field.
+ :param int value: The size of the disk in GB (gigabytes).
+ """
+ self.type = type
+ self.value = value
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSize':
+ """Initialize a DedicatedHostProfileDiskSize 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')
+ else:
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSize JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 DedicatedHostProfileDiskSize object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostProfileDiskSize') -> 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():
+ """
+ DedicatedHostProfileDiskSupportedInterfaces.
+
+ :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.
+ """
+
+ def __init__(self,
+ type: str,
+ value: List[str]) -> None:
+ """
+ Initialize a DedicatedHostProfileDiskSupportedInterfaces 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.
+ """
+ self.type = type
+ self.value = value
+
+ @classmethod
+ 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 DedicatedHostProfileDiskSupportedInterfaces JSON')
+ if 'value' in _dict:
+ args['value'] = _dict.get('value')
+ else:
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from 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 DedicatedHostProfileDiskSupportedInterfaces object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostProfileDiskSupportedInterfaces') -> 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 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 DedicatedHostProfileIdentity():
+ """
+ Identifies a dedicated host profile by a unique property.
+
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a DedicatedHostProfileIdentity object.
+
+ """
+ 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.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['DedicatedHostProfileMemoryFixed', 'DedicatedHostProfileMemoryRange', 'DedicatedHostProfileMemoryEnum', 'DedicatedHostProfileMemoryDependent']))
+ raise Exception(msg)
+
+class DedicatedHostProfileReference():
+ """
+ DedicatedHostProfileReference.
+
+ :attr str href: The URL for this dedicated host.
+ :attr str name: The globally unique name for this dedicated host profile.
+ """
+
+ def __init__(self,
+ href: str,
+ name: str) -> None:
+ """
+ Initialize a DedicatedHostProfileReference object.
+
+ :param str href: The URL for this dedicated host.
+ :param str name: The globally unique name for this dedicated host profile.
+ """
+ self.href = href
+ self.name = name
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileReference':
+ """Initialize a DedicatedHostProfileReference object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in DedicatedHostProfileReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ else:
+ raise ValueError('Required property \'name\' not present in DedicatedHostProfileReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostProfileReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostProfileReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DedicatedHostProfileSocket():
+ """
+ DedicatedHostProfileSocket.
+
+ """
+
+ def __init__(self) -> None:
+ """
+ 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)
+
+class DedicatedHostProfileVCPU():
+ """
+ DedicatedHostProfileVCPU.
+
+ """
+
+ 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():
+ """
+ DedicatedHostProfileVCPUArchitecture.
+
+ :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,
+ type: str,
+ value: str) -> None:
+ """
+ Initialize a DedicatedHostProfileVCPUArchitecture object.
+
+ :param str type: The type for this profile field.
+ :param str value: The VCPU architecture for a dedicated host with this
+ profile.
+ """
+ self.type = type
+ self.value = value
+
+ @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')
+ else:
+ raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUArchitecture JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 DedicatedHostProfileVCPUArchitecture object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostProfileVCPUArchitecture') -> 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 DedicatedHostPrototype():
+ """
+ DedicatedHostPrototype.
+
+ :attr bool instance_placement_enabled: (optional) If set to true, instances can
+ be placed on this dedicated host.
+ :attr str name: (optional) The unique user-defined name for this dedicated host.
+ If unspecified, the name will be a hyphenated list of randomly-selected words.
+ :attr DedicatedHostProfileIdentity profile: The profile 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 DedicatedHostPrototype object.
+
+ :param DedicatedHostProfileIdentity profile: The profile 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 unique user-defined name for this dedicated
+ host. 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(['DedicatedHostPrototypeDedicatedHostByGroup', 'DedicatedHostPrototypeDedicatedHostByZone']))
+ raise Exception(msg)
+
+class DedicatedHostReference():
+ """
+ DedicatedHostReference.
+
+ :attr str crn: The CRN for this dedicated host.
+ :attr DedicatedHostReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ some supplementary information.
+ :attr str href: The URL for this dedicated host.
+ :attr str id: The unique identifier for this dedicated host.
+ :attr str name: The unique user-defined name for this dedicated host.
+ :attr str 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 DedicatedHostReference 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 unique user-defined name for this dedicated host.
+ :param str resource_type: The resource type.
+ :param DedicatedHostReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ 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) -> '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 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 DedicatedHostReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DedicatedHostReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostReference') -> 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():
+ """
+ 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 DedicatedHostReferenceDeleted object.
+
+ :param str more_info: Link to documentation about deleted resources.
+ """
+ self.more_info = more_info
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'DedicatedHostReferenceDeleted':
+ """Initialize a DedicatedHostReferenceDeleted 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 DedicatedHostReferenceDeleted JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 DedicatedHostReferenceDeleted object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DedicatedHostReferenceDeleted') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DefaultNetworkACL():
+ """
+ DefaultNetworkACL.
+
+ :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
+ user-specified with a subsequent request.
+ :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 is a part of.
+ """
+
+ 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.
+
+ :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 user-specified with a subsequent request.
+ :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 is a part of.
+ """
+ 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."""
+ 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(x) for x in _dict.get('rules')]
+ else:
+ raise ValueError('Required property \'rules\' not present in DefaultNetworkACL JSON')
+ if 'subnets' in _dict:
+ args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
+ 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 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:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'rules') and self.rules is not None:
+ _dict['rules'] = [x.to_dict() for x in self.rules]
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ _dict['subnets'] = [x.to_dict() for x in self.subnets]
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ _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 DefaultNetworkACL object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DefaultNetworkACL') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class DefaultRoutingTable():
+ """
+ DefaultRoutingTable.
+
+ :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 user-specified with a subsequent request.
+ :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 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.
+ :attr bool route_transit_gateway_ingress: Indicates whether this routing table
+ is used to route traffic that originates from from [Transit
+ Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address within the VPC's address prefix ranges. Therefore,
+ if an incoming packet matches a route with a `next_hop` of an internet-bound IP
+ address or a VPN gateway connection, the packet will be dropped.
+ :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used
+ to route traffic that originates from subnets in other zones in this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address within the VPC's address prefix ranges. Therefore,
+ if an incoming packet matches a route with a `next_hop` of an internet-bound IP
+ address or a VPN gateway connection, the packet will be dropped.
+ :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,
+ created_at: datetime,
+ href: str,
+ id: str,
+ is_default: bool,
+ lifecycle_state: str,
+ name: str,
+ resource_type: str,
+ route_direct_link_ingress: bool,
+ route_transit_gateway_ingress: bool,
+ route_vpc_zone_ingress: bool,
+ routes: List['RouteReference'],
+ subnets: List['SubnetReference']) -> None:
+ """
+ Initialize a DefaultRoutingTable object.
+
+ :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 user-specified with a subsequent request.
+ :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 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.
+ :param bool route_transit_gateway_ingress: Indicates whether this routing
+ table is used to route traffic that originates from from [Transit
+ Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address within the VPC's address prefix
+ ranges. Therefore, if an incoming packet matches a route with a `next_hop`
+ of an internet-bound IP address or a VPN gateway connection, the packet
+ will be dropped.
+ :param bool route_vpc_zone_ingress: Indicates whether this routing table is
+ used to route traffic that originates from subnets in other zones in this
+ VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address within the VPC's address prefix
+ ranges. Therefore, if an incoming packet matches a route with a `next_hop`
+ of an internet-bound IP address or a VPN gateway connection, the packet
+ will be dropped.
+ :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.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_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) -> 'DefaultRoutingTable':
+ """Initialize a DefaultRoutingTable 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 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 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_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(x) for x in _dict.get('routes')]
+ else:
+ raise ValueError('Required property \'routes\' not present in DefaultRoutingTable JSON')
+ if 'subnets' in _dict:
+ args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
+ else:
+ raise ValueError('Required property \'subnets\' not present in DefaultRoutingTable JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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_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:
+ _dict['routes'] = [x.to_dict() for x in self.routes]
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ _dict['subnets'] = [x.to_dict() for x in self.subnets]
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this DefaultRoutingTable object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: '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.
+ """
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
-##############################################################################
-# Models
-##############################################################################
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ ROUTING_TABLE = 'routing_table'
-class AddressPrefix():
+class DefaultSecurityGroup():
"""
- AddressPrefix.
+ DefaultSecurityGroup.
- :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 updated with a user-specified name.
- :attr str name: The user-defined name for this address prefix. Names must be
- unique within the VPC the address prefix resides in.
- :attr ZoneReference zone: The zone this address prefix resides in.
+ :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 of the default security group created for a VPC. The
+ name will be a hyphenated list of randomly-selected words at creation, but may
+ be user-specified with a subsequent request.
+ :attr 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 VPCReference vpc: The VPC this security group is a part of.
"""
def __init__(self,
- cidr: str,
created_at: datetime,
- has_subnets: bool,
+ crn: str,
href: str,
id: str,
- is_default: bool,
name: str,
- zone: 'ZoneReference') -> None:
+ resource_group: 'ResourceGroupReference',
+ rules: List['SecurityGroupRule'],
+ vpc: 'VPCReference') -> None:
"""
- Initialize a AddressPrefix object.
+ Initialize a DefaultSecurityGroup 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 updated with a user-specified
- name.
- :param str name: The user-defined name for this address prefix. Names must
- be unique within the VPC the address prefix resides in.
- :param ZoneReference zone: The zone this address prefix resides in.
+ :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 of the default security group created for a VPC.
+ The name will be a hyphenated list of randomly-selected words at creation,
+ but may be user-specified with a subsequent request.
+ :param 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 VPCReference vpc: The VPC this security group is a part of.
"""
- self.cidr = cidr
self.created_at = created_at
- self.has_subnets = has_subnets
+ self.crn = crn
self.href = href
self.id = id
- self.is_default = is_default
self.name = name
- self.zone = zone
+ self.resource_group = resource_group
+ self.rules = rules
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'AddressPrefix':
- """Initialize a AddressPrefix object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'DefaultSecurityGroup':
+ """Initialize a DefaultSecurityGroup object from a json dictionary."""
args = {}
- if 'cidr' in _dict:
- args['cidr'] = _dict.get('cidr')
+ if 'created_at' in _dict:
+ args['created_at'] = string_to_datetime(_dict.get('created_at'))
else:
- raise ValueError('Required property \'cidr\' not present in AddressPrefix JSON')
+ 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 '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(x) for x in _dict.get('rules')]
+ else:
+ raise ValueError('Required property \'rules\' 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 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:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'rules') and self.rules is not None:
+ _dict['rules'] = [x.to_dict() for x in self.rules]
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ _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 DefaultSecurityGroup object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'DefaultSecurityGroup') -> 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:
+ """
+ Initialize a EncryptionKeyIdentity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['EncryptionKeyIdentityByCRN']))
+ raise Exception(msg)
+
+class EncryptionKeyReference():
+ """
+ EncryptionKeyReference.
+
+ :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 Service Root
+ Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for this
+ resource.
+ """
+
+ def __init__(self,
+ crn: str) -> None:
+ """
+ Initialize a EncryptionKeyReference 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 Service Root
+ Key](https://cloud.ibm.com/docs/hs-crypto?topic=hs-crypto-get-started) for
+ this resource.
+ """
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'EncryptionKeyReference':
+ """Initialize a EncryptionKeyReference object from a json dictionary."""
+ args = {}
+ if 'crn' in _dict:
+ args['crn'] = _dict.get('crn')
+ else:
+ raise ValueError('Required property \'crn\' not present in EncryptionKeyReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 EncryptionKeyReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'EncryptionKeyReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class EndpointGateway():
+ """
+ EndpointGateway.
+
+ :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 unique user-defined name for this endpoint gateway.
+ :attr ResourceGroupReference resource_group: The resource group for this
+ endpoint gateway.
+ :attr str resource_type: The resource type.
+ :attr List[SecurityGroupReference] security_groups: The security groups
+ targeting this endpoint gateway.
+ :attr str service_endpoint: (optional) The fully qualified domain name for the
+ target service.
+ :attr List[str] service_endpoints: The fully qualified domain names for the
+ target service.
+ :attr EndpointGatewayTarget target: The target for this endpoint gateway.
+ :attr VPCReference vpc: The VPC this endpoint gateway is serving.
+ """
+
+ def __init__(self,
+ created_at: datetime,
+ crn: str,
+ health_state: str,
+ 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',
+ *,
+ service_endpoint: str = None) -> None:
+ """
+ Initialize a EndpointGateway 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 unique user-defined name for this endpoint gateway.
+ :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 is serving.
+ :param str service_endpoint: (optional) The fully qualified domain name for
+ the target service.
+ """
+ self.created_at = created_at
+ self.crn = crn
+ self.health_state = health_state
+ self.href = href
+ self.id = id
+ self.ips = ips
+ self.lifecycle_state = lifecycle_state
+ self.name = name
+ 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
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'EndpointGateway':
+ """Initialize a EndpointGateway 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 AddressPrefix JSON')
- if 'has_subnets' in _dict:
- args['has_subnets'] = _dict.get('has_subnets')
+ 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 \'has_subnets\' not present in AddressPrefix JSON')
+ 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 \'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 AddressPrefix 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 AddressPrefix JSON')
- if 'is_default' in _dict:
- args['is_default'] = _dict.get('is_default')
+ raise ValueError('Required property \'id\' not present in EndpointGateway JSON')
+ if 'ips' in _dict:
+ args['ips'] = [ReservedIPReference.from_dict(x) for x in _dict.get('ips')]
else:
- raise ValueError('Required property \'is_default\' not present in AddressPrefix 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 EndpointGateway 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 EndpointGateway JSON')
+ if 'resource_group' in _dict:
+ args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
else:
- raise ValueError('Required property \'zone\' not present in AddressPrefix 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 EndpointGateway JSON')
+ if 'security_groups' in _dict:
+ args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')]
+ else:
+ raise ValueError('Required property \'security_groups\' not present in 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 \'service_endpoints\' not present in EndpointGateway JSON')
+ if 'target' in _dict:
+ args['target'] = _dict.get('target')
+ else:
+ 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 \'vpc\' not present in EndpointGateway JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a AddressPrefix 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, '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, '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, 'href') 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, 'ips') and self.ips is not None:
+ _dict['ips'] = [x.to_dict() for x in self.ips]
+ 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, 'zone') and self.zone is not None:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ _dict['security_groups'] = [x.to_dict() for x in self.security_groups]
+ if hasattr(self, '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:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this EndpointGateway object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: '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'
+
- def __str__(self) -> str:
- """Return a `str` version of this AddressPrefix object."""
- return json.dumps(self.to_dict(), indent=2)
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the endpoint gateway.
+ """
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
- 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 ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ ENDPOINT_GATEWAY = 'endpoint_gateway'
-class AddressPrefixCollection():
+
+class EndpointGatewayCollection():
"""
- AddressPrefixCollection.
+ EndpointGatewayCollection.
- :attr List[AddressPrefix] address_prefixes: Collection of address prefixes.
- :attr AddressPrefixCollectionFirst 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 AddressPrefixCollectionNext 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.
"""
def __init__(self,
- address_prefixes: List['AddressPrefix'],
- first: 'AddressPrefixCollectionFirst',
+ endpoint_gateways: List['EndpointGateway'],
+ first: 'EndpointGatewayCollectionFirst',
limit: int,
total_count: int,
*,
- next: 'AddressPrefixCollectionNext' = None) -> None:
+ next: 'EndpointGatewayCollectionNext' = None) -> None:
"""
- Initialize a AddressPrefixCollection object.
+ Initialize a EndpointGatewayCollection object.
- :param List[AddressPrefix] address_prefixes: Collection of address
- prefixes.
- :param AddressPrefixCollectionFirst 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 AddressPrefixCollectionNext 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.address_prefixes = address_prefixes
+ 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) -> 'AddressPrefixCollection':
- """Initialize a AddressPrefixCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollection':
+ """Initialize a EndpointGatewayCollection object from a json dictionary."""
args = {}
- if 'address_prefixes' in _dict:
- args['address_prefixes'] = [AddressPrefix.from_dict(x) for x in _dict.get('address_prefixes')]
+ if 'endpoint_gateways' in _dict:
+ args['endpoint_gateways'] = [EndpointGateway.from_dict(x) for x in _dict.get('endpoint_gateways')]
else:
- raise ValueError('Required property \'address_prefixes\' not present in AddressPrefixCollection JSON')
+ raise ValueError('Required property \'endpoint_gateways\' not present in EndpointGatewayCollection JSON')
if 'first' in _dict:
- args['first'] = AddressPrefixCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = EndpointGatewayCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in AddressPrefixCollection 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 AddressPrefixCollection JSON')
+ raise ValueError('Required property \'limit\' not present in EndpointGatewayCollection JSON')
if 'next' in _dict:
- args['next'] = AddressPrefixCollectionNext.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 AddressPrefixCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in EndpointGatewayCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a AddressPrefixCollection 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, 'address_prefixes') and self.address_prefixes is not None:
- _dict['address_prefixes'] = [x.to_dict() for x in self.address_prefixes]
+ if hasattr(self, 'endpoint_gateways') and self.endpoint_gateways is not None:
+ _dict['endpoint_gateways'] = [x.to_dict() for x in self.endpoint_gateways]
if hasattr(self, 'first') and self.first is not None:
_dict['first'] = self.first.to_dict()
if hasattr(self, 'limit') and self.limit is not None:
@@ -15394,20 +24464,20 @@ 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 EndpointGatewayCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'AddressPrefixCollection') -> 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: 'AddressPrefixCollection') -> bool:
+ def __ne__(self, other: 'EndpointGatewayCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class AddressPrefixCollectionFirst():
+class EndpointGatewayCollectionFirst():
"""
A link to the first page of resources.
@@ -15417,25 +24487,25 @@ class AddressPrefixCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a AddressPrefixCollectionFirst 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) -> 'AddressPrefixCollectionFirst':
- """Initialize a AddressPrefixCollectionFirst 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 AddressPrefixCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a AddressPrefixCollectionFirst object from a json dictionary."""
+ """Initialize a EndpointGatewayCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -15450,20 +24520,20 @@ 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 EndpointGatewayCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'AddressPrefixCollectionFirst') -> 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: 'AddressPrefixCollectionFirst') -> bool:
+ def __ne__(self, other: 'EndpointGatewayCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class AddressPrefixCollectionNext():
+class EndpointGatewayCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -15474,25 +24544,25 @@ class AddressPrefixCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a AddressPrefixCollectionNext 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) -> 'AddressPrefixCollectionNext':
- """Initialize a AddressPrefixCollectionNext object from a json dictionary."""
+ 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 AddressPrefixCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in EndpointGatewayCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a AddressPrefixCollectionNext object from a json dictionary."""
+ """Initialize a EndpointGatewayCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -15507,70 +24577,55 @@ 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 EndpointGatewayCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'AddressPrefixCollectionNext') -> 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: 'AddressPrefixCollectionNext') -> bool:
+ def __ne__(self, other: 'EndpointGatewayCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class AddressPrefixPatch():
+class EndpointGatewayPatch():
"""
- AddressPrefixPatch.
+ EndpointGatewayPatch.
- :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 user-defined name for this address prefix. Names
- must be unique within the VPC the address prefix resides in.
+ :attr str name: (optional) The user-defined name for this endpoint gateway.
+ Names must be unique within the VPC this endpoint gateway is serving.
"""
def __init__(self,
*,
- is_default: bool = None,
name: str = None) -> None:
"""
- Initialize a AddressPrefixPatch object.
+ Initialize a EndpointGatewayPatch 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 user-defined name for this address prefix.
- Names must be unique within the VPC the address prefix resides in.
+ :param str name: (optional) The user-defined name for this endpoint
+ gateway. Names must be unique within the VPC this endpoint gateway is
+ serving.
"""
- self.is_default = is_default
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'AddressPrefixPatch':
- """Initialize a AddressPrefixPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'EndpointGatewayPatch':
+ """Initialize a EndpointGatewayPatch 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."""
+ """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, '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
@@ -15580,70 +24635,56 @@ 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 EndpointGatewayPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'AddressPrefixPatch') -> 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: 'AddressPrefixPatch') -> bool:
+ def __ne__(self, other: 'EndpointGatewayPatch') -> 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:
- """
- Initialize a CertificateInstanceIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['CertificateInstanceIdentityByCRN']))
- raise Exception(msg)
-
-class CertificateInstanceReference():
+class EndpointGatewayReferenceDeleted():
"""
- 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) -> None:
+ more_info: str) -> None:
"""
- Initialize a CertificateInstanceReference object.
+ Initialize a EndpointGatewayReferenceDeleted 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) -> 'EndpointGatewayReferenceDeleted':
+ """Initialize a EndpointGatewayReferenceDeleted 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 EndpointGatewayReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a CertificateInstanceReference 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, '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):
@@ -15651,361 +24692,240 @@ 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 EndpointGatewayReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'CertificateInstanceReference') -> 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: 'CertificateInstanceReference') -> bool:
+ def __ne__(self, other: 'EndpointGatewayReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class CloudObjectStorageBucketIdentity():
+class EndpointGatewayReservedIP():
"""
- Identifies a Cloud Object Storage bucket by a unique property.
+ 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 CloudObjectStorageBucketIdentity object.
+ Initialize a EndpointGatewayReservedIP object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['CloudObjectStorageBucketIdentityByName']))
+ ", ".join(['EndpointGatewayReservedIPReservedIPIdentity', 'EndpointGatewayReservedIPReservedIPPrototypeTargetContext']))
raise Exception(msg)
-class CloudObjectStorageBucketReference():
+class EndpointGatewayTarget():
"""
- CloudObjectStorageBucketReference.
+ The target for this endpoint gateway.
- :attr str name: The globally unique name of this COS bucket.
+ """
+
+ 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 for this endpoint gateway.
+
+ :attr str resource_type: The type of target for this endpoint gateway.
"""
def __init__(self,
- name: str) -> None:
+ resource_type: str) -> None:
"""
- Initialize a CloudObjectStorageBucketReference object.
+ Initialize a EndpointGatewayTargetPrototype object.
- :param str name: The globally unique name of this COS bucket.
+ :param str resource_type: The type of target for this endpoint gateway.
"""
- self.name = name
+ 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) -> 'CloudObjectStorageBucketReference':
- """Initialize a CloudObjectStorageBucketReference object from a json dictionary."""
- args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in CloudObjectStorageBucketReference JSON')
- return cls(**args)
+ 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):
- """Initialize a CloudObjectStorageBucketReference object from a json dictionary."""
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a EndpointGatewayTargetPrototype object from a json dictionary."""
return cls.from_dict(_dict)
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this CloudObjectStorageBucketReference object."""
- return json.dumps(self.to_dict(), indent=2)
+ @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)
- 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__
+ class ResourceTypeEnum(str, Enum):
+ """
+ The type of target for this endpoint gateway.
+ """
+ PROVIDER_CLOUD_SERVICE = 'provider_cloud_service'
+ PROVIDER_INFRASTRUCTURE_SERVICE = 'provider_infrastructure_service'
- def __ne__(self, other: 'CloudObjectStorageBucketReference') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class DedicatedHost():
+class FloatingIP():
"""
- DedicatedHost.
+ FloatingIP.
- :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 unique user-defined name for this dedicated host.
- :attr DedicatedHostProfileReference profile: The profile this dedicated host
- uses.
- :attr bool provisionable: Indicates whether this dedicated host is available for
- instance creation.
+ :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 unique user-defined name for this floating IP.
: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 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.
+ 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,
- available_memory: int,
- available_vcpu: 'VCPU',
+ address: str,
created_at: datetime,
crn: str,
- disks: List['DedicatedHostDisk'],
- group: 'DedicatedHostGroupReference',
href: str,
id: 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,
- socket_count: int,
- state: str,
- supported_instance_profiles: List['InstanceProfileReference'],
- vcpu: 'VCPU',
- zone: 'ZoneReference') -> None:
+ status: str,
+ zone: 'ZoneReference',
+ *,
+ target: 'FloatingIPTarget' = None) -> None:
"""
- Initialize a DedicatedHost object.
+ Initialize a FloatingIP 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 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 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 unique user-defined name for this dedicated host.
- :param DedicatedHostProfileReference profile: The profile this dedicated
- host uses.
- :param bool provisionable: Indicates whether this dedicated host is
- available for instance creation.
+ :param str crn: The CRN for this floating IP.
+ :param str href: The URL for this floating IP.
+ :param str id: The unique identifier for this floating IP.
+ :param str name: The unique user-defined name for this floating IP.
:param 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.
+ 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.available_memory = available_memory
- self.available_vcpu = available_vcpu
+ self.address = address
self.created_at = created_at
self.crn = crn
- self.disks = disks
- self.group = group
self.href = href
self.id = id
- 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.socket_count = socket_count
- self.state = state
- self.supported_instance_profiles = supported_instance_profiles
- self.vcpu = vcpu
+ self.status = status
+ self.target = target
self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHost':
- """Initialize a DedicatedHost object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIP':
+ """Initialize a FloatingIP 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'))
+ if 'address' in _dict:
+ args['address'] = _dict.get('address')
else:
- raise ValueError('Required property \'available_vcpu\' not present in DedicatedHost 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 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(x) for x 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 DedicatedHost 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(x) for x 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')
+ 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 \'lifecycle_state\' not present in DedicatedHost JSON')
- if 'memory' in _dict:
- args['memory'] = _dict.get('memory')
+ raise ValueError('Required property \'crn\' not present in FloatingIP JSON')
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'memory\' not present in DedicatedHost 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 FloatingIP 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 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 DedicatedHost 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')
- else:
- raise ValueError('Required property \'state\' not present in DedicatedHost JSON')
- if 'supported_instance_profiles' in _dict:
- args['supported_instance_profiles'] = [InstanceProfileReference.from_dict(x) for x in _dict.get('supported_instance_profiles')]
- 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 \'resource_group\' not present in FloatingIP JSON')
+ if 'status' in _dict:
+ args['status'] = _dict.get('status')
else:
- raise ValueError('Required property \'vcpu\' not present in DedicatedHost 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 DedicatedHost JSON')
+ raise ValueError('Required property \'zone\' not present in FloatingIP JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHost 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, 'available_memory') and self.available_memory is not None:
- _dict['available_memory'] = self.available_memory
- if hasattr(self, 'available_vcpu') and self.available_vcpu is not None:
- _dict['available_vcpu'] = self.available_vcpu.to_dict()
+ if 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, 'disks') and self.disks is not None:
- _dict['disks'] = [x.to_dict() for x in self.disks]
- if hasattr(self, 'group') and self.group is not None:
- _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, 'instance_placement_enabled') and self.instance_placement_enabled is not None:
- _dict['instance_placement_enabled'] = self.instance_placement_enabled
- if hasattr(self, 'instances') and self.instances is not None:
- _dict['instances'] = [x.to_dict() for x in self.instances]
- 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:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'provisionable') and self.provisionable is not None:
- _dict['provisionable'] = self.provisionable
if hasattr(self, 'resource_group') and self.resource_group is not None:
_dict['resource_group'] = self.resource_group.to_dict()
- if 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:
- _dict['supported_instance_profiles'] = [x.to_dict() for x in self.supported_instance_profiles]
- if hasattr(self, 'vcpu') and self.vcpu is not None:
- _dict['vcpu'] = self.vcpu.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:
_dict['zone'] = self.zone.to_dict()
return _dict
@@ -16015,129 +24935,120 @@ 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 FloatingIP object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHost') -> 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: 'DedicatedHost') -> bool:
+ def __ne__(self, other: 'FloatingIP') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class LifecycleStateEnum(str, Enum):
+ class StatusEnum(str, Enum):
"""
- The lifecycle state of the dedicated host.
+ The status of the floating IP.
"""
+ AVAILABLE = 'available'
DELETING = 'deleting'
FAILED = 'failed'
PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
- DEDICATED_HOST = 'dedicated_host'
+class FloatingIPByTargetNetworkInterfaceIdentity():
+ """
+ The network interface this floating IP is to be bound to.
+ """
- 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.
+ def __init__(self) -> None:
"""
- AVAILABLE = 'available'
- DEGRADED = 'degraded'
- MIGRATING = 'migrating'
- UNAVAILABLE = 'unavailable'
+ Initialize a FloatingIPByTargetNetworkInterfaceIdentity object.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref']))
+ raise Exception(msg)
-class DedicatedHostCollection():
+class FloatingIPCollection():
"""
- DedicatedHostCollection.
+ FloatingIPCollection.
- :attr List[DedicatedHost] dedicated_hosts: Collection of dedicated hosts.
- :attr DedicatedHostCollectionFirst first: A link to the first page of resources.
+ :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 DedicatedHostCollectionNext next: (optional) A link to the next page of
+ :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,
- dedicated_hosts: List['DedicatedHost'],
- first: 'DedicatedHostCollectionFirst',
+ first: 'FloatingIPCollectionFirst',
+ floating_ips: List['FloatingIP'],
limit: int,
total_count: int,
*,
- next: 'DedicatedHostCollectionNext' = None) -> None:
+ next: 'FloatingIPCollectionNext' = None) -> None:
"""
- Initialize a DedicatedHostCollection object.
+ Initialize a FloatingIPCollection object.
- :param List[DedicatedHost] dedicated_hosts: Collection of dedicated hosts.
- :param DedicatedHostCollectionFirst first: A link to the first page of
+ :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 DedicatedHostCollectionNext 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.dedicated_hosts = dedicated_hosts
self.first = first
+ self.floating_ips = floating_ips
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) -> 'FloatingIPCollection':
+ """Initialize a FloatingIPCollection object from a json dictionary."""
args = {}
- if 'dedicated_hosts' in _dict:
- args['dedicated_hosts'] = [DedicatedHost.from_dict(x) for x in _dict.get('dedicated_hosts')]
- else:
- raise ValueError('Required property \'dedicated_hosts\' not present in DedicatedHostCollection JSON')
if 'first' in _dict:
- args['first'] = DedicatedHostCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = FloatingIPCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in DedicatedHostCollection JSON')
+ raise ValueError('Required property \'first\' not present in FloatingIPCollection JSON')
+ if 'floating_ips' in _dict:
+ args['floating_ips'] = [FloatingIP.from_dict(x) for x in _dict.get('floating_ips')]
+ 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 DedicatedHostCollection JSON')
+ raise ValueError('Required property \'limit\' not present in FloatingIPCollection JSON')
if 'next' in _dict:
- args['next'] = DedicatedHostCollectionNext.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 DedicatedHostCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in FloatingIPCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostCollection object from a json dictionary."""
+ """Initialize a FloatingIPCollection object from 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:
- _dict['dedicated_hosts'] = [x.to_dict() for x in self.dedicated_hosts]
if hasattr(self, 'first') and self.first is not None:
_dict['first'] = self.first.to_dict()
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips]
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -16151,20 +25062,20 @@ 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 FloatingIPCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostCollection') -> 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: 'DedicatedHostCollection') -> bool:
+ def __ne__(self, other: 'FloatingIPCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostCollectionFirst():
+class FloatingIPCollectionFirst():
"""
A link to the first page of resources.
@@ -16174,25 +25085,25 @@ class DedicatedHostCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a DedicatedHostCollectionFirst 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) -> 'DedicatedHostCollectionFirst':
- """Initialize a DedicatedHostCollectionFirst 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 DedicatedHostCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in FloatingIPCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostCollectionFirst object from a json dictionary."""
+ """Initialize a FloatingIPCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -16207,20 +25118,20 @@ 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 FloatingIPCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostCollectionFirst') -> 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: 'DedicatedHostCollectionFirst') -> bool:
+ def __ne__(self, other: 'FloatingIPCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostCollectionNext():
+class FloatingIPCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -16231,315 +25142,32 @@ class DedicatedHostCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a DedicatedHostCollectionNext 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) -> '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 user-defined or system-provided name for this disk.
- :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 user-defined or system-provided name for this disk.
- :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) -> 'FloatingIPCollectionNext':
+ """Initialize a FloatingIPCollectionNext 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(x) for x 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 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, '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:
- _dict['instance_disks'] = [x.to_dict() for x in self.instance_disks]
- 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):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostDisk object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: '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 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():
- """
- DedicatedHostDiskCollection.
-
- :attr List[DedicatedHostDisk] disks: Collection of the dedicated host's disks.
- """
-
- def __init__(self,
- disks: List['DedicatedHostDisk']) -> None:
- """
- Initialize a DedicatedHostDiskCollection object.
-
- :param List[DedicatedHostDisk] disks: Collection of the dedicated host's
- disks.
- """
- self.disks = disks
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskCollection':
- """Initialize a DedicatedHostDiskCollection object from a json dictionary."""
- args = {}
- if 'disks' in _dict:
- args['disks'] = [DedicatedHostDisk.from_dict(x) for x in _dict.get('disks')]
- else:
- raise ValueError('Required property \'disks\' not present in DedicatedHostDiskCollection JSON')
+ raise ValueError('Required property \'href\' not present in FloatingIPCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostDiskCollection object from a json dictionary."""
+ """Initialize a FloatingIPCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'disks') and self.disks is not None:
- _dict['disks'] = [x.to_dict() for x in self.disks]
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -16547,47 +25175,62 @@ 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 FloatingIPCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostDiskCollection') -> 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: 'DedicatedHostDiskCollection') -> bool:
+ def __ne__(self, other: 'FloatingIPCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostDiskPatch():
+class FloatingIPPatch():
"""
- DedicatedHostDiskPatch.
+ FloatingIPPatch.
- :attr str name: (optional) The user-defined name for this disk.
+ :attr str name: (optional) The unique user-defined name for this floating IP.
+ :attr FloatingIPTargetPatch target: (optional) The network interface to bind the
+ floating IP to, replacing any existing binding. For
+ this request to succeed, the floating IP must not be required by another
+ resource, such
+ as a public gateway.
"""
def __init__(self,
*,
- name: str = None) -> None:
+ name: str = None,
+ target: 'FloatingIPTargetPatch' = None) -> None:
"""
- Initialize a DedicatedHostDiskPatch object.
+ Initialize a FloatingIPPatch object.
- :param str name: (optional) The user-defined name for this disk.
+ :param str name: (optional) The unique user-defined name for this floating
+ IP.
+ :param FloatingIPTargetPatch target: (optional) The network interface to
+ bind the floating IP to, replacing any existing binding. For
+ this request to succeed, the floating IP must not be required by another
+ resource, such
+ as a public gateway.
"""
self.name = name
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostDiskPatch':
- """Initialize a DedicatedHostDiskPatch object from a json dictionary."""
+ 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 DedicatedHostDiskPatch object from a json dictionary."""
+ """Initialize a FloatingIPPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -16595,6 +25238,11 @@ def to_dict(self) -> Dict:
_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):
@@ -16602,176 +25250,138 @@ 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 FloatingIPPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostDiskPatch') -> bool:
+ 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: 'DedicatedHostDiskPatch') -> bool:
+ def __ne__(self, other: 'FloatingIPPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroup():
+class FloatingIPPrototype():
"""
- DedicatedHostGroup.
+ FloatingIPPrototype.
- :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 unique user-defined name for this dedicated host group.
- :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.
+ :attr str name: (optional) The unique user-defined name for this floating IP. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :attr 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,
- class_: str,
- created_at: datetime,
+ *,
+ name: str = None,
+ resource_group: 'ResourceGroupIdentity' = None) -> None:
+ """
+ Initialize a FloatingIPPrototype object.
+
+ :param str name: (optional) The unique user-defined name for this floating
+ IP. If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param 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']))
+ raise Exception(msg)
+
+class FloatingIPReference():
+ """
+ FloatingIPReference.
+
+ :attr str address: The globally unique IP address.
+ :attr str crn: The CRN for this floating IP.
+ :attr FloatingIPReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted and provides
+ some supplementary information.
+ :attr str href: The URL for this floating IP.
+ :attr str id: The unique identifier for this floating IP.
+ :attr str name: The unique user-defined name for this floating IP.
+ """
+
+ def __init__(self,
+ address: str,
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'],
- zone: 'ZoneReference') -> None:
+ *,
+ deleted: 'FloatingIPReferenceDeleted' = None) -> None:
"""
- Initialize a DedicatedHostGroup object.
+ Initialize a FloatingIPReference 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 unique user-defined name for this dedicated host
- group.
- :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.
+ :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 unique user-defined name for this floating IP.
+ :param FloatingIPReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ some supplementary information.
"""
- self.class_ = class_
- self.created_at = created_at
+ self.address = address
self.crn = crn
- self.dedicated_hosts = dedicated_hosts
- self.family = family
+ self.deleted = deleted
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) -> 'DedicatedHostGroup':
- """Initialize a DedicatedHostGroup object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPReference':
+ """Initialize a FloatingIPReference 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'))
+ if 'address' in _dict:
+ args['address'] = _dict.get('address')
else:
- raise ValueError('Required property \'created_at\' not present in DedicatedHostGroup JSON')
+ 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 DedicatedHostGroup JSON')
- if 'dedicated_hosts' in _dict:
- args['dedicated_hosts'] = [DedicatedHostReference.from_dict(x) for x 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 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 DedicatedHostGroup JSON')
+ 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 DedicatedHostGroup JSON')
+ 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 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(x) for x 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')
+ raise ValueError('Required property \'name\' not present in FloatingIPReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroup 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, '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, '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, 'dedicated_hosts') and self.dedicated_hosts is not None:
- _dict['dedicated_hosts'] = [x.to_dict() for x in self.dedicated_hosts]
- if hasattr(self, 'family') and self.family is not None:
- _dict['family'] = self.family
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'supported_instance_profiles') and self.supported_instance_profiles is not None:
- _dict['supported_instance_profiles'] = [x.to_dict() for x in self.supported_instance_profiles]
- if hasattr(self, 'zone') and self.zone is not None:
- _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -16779,119 +25389,56 @@ 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 FloatingIPReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroup') -> 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: 'DedicatedHostGroup') -> bool:
+ def __ne__(self, other: 'FloatingIPReference') -> 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):
- """
- The resource type.
- """
- DEDICATED_HOST_GROUP = 'dedicated_host_group'
-
-
-class DedicatedHostGroupCollection():
+class FloatingIPReferenceDeleted():
"""
- DedicatedHostGroupCollection.
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :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 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.
+ :attr str more_info: Link to documentation about deleted resources.
"""
def __init__(self,
- first: 'DedicatedHostGroupCollectionFirst',
- groups: List['DedicatedHostGroup'],
- limit: int,
- total_count: int,
- *,
- next: 'DedicatedHostGroupCollectionNext' = None) -> None:
+ more_info: str) -> None:
"""
- Initialize a DedicatedHostGroupCollection object.
+ Initialize a FloatingIPReferenceDeleted object.
- :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 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
- except the last page.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.first = first
- self.groups = groups
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollection':
- """Initialize a DedicatedHostGroupCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPReferenceDeleted':
+ """Initialize a FloatingIPReferenceDeleted object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = DedicatedHostGroupCollectionFirst.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(x) for x in _dict.get('groups')]
- else:
- raise ValueError('Required property \'groups\' not present in DedicatedHostGroupCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in DedicatedHostGroupCollection JSON')
- if 'next' in _dict:
- args['next'] = DedicatedHostGroupCollectionNext.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 DedicatedHostGroupCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in FloatingIPReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupCollection 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'groups') and self.groups is not None:
- _dict['groups'] = [x.to_dict() for x in self.groups]
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -16899,55 +25446,87 @@ 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 FloatingIPReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupCollection') -> 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: 'DedicatedHostGroupCollection') -> bool:
+ def __ne__(self, other: 'FloatingIPReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupCollectionFirst():
+class FloatingIPTarget():
"""
- A link to the first page of resources.
+ The target of this floating IP.
- :attr str href: The URL for a page of resources.
+ """
+
+ 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 network interface to bind the floating IP to, replacing any existing binding. For
+ this request to succeed, the floating IP must not be required by another resource,
+ such as a public gateway.
+
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a FloatingIPTargetPatch object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FloatingIPTargetPatchNetworkInterfaceIdentityById', 'FloatingIPTargetPatchNetworkInterfaceIdentityByHref']))
+ raise Exception(msg)
+
+class FloatingIPUnpaginatedCollection():
+ """
+ FloatingIPUnpaginatedCollection.
+
+ :attr List[FloatingIP] floating_ips: Collection of floating IPs.
"""
def __init__(self,
- href: str) -> None:
+ floating_ips: List['FloatingIP']) -> None:
"""
- Initialize a DedicatedHostGroupCollectionFirst object.
+ Initialize a FloatingIPUnpaginatedCollection object.
- :param str href: The URL for a page of resources.
+ :param List[FloatingIP] floating_ips: Collection of floating IPs.
"""
- self.href = href
+ self.floating_ips = floating_ips
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionFirst':
- """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPUnpaginatedCollection':
+ """Initialize a FloatingIPUnpaginatedCollection object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if 'floating_ips' in _dict:
+ args['floating_ips'] = [FloatingIP.from_dict(x) for x in _dict.get('floating_ips')]
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostGroupCollectionFirst JSON')
+ raise ValueError('Required property \'floating_ips\' not present in FloatingIPUnpaginatedCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupCollectionFirst object from a json dictionary."""
+ """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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips]
return _dict
def _to_dict(self):
@@ -16955,56 +25534,188 @@ 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 FloatingIPUnpaginatedCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupCollectionFirst') -> bool:
+ 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: 'DedicatedHostGroupCollectionFirst') -> bool:
+ def __ne__(self, other: 'FloatingIPUnpaginatedCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupCollectionNext():
+class FlowLogCollector():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ FlowLogCollector.
- :attr str href: The URL for a page of resources.
+ :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 unique user-defined name for this flow log collector.
+ :attr ResourceGroupReference resource_group: The resource group for this flow
+ log collector.
+ :attr CloudObjectStorageBucketReference storage_bucket: The Cloud Object Storage
+ bucket where the collected flows are logged.
+ :attr FlowLogCollectorTarget target: The target this collector is collecting
+ flow logs for. If the target is an instance,
+ subnet, or VPC, flow logs will not be collected for any network interfaces
+ within the
+ target that are themselves the target of a more specific flow log collector.
+ :attr VPCReference vpc: The VPC this flow log collector is associated with.
"""
def __init__(self,
- href: str) -> None:
+ active: bool,
+ auto_delete: bool,
+ created_at: datetime,
+ crn: str,
+ href: str,
+ id: str,
+ lifecycle_state: str,
+ name: str,
+ resource_group: 'ResourceGroupReference',
+ storage_bucket: 'CloudObjectStorageBucketReference',
+ target: 'FlowLogCollectorTarget',
+ vpc: 'VPCReference') -> None:
"""
- Initialize a DedicatedHostGroupCollectionNext object.
+ Initialize a FlowLogCollector object.
- :param str href: The URL for a page of resources.
+ :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 unique user-defined name for this flow log collector.
+ :param ResourceGroupReference resource_group: The resource group for this
+ flow log collector.
+ :param CloudObjectStorageBucketReference storage_bucket: The Cloud Object
+ Storage bucket where the collected flows are logged.
+ :param FlowLogCollectorTarget target: The target this collector is
+ collecting flow logs for. If the target is an instance,
+ subnet, or VPC, flow logs will not be collected for any network interfaces
+ within the
+ target that are themselves the target of a more specific flow log
+ collector.
+ :param VPCReference vpc: The VPC this flow log collector is associated
+ with.
"""
+ self.active = active
+ 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.resource_group = resource_group
+ self.storage_bucket = storage_bucket
+ self.target = target
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupCollectionNext':
- """Initialize a DedicatedHostGroupCollectionNext 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 FlowLogCollector JSON')
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 FlowLogCollector JSON')
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
+ else:
+ 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 FlowLogCollector 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 FlowLogCollector 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 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 DedicatedHostGroupCollectionNext 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, 'href') 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:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'storage_bucket') and self.storage_bucket is not None:
+ _dict['storage_bucket'] = self.storage_bucket.to_dict()
+ if hasattr(self, 'target') and self.target is not None:
+ if isinstance(self.target, dict):
+ _dict['target'] = self.target
+ else:
+ _dict['target'] = self.target.to_dict()
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -17012,71 +25723,117 @@ 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 FlowLogCollector object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupCollectionNext') -> 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: 'DedicatedHostGroupCollectionNext') -> bool:
+ def __ne__(self, other: 'FlowLogCollector') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupIdentity():
- """
- Identifies a dedicated host group by a unique property.
-
- """
-
- def __init__(self) -> None:
+ class LifecycleStateEnum(str, Enum):
"""
- Initialize a DedicatedHostGroupIdentity object.
-
+ The lifecycle state of the flow log collector.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['DedicatedHostGroupIdentityById', 'DedicatedHostGroupIdentityByCRN', 'DedicatedHostGroupIdentityByHref']))
- raise Exception(msg)
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
-class DedicatedHostGroupPatch():
+
+class FlowLogCollectorCollection():
"""
- DedicatedHostGroupPatch.
+ FlowLogCollectorCollection.
- :attr str name: (optional) The unique user-defined name for this dedicated host
- group.
+ :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,
*,
- name: str = None) -> None:
+ next: 'FlowLogCollectorCollectionNext' = None) -> None:
"""
- Initialize a DedicatedHostGroupPatch object.
+ Initialize a FlowLogCollectorCollection object.
- :param str name: (optional) The unique user-defined name for this dedicated
- host group.
+ :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.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) -> 'DedicatedHostGroupPatch':
- """Initialize a DedicatedHostGroupPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollection':
+ """Initialize a FlowLogCollectorCollection object from a json dictionary."""
args = {}
- 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(x) for x 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 DedicatedHostGroupPatch 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, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'flow_log_collectors') and self.flow_log_collectors is not None:
+ _dict['flow_log_collectors'] = [x.to_dict() for x in self.flow_log_collectors]
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -17084,69 +25841,55 @@ 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 FlowLogCollectorCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupPatch') -> 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: 'DedicatedHostGroupPatch') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupPrototypeDedicatedHostByZoneContext():
+class FlowLogCollectorCollectionFirst():
"""
- DedicatedHostGroupPrototypeDedicatedHostByZoneContext.
+ A link to the first page of resources.
- :attr str name: (optional) The unique user-defined name for this dedicated host
- group.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the host's resource group is used.
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None) -> None:
+ href: str) -> None:
"""
- Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object.
+ Initialize a FlowLogCollectorCollectionFirst object.
- :param str name: (optional) The unique user-defined name for this dedicated
- host group.
- :param ResourceGroupIdentity resource_group: (optional) The resource group
- to use. If unspecified, the host's resource group is used.
+ :param str href: The URL for a page of resources.
"""
- self.name = name
- self.resource_group = resource_group
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext':
- """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionFirst':
+ """Initialize a FlowLogCollectorCollectionFirst 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 FlowLogCollectorCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupPrototypeDedicatedHostByZoneContext 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, '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):
@@ -17154,110 +25897,56 @@ 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 FlowLogCollectorCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext') -> 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: 'DedicatedHostGroupPrototypeDedicatedHostByZoneContext') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostGroupReference():
+class FlowLogCollectorCollectionNext():
"""
- DedicatedHostGroupReference.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :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 unique user-defined name for this dedicated host group.
- :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: 'DedicatedHostGroupReferenceDeleted' = None) -> None:
+ href: str) -> None:
"""
- Initialize a DedicatedHostGroupReference object.
+ Initialize a FlowLogCollectorCollectionNext 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 unique user-defined name for this dedicated host
- group.
- :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 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) -> 'DedicatedHostGroupReference':
- """Initialize a DedicatedHostGroupReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionNext':
+ """Initialize a FlowLogCollectorCollectionNext object from a json dictionary."""
args = {}
- 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')
- 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')
+ raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostGroupReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -17265,63 +25954,68 @@ 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 FlowLogCollectorCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupReference') -> 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: 'DedicatedHostGroupReference') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorCollectionNext') -> 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():
+class FlowLogCollectorPatch():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ FlowLogCollectorPatch.
- :attr str more_info: Link to documentation about deleted 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 unique user-defined name for this flow log
+ collector.
"""
def __init__(self,
- more_info: str) -> None:
+ *,
+ active: bool = None,
+ name: str = None) -> None:
"""
- Initialize a DedicatedHostGroupReferenceDeleted object.
+ Initialize a FlowLogCollectorPatch object.
- :param str more_info: Link to documentation about deleted 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 unique user-defined name for this flow log
+ collector.
"""
- self.more_info = more_info
+ self.active = active
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostGroupReferenceDeleted':
- """Initialize a DedicatedHostGroupReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorPatch':
+ """Initialize a FlowLogCollectorPatch 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')
+ 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 DedicatedHostGroupReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ 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):
@@ -17329,235 +26023,215 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostGroupReferenceDeleted object."""
+ """Return a `str` version of this FlowLogCollectorPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostGroupReferenceDeleted') -> 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: 'DedicatedHostGroupReferenceDeleted') -> bool:
+ def __ne__(self, other: 'FlowLogCollectorPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostPatch():
+class FlowLogCollectorTarget():
"""
- DedicatedHostPatch.
+ The target this collector is collecting flow logs for. If the target is an instance,
+ subnet, or VPC, flow logs will not be collected for any network interfaces within the
+ target that are themselves the target of a more specific flow log collector.
- :attr bool instance_placement_enabled: (optional) If set to true, instances can
- be placed on this dedicated host.
- :attr str name: (optional) The unique user-defined name for this dedicated host.
"""
- def __init__(self,
- *,
- instance_placement_enabled: bool = None,
- name: str = None) -> None:
+ def __init__(self) -> None:
"""
- Initialize a DedicatedHostPatch object.
+ Initialize a FlowLogCollectorTarget object.
- :param bool instance_placement_enabled: (optional) If set to true,
- instances can be placed on this dedicated host.
- :param str name: (optional) The unique user-defined name for this dedicated
- host.
"""
- self.instance_placement_enabled = instance_placement_enabled
- self.name = name
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostPatch':
- """Initialize a DedicatedHostPatch 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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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
- return _dict
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext', 'FlowLogCollectorTargetInstanceReference', 'FlowLogCollectorTargetSubnetReference', 'FlowLogCollectorTargetVPCReference']))
+ raise Exception(msg)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+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 __str__(self) -> str:
- """Return a `str` version of this DedicatedHostPatch object."""
- return json.dumps(self.to_dict(), indent=2)
+ """
- 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 __init__(self) -> None:
+ """
+ Initialize a FlowLogCollectorTargetPrototype object.
- def __ne__(self, other: 'DedicatedHostPatch') -> 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(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity', 'FlowLogCollectorTargetPrototypeInstanceIdentity', 'FlowLogCollectorTargetPrototypeSubnetIdentity', 'FlowLogCollectorTargetPrototypeVPCIdentity']))
+ raise Exception(msg)
-class DedicatedHostProfile():
+class IKEPolicy():
"""
- DedicatedHostProfile.
+ IKEPolicy.
- :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 str authentication_algorithm: The authentication algorithm.
+ :attr List[VPNGatewayConnectionReference] connections: The VPN gateway
+ connections that use this IKE policy.
+ :attr datetime created_at: The date and time that this IKE policy was created.
+ :attr int dh_group: The Diffie-Hellman group.
+ :attr str encryption_algorithm: The encryption algorithm.
+ :attr 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 user-defined name for this IKE policy.
+ :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,
- class_: str,
- disks: List['DedicatedHostProfileDisk'],
- family: str,
+ authentication_algorithm: str,
+ connections: List['VPNGatewayConnectionReference'],
+ created_at: datetime,
+ dh_group: int,
+ encryption_algorithm: str,
href: str,
- memory: 'DedicatedHostProfileMemory',
+ id: str,
+ ike_version: int,
+ key_lifetime: int,
name: str,
- socket_count: 'DedicatedHostProfileSocket',
- supported_instance_profiles: List['InstanceProfileReference'],
- vcpu_architecture: 'DedicatedHostProfileVCPUArchitecture',
- vcpu_count: 'DedicatedHostProfileVCPU') -> None:
+ negotiation_mode: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str) -> None:
"""
- Initialize a DedicatedHostProfile object.
+ Initialize a IKEPolicy 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:
- """
- self.class_ = class_
- self.disks = disks
- self.family = family
+ :param str authentication_algorithm: The authentication algorithm.
+ :param List[VPNGatewayConnectionReference] connections: The VPN gateway
+ connections that use this IKE policy.
+ :param datetime created_at: The date and time that this IKE policy was
+ created.
+ :param int dh_group: The Diffie-Hellman group.
+ :param str encryption_algorithm: The encryption algorithm.
+ :param 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 user-defined name for this IKE policy.
+ :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.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.memory = memory
+ self.id = id
+ self.ike_version = ike_version
+ self.key_lifetime = key_lifetime
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.negotiation_mode = negotiation_mode
+ self.resource_group = resource_group
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfile':
- """Initialize a DedicatedHostProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IKEPolicy':
+ """Initialize a IKEPolicy object from a json dictionary."""
args = {}
- if 'class' in _dict:
- args['class_'] = _dict.get('class')
+ if 'authentication_algorithm' in _dict:
+ args['authentication_algorithm'] = _dict.get('authentication_algorithm')
else:
- raise ValueError('Required property \'class\' not present in DedicatedHostProfile JSON')
- if 'disks' in _dict:
- args['disks'] = [DedicatedHostProfileDisk.from_dict(x) for x in _dict.get('disks')]
+ raise ValueError('Required property \'authentication_algorithm\' not present in IKEPolicy JSON')
+ if 'connections' in _dict:
+ args['connections'] = [VPNGatewayConnectionReference.from_dict(x) for x in _dict.get('connections')]
else:
- raise ValueError('Required property \'disks\' not present in DedicatedHostProfile JSON')
- if 'family' in _dict:
- args['family'] = _dict.get('family')
+ 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 \'family\' not present in DedicatedHostProfile JSON')
+ 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 DedicatedHostProfile JSON')
- if 'memory' in _dict:
- args['memory'] = _dict.get('memory')
+ raise ValueError('Required property \'href\' not present in IKEPolicy JSON')
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
else:
- raise ValueError('Required property \'memory\' not present in DedicatedHostProfile JSON')
+ 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 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(x) for x in _dict.get('supported_instance_profiles')]
+ 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 \'supported_instance_profiles\' not present in DedicatedHostProfile JSON')
- if 'vcpu_architecture' in _dict:
- args['vcpu_architecture'] = DedicatedHostProfileVCPUArchitecture.from_dict(_dict.get('vcpu_architecture'))
+ 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 \'vcpu_architecture\' not present in DedicatedHostProfile JSON')
- if 'vcpu_count' in _dict:
- args['vcpu_count'] = _dict.get('vcpu_count')
+ 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 \'vcpu_count\' not present in DedicatedHostProfile JSON')
+ raise ValueError('Required property \'resource_type\' not present in IKEPolicy JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfile 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, 'class_') and self.class_ is not None:
- _dict['class'] = self.class_
- if hasattr(self, 'disks') and self.disks is not None:
- _dict['disks'] = [x.to_dict() for x in self.disks]
- if hasattr(self, 'family') and self.family is not None:
- _dict['family'] = self.family
+ if hasattr(self, 'authentication_algorithm') and self.authentication_algorithm is not None:
+ _dict['authentication_algorithm'] = self.authentication_algorithm
+ if hasattr(self, 'connections') and self.connections is not None:
+ _dict['connections'] = [x.to_dict() for x in self.connections]
+ 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, 'memory') and self.memory is not None:
- if isinstance(self.memory, dict):
- _dict['memory'] = self.memory
- else:
- _dict['memory'] = self.memory.to_dict()
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, '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, '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:
- _dict['supported_instance_profiles'] = [x.to_dict() for x in self.supported_instance_profiles]
- if hasattr(self, 'vcpu_architecture') and self.vcpu_architecture is not None:
- _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, 'negotiation_mode') and self.negotiation_mode is not None:
+ _dict['negotiation_mode'] = self.negotiation_mode
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -17565,102 +26239,119 @@ 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 IKEPolicy object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfile') -> 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: 'DedicatedHostProfile') -> bool:
+ def __ne__(self, other: 'IKEPolicy') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class FamilyEnum(str, Enum):
+ class AuthenticationAlgorithmEnum(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.
+ The authentication algorithm.
"""
- BALANCED = 'balanced'
- COMPUTE = 'compute'
- MEMORY = 'memory'
+ MD5 = 'md5'
+ SHA1 = 'sha1'
+ SHA256 = 'sha256'
+ SHA512 = 'sha512'
-class DedicatedHostProfileCollection():
+ class EncryptionAlgorithmEnum(str, Enum):
+ """
+ The encryption algorithm.
+ """
+ AES128 = 'aes128'
+ 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():
"""
- DedicatedHostProfileCollection.
+ IKEPolicyCollection.
- :attr DedicatedHostProfileCollectionFirst first: A link to the first page of
- resources.
+ :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 DedicatedHostProfileCollectionNext next: (optional) A link to the next
- page of resources. This property is present for all pages
+ :attr IKEPolicyCollectionNext 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.
"""
def __init__(self,
- first: 'DedicatedHostProfileCollectionFirst',
+ first: 'IKEPolicyCollectionFirst',
+ ike_policies: List['IKEPolicy'],
limit: int,
- profiles: List['DedicatedHostProfile'],
total_count: int,
*,
- next: 'DedicatedHostProfileCollectionNext' = None) -> None:
+ next: 'IKEPolicyCollectionNext' = None) -> None:
"""
- Initialize a DedicatedHostProfileCollection object.
+ Initialize a IKEPolicyCollection object.
- :param DedicatedHostProfileCollectionFirst first: A link to the first page
- of resources.
+ :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 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
+ :param IKEPolicyCollectionNext 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.limit = limit
self.next = next
- self.profiles = profiles
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollection':
- """Initialize a DedicatedHostProfileCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollection':
+ """Initialize a IKEPolicyCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = DedicatedHostProfileCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = IKEPolicyCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in DedicatedHostProfileCollection JSON')
+ raise ValueError('Required property \'first\' not present in IKEPolicyCollection JSON')
+ if 'ike_policies' in _dict:
+ args['ike_policies'] = [IKEPolicy.from_dict(x) for x in _dict.get('ike_policies')]
+ else:
+ 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 DedicatedHostProfileCollection JSON')
+ raise ValueError('Required property \'limit\' not present in IKEPolicyCollection JSON')
if 'next' in _dict:
- args['next'] = DedicatedHostProfileCollectionNext.from_dict(_dict.get('next'))
- if 'profiles' in _dict:
- args['profiles'] = [DedicatedHostProfile.from_dict(x) for x in _dict.get('profiles')]
- else:
- raise ValueError('Required property \'profiles\' not present in DedicatedHostProfileCollection JSON')
+ 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 DedicatedHostProfileCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in IKEPolicyCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileCollection object from a json dictionary."""
+ """Initialize a IKEPolicyCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -17668,12 +26359,12 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'first') and self.first is not None:
_dict['first'] = self.first.to_dict()
+ if hasattr(self, 'ike_policies') and self.ike_policies is not None:
+ _dict['ike_policies'] = [x.to_dict() for x in self.ike_policies]
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'profiles') and self.profiles is not None:
- _dict['profiles'] = [x.to_dict() for x in self.profiles]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -17683,20 +26374,20 @@ 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 IKEPolicyCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileCollection') -> 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: 'DedicatedHostProfileCollection') -> bool:
+ def __ne__(self, other: 'IKEPolicyCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileCollectionFirst():
+class IKEPolicyCollectionFirst():
"""
A link to the first page of resources.
@@ -17706,25 +26397,25 @@ class DedicatedHostProfileCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a DedicatedHostProfileCollectionFirst object.
+ Initialize a IKEPolicyCollectionFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionFirst':
- """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary."""
+ 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')
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in IKEPolicyCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileCollectionFirst object from a json dictionary."""
+ """Initialize a IKEPolicyCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -17739,20 +26430,20 @@ 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 IKEPolicyCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileCollectionFirst') -> 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: 'DedicatedHostProfileCollectionFirst') -> bool:
+ def __ne__(self, other: 'IKEPolicyCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileCollectionNext():
+class IKEPolicyCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -17763,25 +26454,25 @@ class DedicatedHostProfileCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a DedicatedHostProfileCollectionNext object.
+ Initialize a IKEPolicyCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileCollectionNext':
- """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollectionNext':
+ """Initialize a IKEPolicyCollectionNext object from a json dictionary."""
args = {}
if 'href' in _dict:
args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'href\' not present in DedicatedHostProfileCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in IKEPolicyCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileCollectionNext object from a json dictionary."""
+ """Initialize a IKEPolicyCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -17796,166 +26487,95 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileCollectionNext object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'DedicatedHostProfileCollectionNext') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'DedicatedHostProfileCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class DedicatedHostProfileDisk():
- """
- Disks provided by this profile.
-
- :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,
- interface_type: 'DedicatedHostProfileDiskInterface',
- quantity: 'DedicatedHostProfileDiskQuantity',
- size: 'DedicatedHostProfileDiskSize',
- supported_instance_interface_types: 'DedicatedHostProfileDiskSupportedInterfaces') -> None:
- """
- Initialize a DedicatedHostProfileDisk 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:
- """
- self.interface_type = interface_type
- self.quantity = quantity
- self.size = size
- self.supported_instance_interface_types = supported_instance_interface_types
-
- @classmethod
- 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'] = DedicatedHostProfileDiskQuantity.from_dict(_dict.get('quantity'))
- else:
- raise ValueError('Required property \'quantity\' not present in DedicatedHostProfileDisk JSON')
- if 'size' in _dict:
- args['size'] = DedicatedHostProfileDiskSize.from_dict(_dict.get('size'))
- 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'))
- else:
- raise ValueError('Required property \'supported_instance_interface_types\' not present in DedicatedHostProfileDisk JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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:
- _dict['interface_type'] = self.interface_type.to_dict()
- if hasattr(self, 'quantity') and self.quantity is not None:
- _dict['quantity'] = self.quantity.to_dict()
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size.to_dict()
- if hasattr(self, 'supported_instance_interface_types') and self.supported_instance_interface_types is not None:
- _dict['supported_instance_interface_types'] = self.supported_instance_interface_types.to_dict()
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this DedicatedHostProfileDisk object."""
+ """Return a `str` version of this IKEPolicyCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDisk') -> 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: 'DedicatedHostProfileDisk') -> bool:
+ def __ne__(self, other: 'IKEPolicyCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileDiskInterface():
+class IKEPolicyPatch():
"""
- DedicatedHostProfileDiskInterface.
+ IKEPolicyPatch.
- :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 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 user-defined name for this IKE policy.
"""
def __init__(self,
- type: str,
- value: str) -> None:
+ *,
+ 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 DedicatedHostProfileDiskInterface object.
+ Initialize a IKEPolicyPatch 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 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 user-defined name for this IKE policy.
"""
- 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) -> 'DedicatedHostProfileDiskInterface':
- """Initialize a DedicatedHostProfileDiskInterface 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 DedicatedHostProfileDiskInterface JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
- else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskInterface 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 DedicatedHostProfileDiskInterface 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):
@@ -17963,83 +26583,117 @@ 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 IKEPolicyPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDiskInterface') -> 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: 'DedicatedHostProfileDiskInterface') -> 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):
+ class AuthenticationAlgorithmEnum(str, Enum):
"""
- The type for this profile field.
+ The authentication algorithm.
"""
- FIXED = 'fixed'
+ MD5 = 'md5'
+ SHA1 = 'sha1'
+ SHA256 = 'sha256'
+ SHA512 = 'sha512'
- class ValueEnum(str, Enum):
+ class EncryptionAlgorithmEnum(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.
+ The encryption algorithm.
"""
- NVME = 'nvme'
+ AES128 = 'aes128'
+ AES256 = 'aes256'
+ TRIPLE_DES = 'triple_des'
-class DedicatedHostProfileDiskQuantity():
+class IKEPolicyReference():
"""
- The number of disks of this type for a dedicated host with this profile.
+ IKEPolicyReference.
- :attr str type: The type for this profile field.
- :attr int value: The value for this profile field.
+ :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 user-defined name for this IKE policy.
+ :attr str resource_type: The resource type.
"""
def __init__(self,
- type: str,
- value: int) -> None:
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: 'IKEPolicyReferenceDeleted' = None) -> None:
"""
- Initialize a DedicatedHostProfileDiskQuantity object.
+ Initialize a IKEPolicyReference object.
- :param str type: The type for this profile field.
- :param int value: The value for this profile field.
+ :param str href: The IKE policy's canonical URL.
+ :param str id: The unique identifier for this IKE policy.
+ :param str name: The user-defined name for this IKE policy.
+ :param str 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.type = type
- self.value = value
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskQuantity':
- """Initialize a DedicatedHostProfileDiskQuantity object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IKEPolicyReference':
+ """Initialize a IKEPolicyReference object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ 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 \'type\' not present in DedicatedHostProfileDiskQuantity JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'href\' not present in IKEPolicyReference JSON')
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskQuantity JSON')
+ 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 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 DedicatedHostProfileDiskQuantity 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, '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:
+ _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):
@@ -18047,72 +26701,63 @@ 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 IKEPolicyReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDiskQuantity') -> 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: 'DedicatedHostProfileDiskQuantity') -> bool:
+ def __ne__(self, other: 'IKEPolicyReference') -> 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'
+ IKE_POLICY = 'ike_policy'
-class DedicatedHostProfileDiskSize():
+class IKEPolicyReferenceDeleted():
"""
- The size of the disk in GB (gigabytes).
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :attr str type: The type for this profile field.
- :attr int value: The size of the disk in GB (gigabytes).
+ :attr str more_info: Link to documentation about deleted resources.
"""
def __init__(self,
- type: str,
- value: int) -> None:
+ more_info: str) -> None:
"""
- Initialize a DedicatedHostProfileDiskSize object.
+ Initialize a IKEPolicyReferenceDeleted object.
- :param str type: The type for this profile field.
- :param int value: The size of the disk in GB (gigabytes).
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.type = type
- self.value = value
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'DedicatedHostProfileDiskSize':
- """Initialize a DedicatedHostProfileDiskSize object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IKEPolicyReferenceDeleted':
+ """Initialize a IKEPolicyReferenceDeleted 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 'more_info' in _dict:
+ args['more_info'] = _dict.get('more_info')
else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSize JSON')
+ raise ValueError('Required property \'more_info\' not present in IKEPolicyReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileDiskSize object from a json dictionary."""
+ """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, '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):
@@ -18120,74 +26765,64 @@ 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 IKEPolicyReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDiskSize') -> bool:
+ 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__
- def __ne__(self, other: 'DedicatedHostProfileDiskSize') -> bool:
+ def __ne__(self, other: 'IKEPolicyReferenceDeleted') -> 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 IP():
"""
- DedicatedHostProfileDiskSupportedInterfaces.
+ IP.
- :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 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: List[str]) -> None:
+ address: str) -> None:
"""
- Initialize a DedicatedHostProfileDiskSupportedInterfaces object.
+ Initialize a IP 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 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) -> 'DedicatedHostProfileDiskSupportedInterfaces':
- """Initialize a DedicatedHostProfileDiskSupportedInterfaces object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IP':
+ """Initialize a IP 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')
+ if 'address' in _dict:
+ args['address'] = _dict.get('address')
else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileDiskSupportedInterfaces JSON')
+ raise ValueError('Required property \'address\' not present in IP JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a DedicatedHostProfileDiskSupportedInterfaces 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):
@@ -18195,114 +26830,184 @@ 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 IP object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileDiskSupportedInterfaces') -> 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: 'DedicatedHostProfileDiskSupportedInterfaces') -> 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 ValueEnum(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 DedicatedHostProfileIdentity():
- """
- Identifies a dedicated host profile by a unique property.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a DedicatedHostProfileIdentity object.
-
- """
- 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.
-
- """
- 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 IPsecPolicy():
"""
- DedicatedHostProfileReference.
+ IPsecPolicy.
- :attr str href: The URL for this dedicated host.
- :attr str name: The globally unique name for this dedicated host profile.
+ :attr str authentication_algorithm: The authentication algorithm.
+ :attr List[VPNGatewayConnectionReference] connections: The VPN gateway
+ connections that use this IPsec policy.
+ :attr datetime created_at: The date and time that this IPsec policy was created.
+ :attr str encapsulation_mode: The encapsulation mode used. Only `tunnel` is
+ supported.
+ :attr str encryption_algorithm: The encryption algorithm.
+ :attr str href: The IPsec policy's canonical URL.
+ :attr str id: The unique identifier for this IPsec policy.
+ :attr int key_lifetime: The key lifetime in seconds.
+ :attr str name: The user-defined name for this IPsec policy.
+ :attr str pfs: Perfect Forward Secrecy.
+ :attr 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,
+ authentication_algorithm: str,
+ connections: List['VPNGatewayConnectionReference'],
+ created_at: datetime,
+ encapsulation_mode: str,
+ encryption_algorithm: str,
href: str,
- name: str) -> None:
+ id: str,
+ key_lifetime: int,
+ name: str,
+ pfs: str,
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ transform_protocol: str) -> None:
"""
- Initialize a DedicatedHostProfileReference object.
+ Initialize a IPsecPolicy object.
- :param str href: The URL for this dedicated host.
- :param str name: The globally unique name for this dedicated host profile.
+ :param str authentication_algorithm: The authentication algorithm.
+ :param List[VPNGatewayConnectionReference] connections: The VPN gateway
+ connections that use this IPsec policy.
+ :param datetime created_at: The date and time that this IPsec policy was
+ created.
+ :param str encapsulation_mode: The encapsulation mode used. Only `tunnel`
+ is supported.
+ :param str encryption_algorithm: The encryption algorithm.
+ :param str href: The IPsec policy's canonical URL.
+ :param str id: The unique identifier for this IPsec policy.
+ :param int key_lifetime: The key lifetime in seconds.
+ :param str name: The user-defined name for this IPsec policy.
+ :param str pfs: Perfect Forward Secrecy.
+ :param 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.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) -> 'DedicatedHostProfileReference':
- """Initialize a DedicatedHostProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'IPsecPolicy':
+ """Initialize a IPsecPolicy 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(x) for x 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')
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 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 DedicatedHostProfileReference JSON')
+ 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 DedicatedHostProfileReference 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, 'authentication_algorithm') and self.authentication_algorithm is not None:
+ _dict['authentication_algorithm'] = self.authentication_algorithm
+ if hasattr(self, 'connections') and self.connections is not None:
+ _dict['connections'] = [x.to_dict() for x in self.connections]
+ 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:
+ _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):
@@ -18310,252 +27015,152 @@ 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 IPsecPolicy object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'DedicatedHostProfileReference') -> 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: 'DedicatedHostProfileReference') -> bool:
+ def __ne__(self, other: 'IPsecPolicy') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class DedicatedHostProfileSocket():
- """
- DedicatedHostProfileSocket.
-
- """
-
- def __init__(self) -> None:
+ class AuthenticationAlgorithmEnum(str, Enum):
"""
- Initialize a DedicatedHostProfileSocket object.
-
+ The authentication algorithm.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['DedicatedHostProfileSocketFixed', 'DedicatedHostProfileSocketRange', 'DedicatedHostProfileSocketEnum', 'DedicatedHostProfileSocketDependent']))
- raise Exception(msg)
-
-class DedicatedHostProfileVCPU():
- """
- DedicatedHostProfileVCPU.
+ MD5 = 'md5'
+ SHA1 = 'sha1'
+ SHA256 = 'sha256'
+ SHA512 = 'sha512'
- """
- def __init__(self) -> None:
+ class EncapsulationModeEnum(str, Enum):
"""
- Initialize a DedicatedHostProfileVCPU object.
-
+ The encapsulation mode used. Only `tunnel` is supported.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['DedicatedHostProfileVCPUFixed', 'DedicatedHostProfileVCPURange', 'DedicatedHostProfileVCPUEnum', 'DedicatedHostProfileVCPUDependent']))
- raise Exception(msg)
-
-class DedicatedHostProfileVCPUArchitecture():
- """
- DedicatedHostProfileVCPUArchitecture.
+ TUNNEL = 'tunnel'
- :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,
- type: str,
- value: str) -> None:
+ class EncryptionAlgorithmEnum(str, Enum):
"""
- Initialize a DedicatedHostProfileVCPUArchitecture object.
-
- :param str type: The type for this profile field.
- :param str value: The VCPU architecture for a dedicated host with this
- profile.
+ The encryption algorithm.
"""
- self.type = type
- self.value = value
-
- @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')
- else:
- raise ValueError('Required property \'value\' not present in DedicatedHostProfileVCPUArchitecture JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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 DedicatedHostProfileVCPUArchitecture object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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__
+ AES128 = 'aes128'
+ AES256 = 'aes256'
+ TRIPLE_DES = 'triple_des'
- def __ne__(self, other: 'DedicatedHostProfileVCPUArchitecture') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
- class TypeEnum(str, Enum):
+ class PfsEnum(str, Enum):
"""
- The type for this profile field.
+ Perfect Forward Secrecy.
"""
- FIXED = 'fixed'
-
-
-class DedicatedHostPrototype():
- """
- DedicatedHostPrototype.
-
- :attr bool instance_placement_enabled: (optional) If set to true, instances can
- be placed on this dedicated host.
- :attr str name: (optional) The unique user-defined name for this dedicated host.
- If unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr DedicatedHostProfileIdentity profile: The profile 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.
- """
+ DISABLED = 'disabled'
+ GROUP_14 = 'group_14'
+ GROUP_19 = 'group_19'
+ GROUP_2 = 'group_2'
+ GROUP_5 = 'group_5'
- def __init__(self,
- profile: 'DedicatedHostProfileIdentity',
- *,
- instance_placement_enabled: bool = None,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None) -> None:
+
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a DedicatedHostPrototype object.
+ The resource type.
+ """
+ IPSEC_POLICY = 'ipsec_policy'
- :param DedicatedHostProfileIdentity profile: The profile 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 unique user-defined name for this dedicated
- host. 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.
+
+ class TransformProtocolEnum(str, Enum):
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['DedicatedHostPrototypeDedicatedHostByGroup', 'DedicatedHostPrototypeDedicatedHostByZone']))
- raise Exception(msg)
+ The transform protocol used. Only `esp` is supported.
+ """
+ ESP = 'esp'
-class DedicatedHostReference():
+
+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 unique user-defined name for this dedicated host.
- :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) -> 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 unique user-defined name for this dedicated host.
- :param str resource_type: The resource type.
- :param DedicatedHostReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted and provides
- 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(x) for x 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:
- _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, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'ipsec_policies') and self.ipsec_policies is not None:
+ _dict['ipsec_policies'] = [x.to_dict() for x in self.ipsec_policies]
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -18563,63 +27168,55 @@ 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) -> None:
+ 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):
@@ -18627,152 +27224,56 @@ 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
- user-specified with a subsequent request.
- :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 is a part of.
+ :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:
+ href: str) -> 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 user-specified with a subsequent request.
- :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 is a part of.
+ :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(x) for x in _dict.get('rules')]
- else:
- raise ValueError('Required property \'rules\' not present in DefaultNetworkACL JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
- 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:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- _dict['rules'] = [x.to_dict() for x in self.rules]
- if hasattr(self, 'subnets') and self.subnets is not None:
- _dict['subnets'] = [x.to_dict() for x in self.subnets]
- if hasattr(self, 'vpc') and self.vpc is not None:
- _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -18780,223 +27281,87 @@ 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 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 user-specified with a subsequent request.
- :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 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.
- :attr bool route_transit_gateway_ingress: Indicates whether this routing table
- is used to route traffic that originates from from [Transit
- Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address within the VPC's address prefix ranges. Therefore,
- if an incoming packet matches a route with a `next_hop` of an internet-bound IP
- address or a VPN gateway connection, the packet will be dropped.
- :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used
- to route traffic that originates from subnets in other zones in this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address within the VPC's address prefix ranges. Therefore,
- if an incoming packet matches a route with a `next_hop` of an internet-bound IP
- address or a VPN gateway connection, the packet will be dropped.
- :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.
+ :attr str encryption_algorithm: (optional) The encryption algorithm.
+ :attr int key_lifetime: (optional) The key lifetime in seconds.
+ :attr str name: (optional) The user-defined name for this IPsec policy.
+ :attr str pfs: (optional) Perfect Forward Secrecy.
"""
def __init__(self,
- created_at: datetime,
- href: str,
- id: str,
- is_default: bool,
- lifecycle_state: str,
- name: str,
- resource_type: str,
- route_direct_link_ingress: bool,
- route_transit_gateway_ingress: bool,
- route_vpc_zone_ingress: bool,
- routes: List['RouteReference'],
- subnets: List['SubnetReference']) -> None:
+ *,
+ 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 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 user-specified with a subsequent request.
- :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 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.
- :param bool route_transit_gateway_ingress: Indicates whether this routing
- table is used to route traffic that originates from from [Transit
- Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address within the VPC's address prefix
- ranges. Therefore, if an incoming packet matches a route with a `next_hop`
- of an internet-bound IP address or a VPN gateway connection, the packet
- will be dropped.
- :param bool route_vpc_zone_ingress: Indicates whether this routing table is
- used to route traffic that originates from subnets in other zones in this
- VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address within the VPC's address prefix
- ranges. Therefore, if an incoming packet matches a route with a `next_hop`
- of an internet-bound IP address or a VPN gateway connection, the packet
- will be dropped.
- :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.
+ :param str encryption_algorithm: (optional) The encryption algorithm.
+ :param int key_lifetime: (optional) The key lifetime in seconds.
+ :param str name: (optional) The user-defined name for this IPsec policy.
+ :param str pfs: (optional) Perfect Forward Secrecy.
"""
- 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_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) -> 'DefaultRoutingTable':
- """Initialize a DefaultRoutingTable 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 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 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_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(x) for x in _dict.get('routes')]
- else:
- raise ValueError('Required property \'routes\' not present in DefaultRoutingTable JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
- else:
- raise ValueError('Required property \'subnets\' not present in DefaultRoutingTable JSON')
+ self.pfs = pfs
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'IPsecPolicyPatch':
+ """Initialize a IPsecPolicyPatch 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')
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, '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_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:
- _dict['routes'] = [x.to_dict() for x in self.routes]
- if hasattr(self, 'subnets') and self.subnets is not None:
- _dict['subnets'] = [x.to_dict() for x in self.subnets]
+ if hasattr(self, 'pfs') and self.pfs is not None:
+ _dict['pfs'] = self.pfs
return _dict
def _to_dict(self):
@@ -19004,160 +27369,128 @@ 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.
"""
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
+ MD5 = 'md5'
+ SHA1 = 'sha1'
+ SHA256 = 'sha256'
+ SHA512 = 'sha512'
- class ResourceTypeEnum(str, Enum):
+ class EncryptionAlgorithmEnum(str, Enum):
"""
- The resource type.
+ The encryption algorithm.
"""
- ROUTING_TABLE = 'routing_table'
+ AES128 = 'aes128'
+ AES256 = 'aes256'
+ TRIPLE_DES = 'triple_des'
-class DefaultSecurityGroup():
+ class PfsEnum(str, Enum):
+ """
+ Perfect Forward Secrecy.
+ """
+ DISABLED = 'disabled'
+ GROUP_14 = 'group_14'
+ GROUP_19 = 'group_19'
+ GROUP_2 = 'group_2'
+ GROUP_5 = 'group_5'
+
+
+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 of the default security group created for a VPC. The
- name will be a hyphenated list of randomly-selected words at creation, but may
- be user-specified with a subsequent request.
- :attr 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 VPCReference vpc: The VPC this security group is a part of.
+ :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 user-defined name for this IPsec policy.
+ :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'],
- vpc: 'VPCReference') -> None:
+ 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 of the default security group created for a VPC.
- The name will be a hyphenated list of randomly-selected words at creation,
- but may be user-specified with a subsequent request.
- :param 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 VPCReference vpc: The VPC this security group is a part of.
+ :param str href: The IPsec policy's canonical URL.
+ :param str id: The unique identifier for this IPsec policy.
+ :param str name: The user-defined name for this IPsec policy.
+ :param str 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.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(x) for x in _dict.get('rules')]
- else:
- raise ValueError('Required property \'rules\' 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:
+ _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:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- _dict['rules'] = [x.to_dict() for x in self.rules]
- if hasattr(self, 'vpc') and self.vpc is not None:
- _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):
@@ -19165,78 +27498,63 @@ 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 Service 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) -> None:
+ 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 Service 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):
@@ -19244,178 +27562,221 @@ 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`: Healthy
- - `degraded`: Suffering from 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 unique user-defined name for this endpoint gateway.
- :attr ResourceGroupReference resource_group: The resource group for this
- endpoint gateway.
- :attr str resource_type: The resource type.
- :attr str service_endpoint: (optional) 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 is serving.
+ :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`,
+ `tentative`, or
+ `failed`.
+ :attr str name: The user-defined or system-provided name for this image.
+ :attr OperatingSystem operating_system: (optional) The operating system included
+ in this image.
+ :attr ResourceGroupReference resource_group: The resource group for this image.
+ :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 can be used, but is slated to become `obsolete`
+ (provisionable)
+ - failed: image is corrupt or did not pass validation
+ - obsolete: image can no longer be used to provision new resources
+ - pending: image is being imported and is not yet `available`
+ - tentative: image import has timed out (contact support)
+ - unusable: image cannot be used (see `status_reasons[]` for possible
+ remediation)
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ 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).
+ 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: Whether the image is publicly visible or private to the
+ account.
"""
def __init__(self,
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,
- service_endpoints: List[str],
- target: 'EndpointGatewayTarget',
- vpc: 'VPCReference',
+ status: str,
+ status_reasons: List['ImageStatusReason'],
+ visibility: str,
*,
- service_endpoint: str = None) -> None:
+ encryption_key: 'EncryptionKeyReference' = None,
+ minimum_provisioned_size: int = 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`: Healthy
- - `degraded`: Suffering from 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 unique user-defined name for this endpoint gateway.
+ :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 user-defined or system-provided name for this image.
:param ResourceGroupReference resource_group: The resource group for this
- endpoint gateway.
- :param str resource_type: The resource type.
- :param List[str] service_endpoints: The fully qualified domain names for
- the target service.
- :param EndpointGatewayTarget target: The target for this endpoint gateway.
- :param VPCReference vpc: The VPC this endpoint gateway is serving.
- :param str service_endpoint: (optional) The fully qualified domain name for
- the target service.
+ image.
+ :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 can be used, but is slated to become `obsolete`
+ (provisionable)
+ - failed: image is corrupt or did not pass validation
+ - obsolete: image can no longer be used to provision new resources
+ - pending: image is being imported and is not yet `available`
+ - tentative: image import has timed out (contact support)
+ - unusable: image cannot be used (see `status_reasons[]` for possible
+ remediation)
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt 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).
+ 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: Whether the image is publicly visible or private to
+ the account.
+ :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`,
+ `tentative`, 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.
"""
self.created_at = created_at
self.crn = crn
- self.health_state = health_state
+ 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.operating_system = operating_system
self.resource_group = resource_group
- self.resource_type = resource_type
- 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 '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 '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(x) for x 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 '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')
- 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 '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 \'service_endpoints\' not present in EndpointGateway JSON')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ raise ValueError('Required property \'resource_group\' 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 \'target\' not present in EndpointGateway JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
+ raise ValueError('Required property \'status\' not present in Image JSON')
+ if 'status_reasons' in _dict:
+ args['status_reasons'] = [ImageStatusReason.from_dict(x) for x in _dict.get('status_reasons')]
else:
- raise ValueError('Required property \'vpc\' not present in EndpointGateway JSON')
+ 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')
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:
@@ -19425,33 +27786,32 @@ 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, 'health_state') and self.health_state is not None:
- _dict['health_state'] = self.health_state
+ if hasattr(self, 'encryption') and self.encryption is not None:
+ _dict['encryption'] = self.encryption
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'file') and self.file is not None:
+ _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:
- _dict['ips'] = [x.to_dict() for x in self.ips]
- 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, 'operating_system') and self.operating_system is not None:
+ _dict['operating_system'] = self.operating_system.to_dict()
if hasattr(self, 'resource_group') and self.resource_group is not None:
_dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- 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:
- _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'source_volume') and self.source_volume is not None:
+ _dict['source_volume'] = self.source_volume.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons]
+ if hasattr(self, 'visibility') and self.visibility is not None:
+ _dict['visibility'] = self.visibility
return _dict
def _to_dict(self):
@@ -19459,140 +27819,133 @@ 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`: Healthy
- - `degraded`: Suffering from 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 StatusEnum(str, Enum):
"""
- The lifecycle state of the endpoint gateway.
+ 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 can be used, but is slated to become `obsolete`
+ (provisionable)
+ - failed: image is corrupt or did not pass validation
+ - obsolete: image can no longer be used to provision new resources
+ - pending: image is being imported and is not yet `available`
+ - tentative: image import has timed out (contact support)
+ - unusable: image cannot be used (see `status_reasons[]` for possible remediation)
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ 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'
PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
+ TENTATIVE = 'tentative'
+ UNUSABLE = 'unusable'
- class ResourceTypeEnum(str, Enum):
+ class VisibilityEnum(str, Enum):
"""
- The resource type.
+ Whether the image is publicly visible or private to the account.
"""
- ENDPOINT_GATEWAY = 'endpoint_gateway'
+ PRIVATE = 'private'
+ PUBLIC = 'public'
-class EndpointGatewayCollection():
+class ImageCollection():
"""
- EndpointGatewayCollection.
+ ImageCollection.
- :attr List[EndpointGateway] endpoint_gateways: Collection of endpoint gateways.
- :attr EndpointGatewayCollectionFirst first: A link to the first page of
- resources.
+ :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) -> 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(x) for x 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(x) for x 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'))
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
- else:
- raise ValueError('Required property \'total_count\' not present in EndpointGatewayCollection JSON')
+ args['next'] = ImageCollectionNext.from_dict(_dict.get('next'))
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:
- _dict['endpoint_gateways'] = [x.to_dict() for x in self.endpoint_gateways]
if hasattr(self, 'first') and self.first is not None:
_dict['first'] = self.first.to_dict()
+ if hasattr(self, 'images') and self.images is not None:
+ _dict['images'] = [x.to_dict() for x in self.images]
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -19600,20 +27953,20 @@ 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.
@@ -19623,25 +27976,25 @@ class EndpointGatewayCollectionFirst():
def __init__(self,
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) -> 'EndpointGatewayCollectionFirst':
- """Initialize a EndpointGatewayCollectionFirst object from a json dictionary."""
+ 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 EndpointGatewayCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in ImageCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayCollectionFirst object from a json dictionary."""
+ """Initialize a ImageCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -19656,20 +28009,20 @@ 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 ImageCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayCollectionFirst') -> bool:
+ 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: 'EndpointGatewayCollectionFirst') -> bool:
+ def __ne__(self, other: 'ImageCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class EndpointGatewayCollectionNext():
+class ImageCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -19680,25 +28033,25 @@ class EndpointGatewayCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a EndpointGatewayCollectionNext object.
+ Initialize a ImageCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayCollectionNext':
- """Initialize a EndpointGatewayCollectionNext object from a json dictionary."""
+ 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 EndpointGatewayCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in ImageCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayCollectionNext object from a json dictionary."""
+ """Initialize a ImageCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -19713,57 +28066,77 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this EndpointGatewayCollectionNext object."""
+ """Return a `str` version of this ImageCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayCollectionNext') -> bool:
+ 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: 'EndpointGatewayCollectionNext') -> bool:
+ def __ne__(self, other: 'ImageCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class EndpointGatewayPatch():
+class ImageFile():
"""
- EndpointGatewayPatch.
+ ImageFile.
- :attr str name: (optional) The user-defined name for this endpoint gateway.
- Names must be unique within the VPC this endpoint gateway is serving.
+ :attr 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,
*,
- name: str = None) -> None:
+ checksums: 'ImageFileChecksums' = None,
+ size: int = None) -> None:
"""
- Initialize a EndpointGatewayPatch object.
+ Initialize a ImageFile object.
- :param str name: (optional) The user-defined name for this endpoint
- gateway. Names must be unique within the VPC this endpoint gateway is
- serving.
+ :param 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.name = name
+ self.checksums = checksums
+ self.size = size
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayPatch':
- """Initialize a EndpointGatewayPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageFile':
+ """Initialize a ImageFile object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ 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 EndpointGatewayPatch 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, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'checksums') and self.checksums is not None:
+ _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):
@@ -19771,56 +28144,54 @@ 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 ImageFile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayPatch') -> 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: 'EndpointGatewayPatch') -> bool:
+ def __ne__(self, other: 'ImageFile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class EndpointGatewayReferenceDeleted():
+class ImageFileChecksums():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ ImageFileChecksums.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr str sha256: (optional) The SHA256 fingerprint of the image file.
"""
def __init__(self,
- more_info: str) -> None:
+ *,
+ sha256: str = None) -> None:
"""
- Initialize a EndpointGatewayReferenceDeleted object.
+ Initialize a ImageFileChecksums object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str sha256: (optional) The SHA256 fingerprint of the image file.
"""
- self.more_info = more_info
+ self.sha256 = sha256
@classmethod
- def from_dict(cls, _dict: Dict) -> 'EndpointGatewayReferenceDeleted':
- """Initialize a EndpointGatewayReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageFileChecksums':
+ """Initialize a ImageFileChecksums 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 EndpointGatewayReferenceDeleted JSON')
+ if 'sha256' in _dict:
+ args['sha256'] = _dict.get('sha256')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a EndpointGatewayReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'sha256') and self.sha256 is not None:
+ _dict['sha256'] = self.sha256
return _dict
def _to_dict(self):
@@ -19828,242 +28199,55 @@ 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 ImageFileChecksums object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'EndpointGatewayReferenceDeleted') -> 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: 'EndpointGatewayReferenceDeleted') -> bool:
+ def __ne__(self, other: 'ImageFileChecksums') -> 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 for this endpoint gateway.
-
- :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():
+class ImageFilePrototype():
"""
- FloatingIP.
+ ImageFilePrototype.
- :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 unique user-defined name for this floating IP.
- :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 str href: The Cloud Object Store (COS) location of the image file.
"""
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:
+ href: str) -> None:
"""
- Initialize a FloatingIP object.
+ Initialize a ImageFilePrototype 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 unique user-defined name for this floating IP.
- :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.
+ :param str href: The Cloud Object Store (COS) location of the image file.
"""
- 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."""
+ def from_dict(cls, _dict: Dict) -> 'ImageFilePrototype':
+ """Initialize a ImageFilePrototype 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')
+ raise ValueError('Required property \'href\' not present in ImageFilePrototype 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
+ """Initialize a ImageFilePrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _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:
- _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -20071,126 +28255,71 @@ 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 ImageFilePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIP') -> 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: 'FloatingIP') -> bool:
+ def __ne__(self, other: 'ImageFilePrototype') -> 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 FloatingIPByTargetNetworkInterfaceIdentity():
+class ImageIdentity():
"""
- The network interface this floating IP is to be bound to.
+ Identifies an image by a unique property.
"""
def __init__(self) -> None:
"""
- Initialize a FloatingIPByTargetNetworkInterfaceIdentity object.
+ Initialize a ImageIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPByTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref']))
+ ", ".join(['ImageIdentityById', 'ImageIdentityByCRN', 'ImageIdentityByHref']))
raise Exception(msg)
-class FloatingIPCollection():
+class ImagePatch():
"""
- FloatingIPCollection.
+ ImagePatch.
- :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 str name: (optional) The unique user-defined name for this image. Names
+ starting with `ibm-` are not allowed.
"""
def __init__(self,
- first: 'FloatingIPCollectionFirst',
- floating_ips: List['FloatingIP'],
- limit: int,
- total_count: int,
*,
- next: 'FloatingIPCollectionNext' = None) -> None:
+ name: str = None) -> None:
"""
- Initialize a FloatingIPCollection object.
+ Initialize a ImagePatch 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 str name: (optional) The unique user-defined name for this image.
+ Names starting with `ibm-` are not allowed.
"""
- self.first = first
- self.floating_ips = floating_ips
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPCollection':
- """Initialize a FloatingIPCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImagePatch':
+ """Initialize a ImagePatch 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(x) for x 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 'name' in _dict:
+ args['name'] = _dict.get('name')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPCollection 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'floating_ips') and self.floating_ips is not None:
- _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips]
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -20198,55 +28327,129 @@ 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 ImagePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPCollection') -> 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: 'FloatingIPCollection') -> bool:
+ def __ne__(self, other: 'ImagePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPCollectionFirst():
+class ImagePrototype():
"""
- A link to the first page of resources.
+ ImagePrototype.
- :attr str href: The URL for a page of resources.
+ :attr str name: (optional) The unique user-defined name for this image. Names
+ starting with `ibm-` are not allowed. If unspecified, the name will be a
+ 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,
- href: str) -> None:
+ *,
+ name: str = None,
+ resource_group: 'ResourceGroupIdentity' = None) -> None:
"""
- Initialize a FloatingIPCollectionFirst object.
+ Initialize a ImagePrototype object.
- :param str href: The URL for a page of resources.
+ :param str name: (optional) The unique user-defined name for this image.
+ Names starting with `ibm-` are not allowed. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param 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 user-defined or system-provided name for this image.
+ """
+
+ def __init__(self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: 'ImageReferenceDeleted' = None) -> None:
+ """
+ Initialize a ImageReference 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 user-defined or system-provided name for this image.
+ :param ImageReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted and provides
+ 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) -> 'FloatingIPCollectionFirst':
- """Initialize a FloatingIPCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageReference':
+ """Initialize a ImageReference 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 FloatingIPCollectionFirst 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 ImageReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ else:
+ raise ValueError('Required property \'name\' not present in ImageReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPCollectionFirst 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, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -20254,56 +28457,56 @@ 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 ImageReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPCollectionFirst') -> 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: 'FloatingIPCollectionFirst') -> bool:
+ def __ne__(self, other: 'ImageReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPCollectionNext():
+class ImageReferenceDeleted():
"""
- 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) -> None:
+ more_info: str) -> None:
"""
- Initialize a FloatingIPCollectionNext object.
+ Initialize a ImageReferenceDeleted 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) -> 'FloatingIPCollectionNext':
- """Initialize a FloatingIPCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageReferenceDeleted':
+ """Initialize a ImageReferenceDeleted 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 FloatingIPCollectionNext JSON')
+ raise ValueError('Required property \'more_info\' not present in ImageReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPCollectionNext object from a json dictionary."""
+ """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, '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):
@@ -20311,75 +28514,76 @@ 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 ImageReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPCollectionNext') -> bool:
+ 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: 'FloatingIPCollectionNext') -> bool:
+ def __ne__(self, other: 'ImageReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPPatch():
+class ImageStatusReason():
"""
- FloatingIPPatch.
+ ImageStatusReason.
- :attr str name: (optional) The unique user-defined name for this floating IP.
- :attr FloatingIPPatchTargetNetworkInterfaceIdentity target: (optional) A new
- network interface to bind this floating IP to, replacing any existing binding.
- For this request to succeed, the existing floating IP must not be required by
- another
- resource, such as a public gateway.
+ :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,
*,
- name: str = None,
- target: 'FloatingIPPatchTargetNetworkInterfaceIdentity' = None) -> None:
+ more_info: str = None) -> None:
"""
- Initialize a FloatingIPPatch object.
+ Initialize a ImageStatusReason object.
- :param str name: (optional) The unique user-defined name for this floating
- IP.
- :param FloatingIPPatchTargetNetworkInterfaceIdentity target: (optional) A
- new network interface to bind this floating IP to, replacing any existing
- binding.
- For this request to succeed, the existing floating IP must not be required
- by another
- resource, such as a public gateway.
+ :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.name = name
- self.target = target
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPPatch':
- """Initialize a FloatingIPPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ImageStatusReason':
+ """Initialize a ImageStatusReason object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FloatingIPPatch 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, '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, '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):
@@ -20387,155 +28591,364 @@ 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 ImageStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPPatch') -> 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: 'FloatingIPPatch') -> bool:
+ def __ne__(self, other: 'ImageStatusReason') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPPatchTargetNetworkInterfaceIdentity():
- """
- A new network interface to bind this floating IP to, replacing any existing binding.
- For this request to succeed, the existing floating IP must not be required by another
- resource, such as a public gateway.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a FloatingIPPatchTargetNetworkInterfaceIdentity object.
-
+ class CodeEnum(str, Enum):
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById', 'FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref']))
- raise Exception(msg)
-
-class FloatingIPPrototype():
- """
- FloatingIPPrototype.
-
- :attr str name: (optional) The unique user-defined name for this floating IP. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr 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:
+ A snake case string succinctly identifying the status reason.
"""
- Initialize a FloatingIPPrototype object.
+ ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
+ ENCRYPTION_KEY_DISABLED = 'encryption_key_disabled'
+ IMAGE_REQUEST_IN_PROGRESS = 'image_request_in_progress'
+ IMAGE_REQUEST_QUEUED = 'image_request_queued'
- :param str name: (optional) The unique user-defined name for this floating
- IP. If unspecified, the name will be a hyphenated list of randomly-selected
- words.
- :param 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']))
- raise Exception(msg)
-class FloatingIPReference():
+class Instance():
"""
- FloatingIPReference.
+ Instance.
- :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 unique user-defined name for this floating IP.
+ :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 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 int memory: The amount of memory, truncated to whole gibibytes.
+ :attr str name: The user-defined name for this virtual server instance (and
+ default system hostname).
+ :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 for this virtual server
+ instance.
+ :attr ResourceGroupReference resource_group: The resource group for this
+ instance.
+ :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.
+ :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,
- address: str,
+ bandwidth: int,
+ boot_volume_attachment: 'VolumeAttachmentReferenceInstanceContext',
+ created_at: datetime,
crn: str,
+ disks: List['InstanceDisk'],
href: str,
id: str,
+ memory: int,
name: str,
+ network_interfaces: List['NetworkInterfaceInstanceContextReference'],
+ primary_network_interface: 'NetworkInterfaceInstanceContextReference',
+ profile: 'InstanceProfileReference',
+ resource_group: 'ResourceGroupReference',
+ 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',
*,
- deleted: 'FloatingIPReferenceDeleted' = None) -> None:
+ dedicated_host: 'DedicatedHostReference' = None,
+ gpu: 'InstanceGPU' = None,
+ image: 'ImageReference' = None,
+ placement_target: 'InstancePlacementTarget' = None) -> None:
"""
- Initialize a FloatingIPReference object.
+ Initialize a Instance 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 unique user-defined name for this floating IP.
- :param FloatingIPReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted and provides
- some supplementary information.
+ :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 int memory: The amount of memory, truncated to whole gibibytes.
+ :param str name: The user-defined name for this virtual server instance
+ (and default system hostname).
+ :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 for this virtual
+ server instance.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance.
+ :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.
+ :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 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.address = address
+ self.bandwidth = bandwidth
+ self.boot_volume_attachment = boot_volume_attachment
+ self.created_at = created_at
self.crn = crn
- self.deleted = deleted
+ self.dedicated_host = dedicated_host
+ self.disks = disks
+ self.gpu = gpu
self.href = href
self.id = id
+ self.image = image
+ self.memory = memory
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.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) -> 'FloatingIPReference':
- """Initialize a FloatingIPReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Instance':
+ """Initialize a Instance object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if 'bandwidth' in _dict:
+ args['bandwidth'] = _dict.get('bandwidth')
else:
- raise ValueError('Required property \'address\' not present in FloatingIPReference 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 '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 FloatingIPReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = FloatingIPReferenceDeleted.from_dict(_dict.get('deleted'))
+ 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(x) for x 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 FloatingIPReference JSON')
+ 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 FloatingIPReference JSON')
+ raise ValueError('Required property \'id\' not present in Instance JSON')
+ if 'image' in _dict:
+ args['image'] = ImageReference.from_dict(_dict.get('image'))
+ if 'memory' in _dict:
+ args['memory'] = _dict.get('memory')
+ else:
+ raise ValueError('Required property \'memory\' not present in Instance 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 Instance JSON')
+ if 'network_interfaces' in _dict:
+ args['network_interfaces'] = [NetworkInterfaceInstanceContextReference.from_dict(x) for x 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 '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(x) for x 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(x) for x in _dict.get('volume_attachments')]
+ else:
+ 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 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 FloatingIPReference 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, 'address') and self.address is not None:
- _dict['address'] = self.address
+ if hasattr(self, 'bandwidth') and self.bandwidth is not None:
+ _dict['bandwidth'] = self.bandwidth
+ if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
+ _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
+ if 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:
- _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'dedicated_host') and self.dedicated_host is not None:
+ _dict['dedicated_host'] = self.dedicated_host.to_dict()
+ if hasattr(self, 'disks') and self.disks is not None:
+ _dict['disks'] = [x.to_dict() for x in self.disks]
+ if hasattr(self, 'gpu') and self.gpu is not None:
+ _dict['gpu'] = self.gpu.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'image') and self.image is not None:
+ _dict['image'] = self.image.to_dict()
+ if 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:
+ _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
+ if hasattr(self, 'placement_target') and self.placement_target is not None:
+ if isinstance(self.placement_target, dict):
+ _dict['placement_target'] = self.placement_target
+ else:
+ _dict['placement_target'] = self.placement_target.to_dict()
+ if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
+ _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ 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:
+ _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons]
+ if hasattr(self, 'total_network_bandwidth') and self.total_network_bandwidth is not None:
+ _dict['total_network_bandwidth'] = self.total_network_bandwidth
+ if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
+ _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'vcpu') and self.vcpu is not None:
+ _dict['vcpu'] = self.vcpu.to_dict()
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments]
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -20543,316 +28956,143 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FloatingIPReference object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'FloatingIPReference') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class FloatingIPReferenceDeleted():
- """
- 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 FloatingIPReferenceDeleted 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."""
- 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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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 FloatingIPReferenceDeleted object."""
+ """Return a `str` version of this Instance object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FloatingIPReferenceDeleted') -> 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: 'FloatingIPReferenceDeleted') -> bool:
+ def __ne__(self, other: 'Instance') -> 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 FloatingIPUnpaginatedCollection():
- """
- FloatingIPUnpaginatedCollection.
-
- :attr List[FloatingIP] floating_ips: Collection of floating IPs.
- """
-
- def __init__(self,
- floating_ips: List['FloatingIP']) -> None:
+ class StatusEnum(str, Enum):
"""
- Initialize a FloatingIPUnpaginatedCollection object.
-
- :param List[FloatingIP] floating_ips: Collection of floating IPs.
+ The status of the virtual server instance.
"""
- 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(x) for x 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:
- _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips]
- return _dict
-
- def _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__
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PAUSED = 'paused'
+ PAUSING = 'pausing'
+ PENDING = 'pending'
+ RESTARTING = 'restarting'
+ RESUMING = 'resuming'
+ RUNNING = 'running'
+ STARTING = 'starting'
+ STOPPED = 'stopped'
+ STOPPING = 'stopping'
- def __ne__(self, other: 'FloatingIPUnpaginatedCollection') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class FlowLogCollector():
+class InstanceAction():
"""
- FlowLogCollector.
+ InstanceAction.
- :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 unique user-defined name for this flow log collector.
- :attr ResourceGroupReference resource_group: The resource group for this flow
- log collector.
- :attr CloudObjectStorageBucketReference storage_bucket: The Cloud Object Storage
- bucket where the collected flows are logged.
- :attr FlowLogCollectorTarget target: The target this collector is collecting
- flow logs for. If the target is an instance,
- subnet, or VPC, flow logs will not be collected for any network interfaces
- within the
- target that are themselves the target of a more specific flow log collector.
- :attr VPCReference vpc: The VPC this flow log collector is associated with.
+ :attr datetime completed_at: (optional) The date and time that the action was
+ completed.
+ :attr datetime created_at: The date and time that the action was created.
+ :attr bool force: (optional) If set to true, the action will be forced
+ immediately, and all queued actions deleted. Ignored for the start action.
+ :attr str href: The URL for this instance action.
+ :attr str id: The identifier for this instance action.
+ :attr datetime started_at: (optional) The date and time that the action was
+ started.
+ :attr str status: The current status of this action.
+ :attr str type: The type of action.
"""
def __init__(self,
- active: bool,
- auto_delete: bool,
created_at: datetime,
- crn: str,
href: str,
id: str,
- lifecycle_state: str,
- name: str,
- resource_group: 'ResourceGroupReference',
- storage_bucket: 'CloudObjectStorageBucketReference',
- target: 'FlowLogCollectorTarget',
- vpc: 'VPCReference') -> None:
+ status: str,
+ type: str,
+ *,
+ completed_at: datetime = None,
+ force: bool = None,
+ started_at: datetime = None) -> None:
"""
- Initialize a FlowLogCollector object.
+ Initialize a InstanceAction 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 unique user-defined name for this flow log collector.
- :param ResourceGroupReference resource_group: The resource group for this
- flow log collector.
- :param CloudObjectStorageBucketReference storage_bucket: The Cloud Object
- Storage bucket where the collected flows are logged.
- :param FlowLogCollectorTarget target: The target this collector is
- collecting flow logs for. If the target is an instance,
- subnet, or VPC, flow logs will not be collected for any network interfaces
- within the
- target that are themselves the target of a more specific flow log
- collector.
- :param VPCReference vpc: The VPC this flow log collector is associated
- with.
+ :param datetime created_at: The date and time that the action was created.
+ :param str href: The URL for this instance action.
+ :param str id: The identifier for this instance action.
+ :param str status: The current status of this action.
+ :param str type: The type of action.
+ :param datetime completed_at: (optional) The date and time that the action
+ was completed.
+ :param bool force: (optional) If set to true, the action will be forced
+ immediately, and all queued actions deleted. Ignored for the start action.
+ :param datetime started_at: (optional) The date and time that the action
+ was started.
"""
- self.active = active
- self.auto_delete = auto_delete
+ self.completed_at = completed_at
self.created_at = created_at
- self.crn = crn
+ self.force = force
self.href = href
self.id = id
- self.lifecycle_state = lifecycle_state
- self.name = name
- self.resource_group = resource_group
- self.storage_bucket = storage_bucket
- self.target = target
- self.vpc = vpc
+ self.started_at = started_at
+ self.status = status
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollector':
- """Initialize a FlowLogCollector object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceAction':
+ """Initialize a InstanceAction 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 '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 FlowLogCollector 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 \'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 FlowLogCollector 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 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 FlowLogCollector 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 FlowLogCollector 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 FlowLogCollector JSON')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ 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 \'target\' not present in FlowLogCollector JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
+ raise ValueError('Required property \'status\' not present in InstanceAction JSON')
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
else:
- raise ValueError('Required property \'vpc\' not present in FlowLogCollector JSON')
+ raise ValueError('Required property \'type\' not present in InstanceAction JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollector 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, '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, '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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
+ 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, 'lifecycle_state') and self.lifecycle_state is not None:
- _dict['lifecycle_state'] = self.lifecycle_state
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'storage_bucket') and self.storage_bucket is not None:
- _dict['storage_bucket'] = self.storage_bucket.to_dict()
- if hasattr(self, 'target') and self.target is not None:
- if isinstance(self.target, dict):
- _dict['target'] = self.target
- else:
- _dict['target'] = self.target.to_dict()
- if hasattr(self, 'vpc') and self.vpc is not None:
- _dict['vpc'] = self.vpc.to_dict()
+ if 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):
@@ -20860,102 +29100,105 @@ 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 InstanceAction object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollector') -> 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: 'FlowLogCollector') -> bool:
+ def __ne__(self, other: 'InstanceAction') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class LifecycleStateEnum(str, Enum):
+ class StatusEnum(str, Enum):
"""
- The lifecycle state of the flow log collector.
+ The current status of this action.
"""
- DELETING = 'deleting'
+ COMPLETED = 'completed'
FAILED = 'failed'
PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
+ RUNNING = 'running'
-class FlowLogCollectorCollection():
+ class TypeEnum(str, Enum):
+ """
+ The type of action.
+ """
+ REBOOT = 'reboot'
+ START = 'start'
+ STOP = 'stop'
+
+
+class InstanceCollection():
"""
- FlowLogCollectorCollection.
+ InstanceCollection.
- :attr FlowLogCollectorCollectionFirst first: A link to the first page of
- resources.
- :attr List[FlowLogCollector] flow_log_collectors: Collection of flow log
- collectors.
+ :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 FlowLogCollectorCollectionNext 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.
"""
def __init__(self,
- first: 'FlowLogCollectorCollectionFirst',
- flow_log_collectors: List['FlowLogCollector'],
+ first: 'InstanceCollectionFirst',
+ instances: List['Instance'],
limit: int,
total_count: int,
*,
- next: 'FlowLogCollectorCollectionNext' = None) -> None:
+ next: 'InstanceCollectionNext' = None) -> None:
"""
- Initialize a FlowLogCollectorCollection object.
+ Initialize a InstanceCollection object.
- :param FlowLogCollectorCollectionFirst first: A link to the first page of
+ :param InstanceCollectionFirst first: A link to the first page of
resources.
- :param List[FlowLogCollector] flow_log_collectors: Collection of flow log
- collectors.
+ :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 FlowLogCollectorCollectionNext next: (optional) A link to the next
- page of resources. This property is present for 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.
"""
self.first = first
- self.flow_log_collectors = flow_log_collectors
+ self.instances = instances
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."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceCollection':
+ """Initialize a InstanceCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = FlowLogCollectorCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = InstanceCollectionFirst.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(x) for x in _dict.get('flow_log_collectors')]
+ raise ValueError('Required property \'first\' not present in InstanceCollection JSON')
+ if 'instances' in _dict:
+ args['instances'] = [Instance.from_dict(x) for x in _dict.get('instances')]
else:
- raise ValueError('Required property \'flow_log_collectors\' not present in FlowLogCollectorCollection 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 FlowLogCollectorCollection JSON')
+ raise ValueError('Required property \'limit\' not present in InstanceCollection JSON')
if 'next' in _dict:
- args['next'] = FlowLogCollectorCollectionNext.from_dict(_dict.get('next'))
+ 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 FlowLogCollectorCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in InstanceCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorCollection object from a json dictionary."""
+ """Initialize a InstanceCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -20963,8 +29206,8 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'first') and self.first is not None:
_dict['first'] = self.first.to_dict()
- if hasattr(self, 'flow_log_collectors') and self.flow_log_collectors is not None:
- _dict['flow_log_collectors'] = [x.to_dict() for x in self.flow_log_collectors]
+ if hasattr(self, 'instances') and self.instances is not None:
+ _dict['instances'] = [x.to_dict() for x in self.instances]
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -20978,20 +29221,20 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorCollection object."""
+ """Return a `str` version of this InstanceCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorCollection') -> 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: 'FlowLogCollectorCollection') -> bool:
+ def __ne__(self, other: 'InstanceCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorCollectionFirst():
+class InstanceCollectionFirst():
"""
A link to the first page of resources.
@@ -21001,25 +29244,25 @@ class FlowLogCollectorCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a FlowLogCollectorCollectionFirst 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) -> 'FlowLogCollectorCollectionFirst':
- """Initialize a FlowLogCollectorCollectionFirst 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 FlowLogCollectorCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in InstanceCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorCollectionFirst object from a json dictionary."""
+ """Initialize a InstanceCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -21034,20 +29277,20 @@ 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 InstanceCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorCollectionFirst') -> 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: 'FlowLogCollectorCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FlowLogCollectorCollectionNext():
+class InstanceCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -21058,25 +29301,25 @@ class FlowLogCollectorCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a FlowLogCollectorCollectionNext object.
+ Initialize a InstanceCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorCollectionNext':
- """Initialize a FlowLogCollectorCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceCollectionNext':
+ """Initialize a InstanceCollectionNext object from a json dictionary."""
args = {}
if 'href' in _dict:
args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'href\' not present in FlowLogCollectorCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in InstanceCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a FlowLogCollectorCollectionNext object from a json dictionary."""
+ """Initialize a InstanceCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -21091,419 +29334,115 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorCollectionNext object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'FlowLogCollectorCollectionNext') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'FlowLogCollectorCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class FlowLogCollectorPatch():
- """
- FlowLogCollectorPatch.
-
- :attr bool active: (optional) Indicates whether this collector is active.
- Updating to false deactivates the collector and updating to true activates the
- collector.
- :attr str name: (optional) The unique user-defined name for this flow log
- collector.
- """
-
- def __init__(self,
- *,
- active: bool = None,
- name: str = None) -> None:
- """
- Initialize a FlowLogCollectorPatch 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 unique user-defined name for this flow log
- collector.
- """
- self.active = active
- self.name = name
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'FlowLogCollectorPatch':
- """Initialize a FlowLogCollectorPatch object from a json dictionary."""
- args = {}
- 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 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, '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):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this FlowLogCollectorPatch object."""
+ """Return a `str` version of this InstanceCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'FlowLogCollectorPatch') -> 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: 'FlowLogCollectorPatch') -> bool:
+ def __ne__(self, other: 'InstanceCollectionNext') -> 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 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 FlowLogCollectorTarget object.
-
- """
- 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.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['FlowLogCollectorTargetPrototypeNetworkInterfaceIdentity', 'FlowLogCollectorTargetPrototypeInstanceIdentity', 'FlowLogCollectorTargetPrototypeSubnetIdentity', 'FlowLogCollectorTargetPrototypeVPCIdentity']))
- raise Exception(msg)
-
-class IKEPolicy():
+class InstanceConsoleAccessToken():
"""
- IKEPolicy.
+ The instance console access token information.
- :attr str authentication_algorithm: The authentication algorithm.
- :attr List[VPNGatewayConnectionReference] connections: The VPN gateway
- connections that use this IKE policy.
- :attr datetime created_at: The date and time that this IKE policy was created.
- :attr int dh_group: The Diffie-Hellman group.
- :attr str encryption_algorithm: The encryption algorithm.
- :attr 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 user-defined name for this IKE policy.
- :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 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,
- authentication_algorithm: str,
- connections: List['VPNGatewayConnectionReference'],
+ access_token: str,
+ console_type: str,
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:
+ expires_at: datetime,
+ force: bool,
+ href: str) -> None:
"""
- Initialize a IKEPolicy object.
+ Initialize a InstanceConsoleAccessToken object.
- :param str authentication_algorithm: The authentication algorithm.
- :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
+ :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 int dh_group: The Diffie-Hellman group.
- :param str encryption_algorithm: The encryption algorithm.
- :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 user-defined name for this IKE policy.
- :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 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.authentication_algorithm = authentication_algorithm
- self.connections = connections
+ self.access_token = access_token
+ self.console_type = console_type
self.created_at = created_at
- self.dh_group = dh_group
- self.encryption_algorithm = encryption_algorithm
+ self.expires_at = expires_at
+ self.force = force
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) -> 'IKEPolicy':
- """Initialize a IKEPolicy 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(x) for x 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')
- else:
- raise ValueError('Required property \'resource_type\' not present in IKEPolicy JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, 'authentication_algorithm') and self.authentication_algorithm is not None:
- _dict['authentication_algorithm'] = self.authentication_algorithm
- if hasattr(self, 'connections') and self.connections is not None:
- _dict['connections'] = [x.to_dict() for x in self.connections]
- 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:
- _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 IKEPolicy object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'IKEPolicy') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
- class AuthenticationAlgorithmEnum(str, Enum):
- """
- The authentication algorithm.
- """
- MD5 = 'md5'
- SHA1 = 'sha1'
- SHA256 = 'sha256'
- SHA512 = 'sha512'
-
-
- class EncryptionAlgorithmEnum(str, Enum):
- """
- The encryption algorithm.
- """
- AES128 = 'aes128'
- 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():
- """
- IKEPolicyCollection.
-
- :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,
- first: 'IKEPolicyCollectionFirst',
- ike_policies: List['IKEPolicy'],
- limit: int,
- total_count: int,
- *,
- next: 'IKEPolicyCollectionNext' = None) -> None:
- """
- Initialize a IKEPolicyCollection object.
-
- :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.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) -> 'IKEPolicyCollection':
- """Initialize a IKEPolicyCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceConsoleAccessToken':
+ """Initialize a InstanceConsoleAccessToken object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = IKEPolicyCollectionFirst.from_dict(_dict.get('first'))
+ if 'access_token' in _dict:
+ args['access_token'] = _dict.get('access_token')
else:
- raise ValueError('Required property \'first\' not present in IKEPolicyCollection JSON')
- if 'ike_policies' in _dict:
- args['ike_policies'] = [IKEPolicy.from_dict(x) for x in _dict.get('ike_policies')]
+ 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 \'ike_policies\' not present in IKEPolicyCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ 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 \'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')
+ 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 \'total_count\' not present in IKEPolicyCollection 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 IKEPolicyCollection 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'ike_policies') and self.ike_policies is not None:
- _dict['ike_policies'] = [x.to_dict() for x in self.ike_policies]
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ 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):
@@ -21511,55 +29450,131 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this IKEPolicyCollection object."""
+ """Return a `str` version of this InstanceConsoleAccessToken object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyCollection') -> 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: 'IKEPolicyCollection') -> bool:
+ def __ne__(self, other: 'InstanceConsoleAccessToken') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IKEPolicyCollectionFirst():
+ class ConsoleTypeEnum(str, Enum):
+ """
+ The instance console type for which this token may be used.
+ """
+ SERIAL = 'serial'
+ VNC = 'vnc'
+
+
+class InstanceDisk():
"""
- A link to the first page of resources.
+ InstanceDisk.
- :attr str href: The URL for a page of resources.
+ :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 user-defined name for this disk.
+ :attr str resource_type: The resource type.
+ :attr int size: The size of the disk in GB (gigabytes).
"""
def __init__(self,
- href: str) -> None:
+ created_at: datetime,
+ href: str,
+ id: str,
+ interface_type: str,
+ name: str,
+ resource_type: str,
+ size: int) -> None:
"""
- Initialize a IKEPolicyCollectionFirst object.
+ Initialize a InstanceDisk object.
- :param str href: The URL for a page of resources.
+ :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 user-defined name for this disk.
+ :param str resource_type: The resource type.
+ :param int size: The size of the disk in GB (gigabytes).
"""
+ 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
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollectionFirst':
- """Initialize a IKEPolicyCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceDisk':
+ """Initialize a InstanceDisk 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 IKEPolicyCollectionFirst 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 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')
+ else:
+ 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 \'size\' not present in InstanceDisk JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyCollectionFirst 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, '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
return _dict
def _to_dict(self):
@@ -21567,56 +29582,74 @@ 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 InstanceDisk object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyCollectionFirst') -> 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: 'IKEPolicyCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceDisk') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IKEPolicyCollectionNext():
+ 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():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ InstanceDiskCollection.
- :attr str href: The URL for a page of resources.
+ :attr List[InstanceDisk] disks: Collection of the instance's disks.
"""
def __init__(self,
- href: str) -> None:
+ disks: List['InstanceDisk']) -> None:
"""
- Initialize a IKEPolicyCollectionNext object.
+ Initialize a InstanceDiskCollection object.
- :param str href: The URL for a page of resources.
+ :param List[InstanceDisk] disks: Collection of the instance's disks.
"""
- self.href = href
+ self.disks = disks
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IKEPolicyCollectionNext':
- """Initialize a IKEPolicyCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceDiskCollection':
+ """Initialize a InstanceDiskCollection object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if 'disks' in _dict:
+ args['disks'] = [InstanceDisk.from_dict(x) for x in _dict.get('disks')]
else:
- raise ValueError('Required property \'href\' not present in IKEPolicyCollectionNext JSON')
+ raise ValueError('Required property \'disks\' not present in InstanceDiskCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyCollectionNext object from a json dictionary."""
+ """Initialize a InstanceDiskCollection object from 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, 'disks') and self.disks is not None:
+ _dict['disks'] = [x.to_dict() for x in self.disks]
return _dict
def _to_dict(self):
@@ -21624,93 +29657,52 @@ 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 InstanceDiskCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyCollectionNext') -> bool:
+ 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: 'IKEPolicyCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceDiskCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IKEPolicyPatch():
+class InstanceDiskPatch():
"""
- IKEPolicyPatch.
+ InstanceDiskPatch.
- :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 user-defined name for this IKE policy.
+ :attr str name: (optional) The user-defined name for this disk.
"""
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) -> None:
"""
- Initialize a IKEPolicyPatch object.
+ Initialize a InstanceDiskPatch 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 user-defined name for this IKE policy.
+ :param str name: (optional) The user-defined name for this disk.
"""
- 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) -> 'IKEPolicyPatch':
- """Initialize a IKEPolicyPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceDiskPatch':
+ """Initialize a InstanceDiskPatch 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyPatch 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, '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
@@ -21720,48 +29712,29 @@ 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 InstanceDiskPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyPatch') -> 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: 'IKEPolicyPatch') -> bool:
+ def __ne__(self, other: 'InstanceDiskPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AuthenticationAlgorithmEnum(str, Enum):
- """
- The authentication algorithm.
- """
- MD5 = 'md5'
- SHA1 = 'sha1'
- SHA256 = 'sha256'
- SHA512 = 'sha512'
-
-
- class EncryptionAlgorithmEnum(str, Enum):
- """
- The encryption algorithm.
- """
- AES128 = 'aes128'
- AES256 = 'aes256'
- TRIPLE_DES = 'triple_des'
-
-
-class IKEPolicyReference():
+class InstanceDiskReference():
"""
- IKEPolicyReference.
+ InstanceDiskReference.
- :attr IKEPolicyReferenceDeleted deleted: (optional) If present, this property
+ :attr InstanceDiskReferenceDeleted 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 user-defined name for this IKE policy.
+ :attr str href: The URL for this instance disk.
+ :attr str id: The unique identifier for this instance disk.
+ :attr str name: The user-defined name for this disk.
:attr str resource_type: The resource type.
"""
@@ -21771,15 +29744,15 @@ def __init__(self,
name: str,
resource_type: str,
*,
- deleted: 'IKEPolicyReferenceDeleted' = None) -> None:
+ deleted: 'InstanceDiskReferenceDeleted' = None) -> None:
"""
- Initialize a IKEPolicyReference object.
+ Initialize a InstanceDiskReference object.
- :param str href: The IKE policy's canonical URL.
- :param str id: The unique identifier for this IKE policy.
- :param str name: The user-defined name for this IKE policy.
+ :param str href: The URL for this instance disk.
+ :param str id: The unique identifier for this instance disk.
+ :param str name: The user-defined name for this disk.
:param str resource_type: The resource type.
- :param IKEPolicyReferenceDeleted deleted: (optional) If present, this
+ :param InstanceDiskReferenceDeleted deleted: (optional) If present, this
property indicates the referenced resource has been deleted and provides
some supplementary information.
"""
@@ -21790,32 +29763,32 @@ def __init__(self,
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) -> 'InstanceDiskReference':
+ """Initialize a InstanceDiskReference object from a json dictionary."""
args = {}
if 'deleted' in _dict:
- args['deleted'] = IKEPolicyReferenceDeleted.from_dict(_dict.get('deleted'))
+ 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 IKEPolicyReference 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 IKEPolicyReference JSON')
+ 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 IKEPolicyReference JSON')
+ 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 IKEPolicyReference JSON')
+ raise ValueError('Required property \'resource_type\' not present in InstanceDiskReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyReference object from a json dictionary."""
+ """Initialize a InstanceDiskReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -21838,16 +29811,16 @@ 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 InstanceDiskReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyReference') -> 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: 'IKEPolicyReference') -> bool:
+ def __ne__(self, other: 'InstanceDiskReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -21855,10 +29828,10 @@ class ResourceTypeEnum(str, Enum):
"""
The resource type.
"""
- IKE_POLICY = 'ike_policy'
+ INSTANCE_DISK = 'instance_disk'
-class IKEPolicyReferenceDeleted():
+class InstanceDiskReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -21869,25 +29842,25 @@ class IKEPolicyReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a IKEPolicyReferenceDeleted object.
+ Initialize a InstanceDiskReferenceDeleted object.
:param str more_info: Link to documentation about deleted resources.
"""
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IKEPolicyReferenceDeleted':
- """Initialize a IKEPolicyReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceDiskReferenceDeleted':
+ """Initialize a InstanceDiskReferenceDeleted 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')
+ raise ValueError('Required property \'more_info\' not present in InstanceDiskReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IKEPolicyReferenceDeleted object from a json dictionary."""
+ """Initialize a InstanceDiskReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -21902,64 +29875,85 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this IKEPolicyReferenceDeleted object."""
+ """Return a `str` version of this InstanceDiskReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IKEPolicyReferenceDeleted') -> 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: 'IKEPolicyReferenceDeleted') -> bool:
+ def __ne__(self, other: 'InstanceDiskReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IP():
+class InstanceGPU():
"""
- IP.
+ The virtual server instance GPU 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 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,
- address: str) -> None:
+ count: int,
+ manufacturer: str,
+ memory: int,
+ model: str) -> None:
"""
- Initialize a IP object.
+ Initialize a InstanceGPU 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 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.address = address
+ self.count = count
+ self.manufacturer = manufacturer
+ self.memory = memory
+ self.model = model
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IP':
- """Initialize a IP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGPU':
+ """Initialize a InstanceGPU object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if 'count' in _dict:
+ args['count'] = _dict.get('count')
else:
- raise ValueError('Required property \'address\' not present in IP JSON')
+ 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 IP 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, 'address') and self.address is not None:
- _dict['address'] = self.address
+ 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):
@@ -21967,184 +29961,222 @@ 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 InstanceGPU object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IP') -> 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: 'IP') -> bool:
+ def __ne__(self, other: 'InstanceGPU') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IPsecPolicy():
+class InstanceGroup():
"""
- IPsecPolicy.
+ InstanceGroup.
- :attr str authentication_algorithm: The authentication algorithm.
- :attr List[VPNGatewayConnectionReference] connections: The VPN gateway
- connections that use this IPsec policy.
- :attr datetime created_at: The date and time that this IPsec policy was created.
- :attr str encapsulation_mode: The encapsulation mode used. Only `tunnel` is
- supported.
- :attr str encryption_algorithm: The encryption algorithm.
- :attr str href: The IPsec policy's canonical URL.
- :attr str id: The unique identifier for this IPsec policy.
- :attr int key_lifetime: The key lifetime in seconds.
- :attr str name: The user-defined name for this IPsec policy.
- :attr str pfs: Perfect Forward Secrecy.
- :attr 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.
+ :attr int application_port: (optional) Required if specifying a load balancer
+ pool only. Used by the instance group when scaling up instances to supply the
+ port for the load balancer pool member.
+ :attr 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) The load balancer
+ pool managed by this group. Instances created
+ by this group will have a new load balancer pool member in that
+ pool created.
+ :attr List[InstanceGroupManagerReference] managers: The managers for the
+ instance group.
+ :attr int membership_count: The number of instances in the instance group.
+ :attr str name: The user-defined name for this instance group.
+ :attr 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,
- authentication_algorithm: str,
- connections: List['VPNGatewayConnectionReference'],
created_at: datetime,
- encapsulation_mode: str,
- encryption_algorithm: str,
+ crn: str,
href: str,
id: str,
- key_lifetime: int,
+ instance_template: 'InstanceTemplateReference',
+ managers: List['InstanceGroupManagerReference'],
+ membership_count: int,
name: str,
- pfs: str,
resource_group: 'ResourceGroupReference',
- resource_type: str,
- transform_protocol: str) -> None:
+ status: str,
+ subnets: List['SubnetReference'],
+ updated_at: datetime,
+ vpc: 'VPCReference',
+ *,
+ application_port: int = None,
+ load_balancer_pool: 'LoadBalancerPoolReference' = None) -> None:
"""
- Initialize a IPsecPolicy object.
+ Initialize a InstanceGroup object.
- :param str authentication_algorithm: The authentication algorithm.
- :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
+ :param datetime created_at: The date and time that the instance group was
created.
- :param str encapsulation_mode: The encapsulation mode used. Only `tunnel`
- is supported.
- :param str encryption_algorithm: The encryption algorithm.
- :param str href: The IPsec policy's canonical URL.
- :param str id: The unique identifier for this IPsec policy.
- :param int key_lifetime: The key lifetime in seconds.
- :param str name: The user-defined name for this IPsec policy.
- :param str pfs: Perfect Forward Secrecy.
- :param 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 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 user-defined name for this instance group.
+ :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) Required if specifying a load
+ balancer pool only. Used by the instance group when scaling up instances to
+ supply the port for the load balancer pool member.
+ :param LoadBalancerPoolReference load_balancer_pool: (optional) The load
+ balancer pool managed by this group. Instances created
+ by this group will have a new load balancer pool member in that
+ pool created.
"""
- self.authentication_algorithm = authentication_algorithm
- self.connections = connections
+ self.application_port = application_port
self.created_at = created_at
- self.encapsulation_mode = encapsulation_mode
- self.encryption_algorithm = encryption_algorithm
+ self.crn = crn
self.href = href
self.id = id
- self.key_lifetime = key_lifetime
+ self.instance_template = instance_template
+ self.load_balancer_pool = load_balancer_pool
+ self.managers = managers
+ self.membership_count = membership_count
self.name = name
- self.pfs = pfs
self.resource_group = resource_group
- self.resource_type = resource_type
- self.transform_protocol = transform_protocol
+ self.status = status
+ self.subnets = subnets
+ self.updated_at = updated_at
+ self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IPsecPolicy':
- """Initialize a IPsecPolicy object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroup':
+ """Initialize a InstanceGroup 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(x) for x in _dict.get('connections')]
- else:
- raise ValueError('Required property \'connections\' not present in IPsecPolicy JSON')
+ 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 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')
+ 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 \'encryption_algorithm\' not present in IPsecPolicy JSON')
+ 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 IPsecPolicy 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 IPsecPolicy JSON')
- if 'key_lifetime' in _dict:
- args['key_lifetime'] = _dict.get('key_lifetime')
+ 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 \'key_lifetime\' not present in IPsecPolicy JSON')
+ 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(x) for x 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 IPsecPolicy JSON')
- if 'pfs' in _dict:
- args['pfs'] = _dict.get('pfs')
- else:
- raise ValueError('Required property \'pfs\' not present in IPsecPolicy JSON')
+ 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 IPsecPolicy JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ 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 \'resource_type\' not present in IPsecPolicy JSON')
- if 'transform_protocol' in _dict:
- args['transform_protocol'] = _dict.get('transform_protocol')
+ raise ValueError('Required property \'status\' not present in InstanceGroup JSON')
+ if 'subnets' in _dict:
+ args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
else:
- raise ValueError('Required property \'transform_protocol\' not present in IPsecPolicy JSON')
+ 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 IPsecPolicy 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, 'authentication_algorithm') and self.authentication_algorithm is not None:
- _dict['authentication_algorithm'] = self.authentication_algorithm
- if hasattr(self, 'connections') and self.connections is not None:
- _dict['connections'] = [x.to_dict() for x in self.connections]
+ 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, '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, '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, 'key_lifetime') and self.key_lifetime is not None:
- _dict['key_lifetime'] = self.key_lifetime
+ if hasattr(self, 'instance_template') and self.instance_template is not None:
+ _dict['instance_template'] = self.instance_template.to_dict()
+ if hasattr(self, 'load_balancer_pool') and self.load_balancer_pool is not None:
+ _dict['load_balancer_pool'] = self.load_balancer_pool.to_dict()
+ if hasattr(self, 'managers') and self.managers is not None:
+ _dict['managers'] = [x.to_dict() for x in self.managers]
+ 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, 'pfs') and self.pfs is not None:
- _dict['pfs'] = self.pfs
if hasattr(self, 'resource_group') and self.resource_group is not None:
_dict['resource_group'] = self.resource_group.to_dict()
- if 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, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ _dict['subnets'] = [x.to_dict() for x in self.subnets]
+ if hasattr(self, 'updated_at') and self.updated_at is not None:
+ _dict['updated_at'] = datetime_to_string(self.updated_at)
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -22152,137 +30184,101 @@ 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 InstanceGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicy') -> 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: 'IPsecPolicy') -> bool:
+ def __ne__(self, other: 'InstanceGroup') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AuthenticationAlgorithmEnum(str, Enum):
- """
- The authentication algorithm.
- """
- MD5 = 'md5'
- SHA1 = 'sha1'
- SHA256 = 'sha256'
- SHA512 = 'sha512'
-
-
- class EncapsulationModeEnum(str, Enum):
- """
- The encapsulation mode used. Only `tunnel` is supported.
- """
- TUNNEL = 'tunnel'
-
-
- class EncryptionAlgorithmEnum(str, Enum):
- """
- The encryption algorithm.
- """
- AES128 = 'aes128'
- AES256 = 'aes256'
- TRIPLE_DES = 'triple_des'
-
-
- class PfsEnum(str, Enum):
- """
- Perfect Forward Secrecy.
- """
- DISABLED = 'disabled'
- GROUP_14 = 'group_14'
- GROUP_19 = 'group_19'
- GROUP_2 = 'group_2'
- GROUP_5 = 'group_5'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
- IPSEC_POLICY = 'ipsec_policy'
-
-
- class TransformProtocolEnum(str, Enum):
+ class StatusEnum(str, Enum):
"""
- The transform protocol used. Only `esp` is supported.
+ 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.
"""
- ESP = 'esp'
+ DELETING = 'deleting'
+ HEALTHY = 'healthy'
+ SCALING = 'scaling'
+ UNHEALTHY = 'unhealthy'
-class IPsecPolicyCollection():
+class InstanceGroupCollection():
"""
- IPsecPolicyCollection.
+ InstanceGroupCollection.
- :attr IPsecPolicyCollectionFirst first: A link to the first page of resources.
- :attr List[IPsecPolicy] ipsec_policies: Collection of IPsec policies.
+ :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 IPsecPolicyCollectionNext next: (optional) A link to the next page of
+ :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: 'IPsecPolicyCollectionFirst',
- ipsec_policies: List['IPsecPolicy'],
+ first: 'InstanceGroupCollectionFirst',
+ instance_groups: List['InstanceGroup'],
limit: int,
total_count: int,
*,
- next: 'IPsecPolicyCollectionNext' = None) -> None:
+ next: 'InstanceGroupCollectionNext' = None) -> None:
"""
- Initialize a IPsecPolicyCollection object.
+ Initialize a InstanceGroupCollection object.
- :param IPsecPolicyCollectionFirst first: A link to the first page of
+ :param InstanceGroupCollectionFirst first: A link to the first page of
resources.
- :param List[IPsecPolicy] ipsec_policies: Collection of IPsec policies.
+ :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 IPsecPolicyCollectionNext next: (optional) A link to the next page
+ :param InstanceGroupCollectionNext 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.ipsec_policies = ipsec_policies
+ self.instance_groups = instance_groups
self.limit = limit
self.next = next
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollection':
- """Initialize a IPsecPolicyCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollection':
+ """Initialize a InstanceGroupCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = IPsecPolicyCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = InstanceGroupCollectionFirst.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(x) for x in _dict.get('ipsec_policies')]
+ raise ValueError('Required property \'first\' not present in InstanceGroupCollection JSON')
+ if 'instance_groups' in _dict:
+ args['instance_groups'] = [InstanceGroup.from_dict(x) for x in _dict.get('instance_groups')]
else:
- raise ValueError('Required property \'ipsec_policies\' not present in IPsecPolicyCollection JSON')
+ 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 IPsecPolicyCollection JSON')
+ raise ValueError('Required property \'limit\' not present in InstanceGroupCollection JSON')
if 'next' in _dict:
- args['next'] = IPsecPolicyCollectionNext.from_dict(_dict.get('next'))
+ 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 IPsecPolicyCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in InstanceGroupCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IPsecPolicyCollection object from a json dictionary."""
+ """Initialize a InstanceGroupCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -22290,8 +30286,8 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'first') and self.first is not None:
_dict['first'] = self.first.to_dict()
- if hasattr(self, 'ipsec_policies') and self.ipsec_policies is not None:
- _dict['ipsec_policies'] = [x.to_dict() for x in self.ipsec_policies]
+ if hasattr(self, 'instance_groups') and self.instance_groups is not None:
+ _dict['instance_groups'] = [x.to_dict() for x in self.instance_groups]
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
@@ -22305,20 +30301,20 @@ 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 InstanceGroupCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyCollection') -> 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: 'IPsecPolicyCollection') -> bool:
+ def __ne__(self, other: 'InstanceGroupCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IPsecPolicyCollectionFirst():
+class InstanceGroupCollectionFirst():
"""
A link to the first page of resources.
@@ -22328,89 +30324,280 @@ class IPsecPolicyCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a IPsecPolicyCollectionFirst object.
+ 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,
+ href: str) -> None:
+ """
+ Initialize a InstanceGroupCollectionNext object.
+
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionNext':
+ """Initialize a InstanceGroupCollectionNext object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupCollectionNext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstanceGroupCollectionNext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this InstanceGroupCollectionNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstanceGroupCollectionNext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceGroupCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class 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 user-defined name for this instance group manager.
+ :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.
+
+ :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 user-defined name for this instance group manager.
+ :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)
+
+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 user-defined name for this instance group manager action.
+ :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 modified.
+ """
+
+ 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 user-defined name for this instance group manager
+ action.
+ :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 modified.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerActionScheduledAction']))
+ raise Exception(msg)
- :param str href: The URL for a page of resources.
+ class ResourceTypeEnum(str, Enum):
"""
- self.href = href
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionFirst':
- """Initialize a IPsecPolicyCollectionFirst object from a json dictionary."""
- args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionFirst JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a IPsecPolicyCollectionFirst object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ The resource type.
+ """
+ INSTANCE_GROUP_MANAGER_ACTION = 'instance_group_manager_action'
- def __str__(self) -> str:
- """Return a `str` version of this IPsecPolicyCollectionFirst object."""
- return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyCollectionFirst') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
+ 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'
- def __ne__(self, other: 'IPsecPolicyCollectionFirst') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class IPsecPolicyCollectionNext():
+class InstanceGroupManagerActionGroupPatch():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ InstanceGroupManagerActionGroupPatch.
- :attr str href: The URL for a page of resources.
+ :attr int membership_count: (optional) The number of members the instance group
+ should have at the scheduled time.
"""
def __init__(self,
- href: str) -> None:
+ *,
+ membership_count: int = None) -> None:
"""
- Initialize a IPsecPolicyCollectionNext object.
+ Initialize a InstanceGroupManagerActionGroupPatch object.
- :param str href: The URL for a page of resources.
+ :param int membership_count: (optional) The number of members the instance
+ group should have at the scheduled time.
"""
- self.href = href
+ self.membership_count = membership_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IPsecPolicyCollectionNext':
- """Initialize a IPsecPolicyCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionGroupPatch':
+ """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in IPsecPolicyCollectionNext JSON')
+ if 'membership_count' in _dict:
+ args['membership_count'] = _dict.get('membership_count')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a IPsecPolicyCollectionNext object from a json dictionary."""
+ """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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'membership_count') and self.membership_count is not None:
+ _dict['membership_count'] = self.membership_count
return _dict
def _to_dict(self):
@@ -22418,87 +30605,66 @@ 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 InstanceGroupManagerActionGroupPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyCollectionNext') -> bool:
+ 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: 'IPsecPolicyCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionGroupPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class IPsecPolicyPatch():
+class InstanceGroupManagerActionManagerPatch():
"""
- IPsecPolicyPatch.
+ InstanceGroupManagerActionManagerPatch.
- :attr str authentication_algorithm: (optional) The authentication algorithm.
- :attr str encryption_algorithm: (optional) The encryption algorithm.
- :attr int key_lifetime: (optional) The key lifetime in seconds.
- :attr str name: (optional) The user-defined name for this IPsec policy.
- :attr str pfs: (optional) Perfect Forward Secrecy.
+ :attr int max_membership_count: (optional) The maximum number of members the
+ instance group should have at the scheduled time.
+ :attr int min_membership_count: (optional) The minimum number of members the
+ instance group should have at the scheduled time.
"""
def __init__(self,
*,
- authentication_algorithm: str = None,
- encryption_algorithm: str = None,
- key_lifetime: int = None,
- name: str = None,
- pfs: str = None) -> None:
+ max_membership_count: int = None,
+ min_membership_count: int = None) -> None:
"""
- Initialize a IPsecPolicyPatch object.
+ Initialize a InstanceGroupManagerActionManagerPatch object.
- :param str authentication_algorithm: (optional) The authentication
- algorithm.
- :param str encryption_algorithm: (optional) The encryption algorithm.
- :param int key_lifetime: (optional) The key lifetime in seconds.
- :param str name: (optional) The user-defined name for this IPsec policy.
- :param str pfs: (optional) Perfect Forward Secrecy.
+ :param int max_membership_count: (optional) The maximum number of members
+ the instance group should have at the scheduled time.
+ :param int min_membership_count: (optional) The minimum number of members
+ the instance group should have at the scheduled time.
"""
- self.authentication_algorithm = authentication_algorithm
- self.encryption_algorithm = encryption_algorithm
- self.key_lifetime = key_lifetime
- self.name = name
- self.pfs = pfs
+ self.max_membership_count = max_membership_count
+ self.min_membership_count = min_membership_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IPsecPolicyPatch':
- """Initialize a IPsecPolicyPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionManagerPatch':
+ """Initialize a InstanceGroupManagerActionManagerPatch 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 '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 IPsecPolicyPatch 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, '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, '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):
@@ -22506,128 +30672,93 @@ 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 InstanceGroupManagerActionManagerPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyPatch') -> 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: 'IPsecPolicyPatch') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionManagerPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class AuthenticationAlgorithmEnum(str, Enum):
- """
- The authentication algorithm.
- """
- MD5 = 'md5'
- SHA1 = 'sha1'
- SHA256 = 'sha256'
- SHA512 = 'sha512'
-
-
- class EncryptionAlgorithmEnum(str, Enum):
- """
- The encryption algorithm.
- """
- AES128 = 'aes128'
- AES256 = 'aes256'
- TRIPLE_DES = 'triple_des'
-
-
- class PfsEnum(str, Enum):
- """
- Perfect Forward Secrecy.
- """
- DISABLED = 'disabled'
- GROUP_14 = 'group_14'
- GROUP_19 = 'group_19'
- GROUP_2 = 'group_2'
- GROUP_5 = 'group_5'
-
-
-class IPsecPolicyReference():
+class InstanceGroupManagerActionPatch():
"""
- IPsecPolicyReference.
+ InstanceGroupManagerActionPatch.
- :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 user-defined name for this IPsec policy.
- :attr str resource_type: The resource type.
+ :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 user-defined name for this instance group manager
+ action.
+ :attr datetime run_at: (optional) The date and time the scheduled action will
+ run.
"""
def __init__(self,
- href: str,
- id: str,
- name: str,
- resource_type: str,
*,
- deleted: 'IPsecPolicyReferenceDeleted' = None) -> None:
+ cron_spec: str = None,
+ group: 'InstanceGroupManagerActionGroupPatch' = None,
+ manager: 'InstanceGroupManagerActionManagerPatch' = None,
+ name: str = None,
+ run_at: datetime = None) -> None:
"""
- Initialize a IPsecPolicyReference object.
+ Initialize a InstanceGroupManagerActionPatch object.
- :param str href: The IPsec policy's canonical URL.
- :param str id: The unique identifier for this IPsec policy.
- :param str name: The user-defined name for this IPsec policy.
- :param str 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 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 user-defined name for this instance group
+ manager action.
+ :param datetime run_at: (optional) The date and time the scheduled action
+ will run.
"""
- self.deleted = deleted
- self.href = href
- self.id = id
+ self.cron_spec = cron_spec
+ self.group = group
+ self.manager = manager
self.name = name
- self.resource_type = resource_type
+ self.run_at = run_at
@classmethod
- def from_dict(cls, _dict: Dict) -> 'IPsecPolicyReference':
- """Initialize a IPsecPolicyReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionPatch':
+ """Initialize a InstanceGroupManagerActionPatch object from a json dictionary."""
args = {}
- 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 IPsecPolicyReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in IPsecPolicyReference 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')
- else:
- 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 \'resource_type\' not present in IPsecPolicyReference JSON')
+ 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 IPsecPolicyReference 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, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'cron_spec') and self.cron_spec is not None:
+ _dict['cron_spec'] = self.cron_spec
+ if hasattr(self, 'group') and self.group is not None:
+ _dict['group'] = self.group.to_dict()
+ if hasattr(self, 'manager') and self.manager is not None:
+ _dict['manager'] = self.manager.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, 'run_at') and self.run_at is not None:
+ _dict['run_at'] = datetime_to_string(self.run_at)
return _dict
def _to_dict(self):
@@ -22635,320 +30766,124 @@ 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 InstanceGroupManagerActionPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'IPsecPolicyReference') -> 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: 'IPsecPolicyReference') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
- IPSEC_POLICY = 'ipsec_policy'
-
-
-class IPsecPolicyReferenceDeleted():
+class InstanceGroupManagerActionPrototype():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ InstanceGroupManagerActionPrototype.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr str name: (optional) The user-defined name for this instance group manager
+ action. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
"""
def __init__(self,
- more_info: str) -> None:
+ *,
+ name: str = None) -> None:
"""
- Initialize a IPsecPolicyReferenceDeleted object.
+ Initialize a InstanceGroupManagerActionPrototype object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str name: (optional) The user-defined name for this instance group
+ manager action. Names must be unique within the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
"""
- self.more_info = more_info
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'IPsecPolicyReferenceDeleted':
- """Initialize a IPsecPolicyReferenceDeleted 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 IPsecPolicyReferenceDeleted JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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 IPsecPolicyReferenceDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'IPsecPolicyReferenceDeleted') -> 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(['InstanceGroupManagerActionPrototypeScheduledActionPrototype']))
+ raise Exception(msg)
-class Image():
+class InstanceGroupManagerActionReference():
"""
- Image.
+ InstanceGroupManagerActionReference.
- :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`,
- `tentative`, or
- `failed`.
- :attr str name: The user-defined or system-provided name for this image.
- :attr OperatingSystem operating_system: (optional) The operating system included
- in this image.
- :attr ResourceGroupReference resource_group: The resource group for this image.
- :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 can be used, but is slated to become `obsolete`
- (provisionable)
- - failed: image is corrupt or did not pass validation
- - obsolete: image can no longer be used to provision new resources
- - pending: image is being imported and is not yet `available`
- - tentative: image import has timed out (contact support)
- - unusable: image cannot be used (see `status_reasons[]` for possible
- remediation)
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- 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).
- 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: Whether the image is publicly visible or private to the
- account.
+ :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 user-defined name for this instance group manager action.
+ :attr str resource_type: The resource type.
"""
def __init__(self,
- created_at: datetime,
- crn: str,
- encryption: str,
- file: 'ImageFile',
- href: str,
- id: str,
- name: str,
- resource_group: 'ResourceGroupReference',
- 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.
-
- :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 user-defined or system-provided name for this image.
- :param ResourceGroupReference resource_group: The resource group for this
- image.
- :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 can be used, but is slated to become `obsolete`
- (provisionable)
- - failed: image is corrupt or did not pass validation
- - obsolete: image can no longer be used to provision new resources
- - pending: image is being imported and is not yet `available`
- - tentative: image import has timed out (contact support)
- - unusable: image cannot be used (see `status_reasons[]` for possible
- remediation)
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt 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).
- 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: Whether the image is publicly visible or private to
- the account.
- :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`,
- `tentative`, 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.
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
+ *,
+ deleted: 'InstanceGroupManagerActionReferenceDeleted' = None) -> None:
"""
- self.created_at = created_at
- self.crn = crn
- self.encryption = encryption
- self.encryption_key = encryption_key
- self.file = file
+ Initialize a InstanceGroupManagerActionReference 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 user-defined name for this instance group manager
+ action.
+ :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.minimum_provisioned_size = minimum_provisioned_size
self.name = name
- self.operating_system = operating_system
- self.resource_group = resource_group
- self.source_volume = source_volume
- self.status = status
- self.status_reasons = status_reasons
- self.visibility = visibility
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Image':
- """Initialize a Image object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionReference':
+ """Initialize a InstanceGroupManagerActionReference 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 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 '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 Image 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 Image JSON')
- if 'minimum_provisioned_size' in _dict:
- args['minimum_provisioned_size'] = _dict.get('minimum_provisioned_size')
+ 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 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 '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(x) for x 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')
+ 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 \'visibility\' not present in Image JSON')
+ raise ValueError('Required property \'resource_type\' not present in InstanceGroupManagerActionReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Image 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, '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:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- if hasattr(self, 'file') and self.file is not None:
- _dict['file'] = self.file.to_dict()
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, '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:
- _dict['operating_system'] = self.operating_system.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'source_volume') and self.source_volume is not None:
- _dict['source_volume'] = self.source_volume.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons]
- if hasattr(self, 'visibility') and self.visibility is not None:
- _dict['visibility'] = self.visibility
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -22956,133 +30891,174 @@ 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 InstanceGroupManagerActionReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Image') -> 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: 'Image') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionReference') -> 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 image.
+ The resource type.
"""
- NONE = 'none'
- USER_MANAGED = 'user_managed'
+ 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 can be used, but is slated to become `obsolete`
- (provisionable)
- - failed: image is corrupt or did not pass validation
- - obsolete: image can no longer be used to provision new resources
- - pending: image is being imported and is not yet `available`
- - tentative: image import has timed out (contact support)
- - unusable: image cannot be used (see `status_reasons[]` for possible remediation)
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- 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'
- PENDING = 'pending'
- TENTATIVE = 'tentative'
- UNUSABLE = 'unusable'
+class InstanceGroupManagerActionReferenceDeleted():
+ """
+ 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 VisibilityEnum(str, Enum):
+ def __init__(self,
+ more_info: str) -> None:
"""
- Whether the image is publicly visible or private to the account.
+ Initialize a InstanceGroupManagerActionReferenceDeleted object.
+
+ :param str more_info: Link to documentation about deleted resources.
"""
- PRIVATE = 'private'
- PUBLIC = 'public'
+ self.more_info = more_info
+
+ @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 ImageCollection():
+ 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 InstanceGroupManagerActionReferenceDeleted object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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 InstanceGroupManagerActionsCollection():
"""
- ImageCollection.
+ InstanceGroupManagerActionsCollection.
- :attr ImageCollectionFirst first: A link to the first page of resources.
- :attr List[Image] images: Collection of images.
+ :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 ImageCollectionNext next: (optional) A link to the next page of resources.
- This property is present for all pages
+ :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,
- first: 'ImageCollectionFirst',
- images: List['Image'],
+ actions: List['InstanceGroupManagerAction'],
+ first: 'InstanceGroupManagerActionsCollectionFirst',
limit: int,
+ total_count: int,
*,
- next: 'ImageCollectionNext' = None) -> None:
+ next: 'InstanceGroupManagerActionsCollectionNext' = None) -> None:
"""
- Initialize a ImageCollection object.
+ Initialize a InstanceGroupManagerActionsCollection object.
- :param ImageCollectionFirst first: A link to the first page of resources.
- :param List[Image] images: Collection of images.
+ :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 ImageCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
+ :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.images = images
self.limit = limit
self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageCollection':
- """Initialize a ImageCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollection':
+ """Initialize a InstanceGroupManagerActionsCollection object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = ImageCollectionFirst.from_dict(_dict.get('first'))
+ if 'actions' in _dict:
+ args['actions'] = _dict.get('actions')
else:
- raise ValueError('Required property \'first\' not present in ImageCollection JSON')
- if 'images' in _dict:
- args['images'] = [Image.from_dict(x) for x in _dict.get('images')]
+ 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 \'images\' not present in ImageCollection JSON')
+ raise ValueError('Required property \'first\' not present in InstanceGroupManagerActionsCollection JSON')
if 'limit' in _dict:
args['limit'] = _dict.get('limit')
else:
- raise ValueError('Required property \'limit\' not present in ImageCollection JSON')
+ raise ValueError('Required property \'limit\' not present in InstanceGroupManagerActionsCollection JSON')
if 'next' in _dict:
- args['next'] = ImageCollectionNext.from_dict(_dict.get('next'))
+ 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 \'total_count\' not present in InstanceGroupManagerActionsCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageCollection 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, 'actions') and self.actions is not None:
+ actions_list = []
+ for x in self.actions:
+ if isinstance(x, dict):
+ actions_list.append(x)
+ else:
+ actions_list.append(x.to_dict())
+ _dict['actions'] = actions_list
if hasattr(self, 'first') and self.first is not None:
_dict['first'] = self.first.to_dict()
- if hasattr(self, 'images') and self.images is not None:
- _dict['images'] = [x.to_dict() for x in self.images]
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -23090,20 +31066,20 @@ 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 InstanceGroupManagerActionsCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageCollection') -> 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: 'ImageCollection') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionsCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageCollectionFirst():
+class InstanceGroupManagerActionsCollectionFirst():
"""
A link to the first page of resources.
@@ -23113,25 +31089,25 @@ class ImageCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a ImageCollectionFirst object.
+ Initialize a InstanceGroupManagerActionsCollectionFirst 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."""
+ 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 ImageCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageCollectionFirst object from a json dictionary."""
+ """Initialize a InstanceGroupManagerActionsCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -23146,20 +31122,20 @@ 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 InstanceGroupManagerActionsCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageCollectionFirst') -> bool:
+ 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: 'ImageCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionsCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageCollectionNext():
+class InstanceGroupManagerActionsCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -23170,25 +31146,25 @@ class ImageCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a ImageCollectionNext object.
+ Initialize a InstanceGroupManagerActionsCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageCollectionNext':
- """Initialize a ImageCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionsCollectionNext':
+ """Initialize a InstanceGroupManagerActionsCollectionNext 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')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerActionsCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageCollectionNext object from a json dictionary."""
+ """Initialize a InstanceGroupManagerActionsCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -23203,77 +31179,110 @@ 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 InstanceGroupManagerActionsCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageCollectionNext') -> 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: 'ImageCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerActionsCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageFile():
+class InstanceGroupManagerCollection():
"""
- ImageFile.
+ InstanceGroupManagerCollection.
- :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 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,
+ first: 'InstanceGroupManagerCollectionFirst',
+ limit: int,
+ managers: List['InstanceGroupManager'],
+ total_count: int,
*,
- checksums: 'ImageFileChecksums' = None,
- size: int = None) -> None:
+ next: 'InstanceGroupManagerCollectionNext' = None) -> None:
"""
- Initialize a ImageFile object.
+ Initialize a InstanceGroupManagerCollection 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 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.checksums = checksums
- self.size = size
+ self.first = first
+ self.limit = limit
+ self.managers = managers
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageFile':
- """Initialize a ImageFile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollection':
+ """Initialize a InstanceGroupManagerCollection 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 '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')
+ 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 ImageFile 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, 'checksums') and self.checksums is not None:
- _dict['checksums'] = self.checksums.to_dict()
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'managers') and self.managers is not None:
+ managers_list = []
+ for x in self.managers:
+ if isinstance(x, dict):
+ managers_list.append(x)
+ else:
+ managers_list.append(x.to_dict())
+ _dict['managers'] = managers_list
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -23281,54 +31290,112 @@ 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 InstanceGroupManagerCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageFile') -> 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: 'ImageFile') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageFileChecksums():
+class InstanceGroupManagerCollectionFirst():
"""
- ImageFileChecksums.
+ A link to the first page of resources.
- :attr str sha256: (optional) The SHA256 fingerprint of the image file.
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- *,
- sha256: str = None) -> None:
+ href: str) -> None:
"""
- Initialize a ImageFileChecksums object.
+ Initialize a InstanceGroupManagerCollectionFirst object.
- :param str sha256: (optional) The SHA256 fingerprint of the image file.
+ :param str href: The URL for a page of resources.
"""
- self.sha256 = sha256
+ self.href = href
+
+ @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)
+
+ def __eq__(self, other: 'InstanceGroupManagerCollectionFirst') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstanceGroupManagerCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class InstanceGroupManagerCollectionNext():
+ """
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
+
+ :attr str href: The URL for a page of resources.
+ """
+
+ def __init__(self,
+ href: str) -> None:
+ """
+ Initialize a InstanceGroupManagerCollectionNext object.
+
+ :param str href: The URL for a page of resources.
+ """
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageFileChecksums':
- """Initialize a ImageFileChecksums object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollectionNext':
+ """Initialize a InstanceGroupManagerCollectionNext object from a json dictionary."""
args = {}
- if 'sha256' in _dict:
- args['sha256'] = _dict.get('sha256')
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageFileChecksums 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, 'sha256') and self.sha256 is not None:
- _dict['sha256'] = self.sha256
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -23336,55 +31403,106 @@ 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 InstanceGroupManagerCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageFileChecksums') -> 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: 'ImageFileChecksums') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageFilePrototype():
+class InstanceGroupManagerPatch():
"""
- ImageFilePrototype.
+ InstanceGroupManagerPatch.
- :attr str href: The Cloud Object Store (COS) location of the image file.
+ :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 user-defined name for this instance group
+ manager.
"""
def __init__(self,
- href: str) -> 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 ImageFilePrototype object.
+ Initialize a InstanceGroupManagerPatch object.
- :param str href: The Cloud Object Store (COS) location of the image file.
+ :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 user-defined name for this instance group
+ manager.
"""
- self.href = href
+ 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) -> 'ImageFilePrototype':
- """Initialize a ImageFilePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPatch':
+ """Initialize a InstanceGroupManagerPatch 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')
+ 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 ImageFilePrototype 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ 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):
@@ -23392,71 +31510,146 @@ 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 InstanceGroupManagerPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageFilePrototype') -> 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: 'ImageFilePrototype') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageIdentity():
+class InstanceGroupManagerPolicy():
"""
- Identifies an image by a unique property.
+ InstanceGroupManagerPolicy.
+ :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 user-defined name for this instance group manager policy.
+ :attr datetime updated_at: The date and time that the instance group manager
+ policy was updated.
"""
- def __init__(self) -> None:
+ def __init__(self,
+ created_at: datetime,
+ href: str,
+ id: str,
+ name: str,
+ updated_at: datetime) -> None:
"""
- Initialize a ImageIdentity object.
+ 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 user-defined name for this instance group manager
+ policy.
+ :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(['ImageIdentityById', 'ImageIdentityByCRN', 'ImageIdentityByHref']))
+ ", ".join(['InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy']))
raise Exception(msg)
-class ImagePatch():
+class InstanceGroupManagerPolicyCollection():
"""
- ImagePatch.
+ InstanceGroupManagerPolicyCollection.
- :attr str name: (optional) The unique user-defined name for this image. Names
- starting with `ibm-` are not allowed.
+ :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,
*,
- name: str = None) -> None:
+ next: 'InstanceGroupManagerPolicyCollectionNext' = None) -> None:
"""
- Initialize a ImagePatch object.
+ Initialize a InstanceGroupManagerPolicyCollection object.
- :param str name: (optional) The unique user-defined name for this image.
- Names starting with `ibm-` are not allowed.
+ :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.name = name
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.policies = policies
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImagePatch':
- """Initialize a ImagePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollection':
+ """Initialize a InstanceGroupManagerPolicyCollection object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ 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 ImagePatch 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, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'policies') and self.policies is not None:
+ policies_list = []
+ for x in self.policies:
+ if isinstance(x, dict):
+ policies_list.append(x)
+ else:
+ policies_list.append(x.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):
@@ -23464,129 +31657,55 @@ 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 InstanceGroupManagerPolicyCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImagePatch') -> 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: 'ImagePatch') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImagePrototype():
- """
- ImagePrototype.
-
- :attr str name: (optional) The unique user-defined name for this image. Names
- starting with `ibm-` are not allowed. If unspecified, the name will be a
- 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 ImagePrototype object.
-
- :param str name: (optional) The unique user-defined name for this image.
- Names starting with `ibm-` are not allowed. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :param 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():
+class InstanceGroupManagerPolicyCollectionFirst():
"""
- ImageReference.
+ A link to the first page of resources.
- :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 user-defined or system-provided name for this image.
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- crn: str,
- href: str,
- id: str,
- name: str,
- *,
- deleted: 'ImageReferenceDeleted' = None) -> None:
+ href: str) -> None:
"""
- Initialize a ImageReference object.
+ Initialize a InstanceGroupManagerPolicyCollectionFirst 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 user-defined or system-provided name for this image.
- :param ImageReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted and provides
- 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
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageReference':
- """Initialize a ImageReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollectionFirst':
+ """Initialize a InstanceGroupManagerPolicyCollectionFirst 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 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in ImageReference JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageReference object from a json dictionary."""
+ """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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -23594,56 +31713,56 @@ 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 InstanceGroupManagerPolicyCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageReference') -> 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: 'ImageReference') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageReferenceDeleted():
+class InstanceGroupManagerPolicyCollectionNext():
"""
- 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) -> None:
+ href: str) -> None:
"""
- Initialize a ImageReferenceDeleted object.
+ Initialize a InstanceGroupManagerPolicyCollectionNext 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) -> 'ImageReferenceDeleted':
- """Initialize a ImageReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyCollectionNext':
+ """Initialize a InstanceGroupManagerPolicyCollectionNext 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 ImageReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerPolicyCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageReferenceDeleted 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, '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):
@@ -23651,76 +31770,72 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ImageReferenceDeleted object."""
+ """Return a `str` version of this InstanceGroupManagerPolicyCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageReferenceDeleted') -> 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: 'ImageReferenceDeleted') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ImageStatusReason():
+class InstanceGroupManagerPolicyPatch():
"""
- ImageStatusReason.
+ InstanceGroupManagerPolicyPatch.
- :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 metric_type: (optional) The type of metric to be evaluated.
+ :attr int metric_value: (optional) The metric value to be evaluated.
+ :attr str name: (optional) The user-defined name for this instance group manager
+ policy.
"""
def __init__(self,
- code: str,
- message: str,
*,
- more_info: str = None) -> None:
+ metric_type: str = None,
+ metric_value: int = None,
+ name: str = None) -> None:
"""
- Initialize a ImageStatusReason object.
+ Initialize a InstanceGroupManagerPolicyPatch 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 metric_type: (optional) The type of metric to be evaluated.
+ :param int metric_value: (optional) The metric value to be evaluated.
+ :param str name: (optional) The user-defined name for this instance group
+ manager policy.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ self.metric_type = metric_type
+ self.metric_value = metric_value
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ImageStatusReason':
- """Initialize a ImageStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyPatch':
+ """Initialize a InstanceGroupManagerPolicyPatch 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')
+ 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ImageStatusReason 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, '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, '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
return _dict
def _to_dict(self):
@@ -23728,364 +31843,124 @@ 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 InstanceGroupManagerPolicyPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ImageStatusReason') -> 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: 'ImageStatusReason') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
+ class MetricTypeEnum(str, Enum):
"""
- A snake case string succinctly identifying the status reason.
+ The type of metric to be evaluated.
"""
- ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
- ENCRYPTION_KEY_DISABLED = 'encryption_key_disabled'
- IMAGE_REQUEST_IN_PROGRESS = 'image_request_in_progress'
- IMAGE_REQUEST_QUEUED = 'image_request_queued'
+ CPU = 'cpu'
+ MEMORY = 'memory'
+ NETWORK_IN = 'network_in'
+ NETWORK_OUT = 'network_out'
-class Instance():
+class InstanceGroupManagerPolicyPrototype():
"""
- 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 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 int memory: The amount of memory, truncated to whole gibibytes.
- :attr str name: The user-defined name for this virtual server instance (and
- default system hostname).
- :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 for this virtual server
- instance.
- :attr ResourceGroupReference resource_group: The resource group for this
- instance.
- :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.
- :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.
+ InstanceGroupManagerPolicyPrototype.
+
+ :attr str name: (optional) The user-defined name for this instance group manager
+ policy. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
+ """
+
+ def __init__(self,
+ *,
+ name: str = None) -> None:
+ """
+ Initialize a InstanceGroupManagerPolicyPrototype object.
+
+ :param str name: (optional) The user-defined name for this instance group
+ manager policy. Names must be unique within the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype']))
+ raise Exception(msg)
+
+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 user-defined name for this instance group manager policy.
"""
def __init__(self,
- bandwidth: int,
- boot_volume_attachment: 'VolumeAttachmentReferenceInstanceContext',
- created_at: datetime,
- crn: str,
- disks: List['InstanceDisk'],
href: str,
id: str,
- memory: int,
name: str,
- network_interfaces: List['NetworkInterfaceInstanceContextReference'],
- primary_network_interface: 'NetworkInterfaceInstanceContextReference',
- profile: 'InstanceProfileReference',
- resource_group: 'ResourceGroupReference',
- 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',
*,
- dedicated_host: 'DedicatedHostReference' = None,
- gpu: 'InstanceGPU' = None,
- image: 'ImageReference' = None,
- placement_target: 'InstancePlacementTarget' = None) -> None:
+ deleted: 'InstanceGroupManagerPolicyReferenceDeleted' = None) -> None:
"""
- Initialize a Instance object.
+ Initialize a InstanceGroupManagerPolicyReference object.
- :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 int memory: The amount of memory, truncated to whole gibibytes.
- :param str name: The user-defined name for this virtual server instance
- (and default system hostname).
- :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 for this virtual
- server instance.
- :param ResourceGroupReference resource_group: The resource group for this
- instance.
- :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.
- :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 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 policy.
+ :param str id: The unique identifier for this instance group manager
+ policy.
+ :param str name: The user-defined name for this instance group manager
+ policy.
+ :param InstanceGroupManagerPolicyReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted
+ and provides
+ some supplementary information.
"""
- self.bandwidth = bandwidth
- self.boot_volume_attachment = boot_volume_attachment
- 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.memory = memory
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.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) -> 'InstanceGroupManagerPolicyReference':
+ """Initialize a InstanceGroupManagerPolicyReference object from a json dictionary."""
args = {}
- 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 '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(x) for x 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 '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 Instance JSON')
+ 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 Instance JSON')
- if 'image' in _dict:
- args['image'] = ImageReference.from_dict(_dict.get('image'))
- if 'memory' in _dict:
- args['memory'] = _dict.get('memory')
- else:
- raise ValueError('Required property \'memory\' not present in Instance JSON')
+ 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 Instance JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfaceInstanceContextReference.from_dict(x) for x 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 '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(x) for x 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(x) for x in _dict.get('volume_attachments')]
- else:
- 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 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')
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerPolicyReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Instance 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, 'bandwidth') and self.bandwidth is not None:
- _dict['bandwidth'] = self.bandwidth
- if hasattr(self, 'boot_volume_attachment') and self.boot_volume_attachment is not None:
- _dict['boot_volume_attachment'] = self.boot_volume_attachment.to_dict()
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'dedicated_host') and self.dedicated_host is not None:
- _dict['dedicated_host'] = self.dedicated_host.to_dict()
- if hasattr(self, 'disks') and self.disks is not None:
- _dict['disks'] = [x.to_dict() for x in self.disks]
- if hasattr(self, 'gpu') and self.gpu is not None:
- _dict['gpu'] = self.gpu.to_dict()
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'image') and self.image is not None:
- _dict['image'] = self.image.to_dict()
- 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:
- _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
- if hasattr(self, 'placement_target') and self.placement_target is not None:
- if isinstance(self.placement_target, dict):
- _dict['placement_target'] = self.placement_target
- else:
- _dict['placement_target'] = self.placement_target.to_dict()
- if hasattr(self, 'primary_network_interface') and self.primary_network_interface is not None:
- _dict['primary_network_interface'] = self.primary_network_interface.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- 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:
- _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons]
- if hasattr(self, 'total_network_bandwidth') and self.total_network_bandwidth is not None:
- _dict['total_network_bandwidth'] = self.total_network_bandwidth
- if hasattr(self, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
- if hasattr(self, 'vcpu') and self.vcpu is not None:
- _dict['vcpu'] = self.vcpu.to_dict()
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments]
- if hasattr(self, 'vpc') and self.vpc is not None:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -24093,143 +31968,56 @@ 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 InstanceGroupManagerPolicyReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Instance') -> 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: 'Instance') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class StatusEnum(str, Enum):
- """
- The status of the virtual server instance.
- """
- DELETING = 'deleting'
- FAILED = 'failed'
- PAUSED = 'paused'
- PAUSING = 'pausing'
- PENDING = 'pending'
- RESTARTING = 'restarting'
- RESUMING = 'resuming'
- RUNNING = 'running'
- STARTING = 'starting'
- STOPPED = 'stopped'
- STOPPING = 'stopping'
-
-
-class InstanceAction():
+class InstanceGroupManagerPolicyReferenceDeleted():
"""
- InstanceAction.
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :attr datetime completed_at: (optional) The date and time that the action was
- completed.
- :attr datetime created_at: The date and time that the action was created.
- :attr bool force: (optional) If set to true, the action will be forced
- immediately, and all queued actions deleted. Ignored for the start action.
- :attr str href: The URL for this instance action.
- :attr str id: The identifier for this instance action.
- :attr datetime started_at: (optional) The date and time that the action was
- started.
- :attr str status: The current status of this action.
- :attr str type: The type of action.
+ :attr str more_info: Link to documentation about deleted resources.
"""
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:
+ more_info: str) -> None:
"""
- Initialize a InstanceAction object.
+ Initialize a InstanceGroupManagerPolicyReferenceDeleted object.
- :param datetime created_at: The date and time that the action was created.
- :param str href: The URL for this instance action.
- :param str id: The identifier for this instance action.
- :param str status: The current status of this action.
- :param str type: The type of action.
- :param datetime completed_at: (optional) The date and time that the action
- was completed.
- :param bool force: (optional) If set to true, the action will be forced
- immediately, and all queued actions deleted. Ignored for the start action.
- :param datetime started_at: (optional) The date and time that the action
- was started.
+ :param str more_info: Link to documentation about deleted resources.
"""
- 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
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceAction':
- """Initialize a InstanceAction object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReferenceDeleted':
+ """Initialize a InstanceGroupManagerPolicyReferenceDeleted 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 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')
+ if 'more_info' in _dict:
+ args['more_info'] = _dict.get('more_info')
else:
- raise ValueError('Required property \'type\' not present in InstanceAction JSON')
+ raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerPolicyReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceAction 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, '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
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -24237,120 +32025,117 @@ 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 InstanceGroupManagerPolicyReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceAction') -> 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: 'InstanceAction') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerPolicyReferenceDeleted') -> 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.
- """
- COMPLETED = 'completed'
- FAILED = 'failed'
- PENDING = 'pending'
- RUNNING = 'running'
+class InstanceGroupManagerPrototype():
+ """
+ InstanceGroupManagerPrototype.
+ :attr bool management_enabled: (optional) Indicates whether this manager will
+ control the instance group.
+ :attr str name: (optional) The user-defined name for this instance group
+ manager. Names must be unique within the instance group. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ """
- class TypeEnum(str, Enum):
- """
- The type of action.
+ def __init__(self,
+ *,
+ management_enabled: bool = None,
+ name: str = None) -> None:
"""
- REBOOT = 'reboot'
- START = 'start'
- STOP = 'stop'
+ Initialize a InstanceGroupManagerPrototype object.
+ :param bool management_enabled: (optional) Indicates whether this manager
+ will control the instance group.
+ :param str name: (optional) The user-defined name for this instance group
+ manager. Names must be unique within the instance group. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype', 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype']))
+ raise Exception(msg)
-class InstanceCollection():
+class InstanceGroupManagerReference():
"""
- InstanceCollection.
+ InstanceGroupManagerReference.
- :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 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 user-defined name for this instance group manager.
"""
def __init__(self,
- first: 'InstanceCollectionFirst',
- instances: List['Instance'],
- limit: int,
- total_count: int,
+ href: str,
+ id: str,
+ name: str,
*,
- next: 'InstanceCollectionNext' = None) -> None:
+ deleted: 'InstanceGroupManagerReferenceDeleted' = None) -> None:
"""
- Initialize a InstanceCollection object.
+ Initialize a InstanceGroupManagerReference 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 href: The URL for this instance group manager.
+ :param str id: The unique identifier for this instance group manager.
+ :param str name: The user-defined name for this instance group manager.
+ :param InstanceGroupManagerReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted and
+ provides
+ some supplementary information.
"""
- self.first = first
- self.instances = instances
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ 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) -> 'InstanceGroupManagerReference':
+ """Initialize a InstanceGroupManagerReference 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(x) for x in _dict.get('instances')]
+ 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 \'instances\' not present in InstanceCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'href\' not present in InstanceGroupManagerReference JSON')
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
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')
+ raise ValueError('Required property \'id\' not present in InstanceGroupManagerReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
else:
- raise ValueError('Required property \'total_count\' not present in InstanceCollection JSON')
+ raise ValueError('Required property \'name\' not present in InstanceGroupManagerReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceCollection 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'instances') and self.instances is not None:
- _dict['instances'] = [x.to_dict() for x in self.instances]
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -24358,55 +32143,56 @@ 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 InstanceGroupManagerReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceCollection') -> 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: 'InstanceCollection') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceCollectionFirst():
+class InstanceGroupManagerReferenceDeleted():
"""
- 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) -> None:
+ more_info: str) -> None:
"""
- Initialize a InstanceCollectionFirst object.
+ Initialize a InstanceGroupManagerReferenceDeleted 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) -> 'InstanceCollectionFirst':
- """Initialize a InstanceCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerReferenceDeleted':
+ """Initialize a InstanceGroupManagerReferenceDeleted 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 InstanceCollectionFirst JSON')
+ raise ValueError('Required property \'more_info\' not present in InstanceGroupManagerReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceCollectionFirst object from a json dictionary."""
+ """Initialize a InstanceGroupManagerReferenceDeleted object from 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):
@@ -24414,56 +32200,57 @@ 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 InstanceGroupManagerReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceCollectionFirst') -> bool:
+ 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: 'InstanceCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceCollectionNext():
+class InstanceGroupManagerScheduledActionGroup():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ InstanceGroupManagerScheduledActionGroup.
- :attr str href: The URL for a page of resources.
+ :attr int membership_count: The number of members the instance group should have
+ at the scheduled time.
"""
def __init__(self,
- href: str) -> None:
+ membership_count: int) -> None:
"""
- Initialize a InstanceCollectionNext object.
+ Initialize a InstanceGroupManagerScheduledActionGroup object.
- :param str href: The URL for a page of resources.
+ :param int membership_count: The number of members the instance group
+ should have at the scheduled time.
"""
- self.href = href
+ self.membership_count = membership_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceCollectionNext':
- """Initialize a InstanceCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroup':
+ """Initialize a InstanceGroupManagerScheduledActionGroup object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if 'membership_count' in _dict:
+ args['membership_count'] = _dict.get('membership_count')
else:
- raise ValueError('Required property \'href\' not present in InstanceCollectionNext JSON')
+ raise ValueError('Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroup JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceCollectionNext object from a json dictionary."""
+ """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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'membership_count') and self.membership_count is not None:
+ _dict['membership_count'] = self.membership_count
return _dict
def _to_dict(self):
@@ -24471,115 +32258,57 @@ 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 InstanceGroupManagerScheduledActionGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceCollectionNext') -> bool:
+ 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: 'InstanceCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerScheduledActionGroup') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceConsoleAccessToken():
+class InstanceGroupManagerScheduledActionGroupPrototype():
"""
- The instance console access token information.
+ InstanceGroupManagerScheduledActionGroupPrototype.
- :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 int membership_count: The number of members the instance group should have
+ at the scheduled time.
"""
def __init__(self,
- access_token: str,
- console_type: str,
- created_at: datetime,
- expires_at: datetime,
- force: bool,
- href: str) -> None:
+ membership_count: int) -> None:
"""
- Initialize a InstanceConsoleAccessToken object.
+ Initialize a InstanceGroupManagerScheduledActionGroupPrototype 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 int membership_count: The number of members the instance group
+ should have at the scheduled time.
"""
- 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.membership_count = membership_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceConsoleAccessToken':
- """Initialize a InstanceConsoleAccessToken object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroupPrototype':
+ """Initialize a InstanceGroupManagerScheduledActionGroupPrototype 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 'membership_count' in _dict:
+ args['membership_count'] = _dict.get('membership_count')
else:
- raise ValueError('Required property \'href\' not present in InstanceConsoleAccessToken JSON')
+ raise ValueError('Required property \'membership_count\' not present in InstanceGroupManagerScheduledActionGroupPrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceConsoleAccessToken object from a json dictionary."""
+ """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, '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, 'membership_count') and self.membership_count is not None:
+ _dict['membership_count'] = self.membership_count
return _dict
def _to_dict(self):
@@ -24587,112 +32316,167 @@ 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 InstanceGroupManagerScheduledActionGroupPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceConsoleAccessToken') -> bool:
+ 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: 'InstanceConsoleAccessToken') -> bool:
+ def __ne__(self, other: 'InstanceGroupManagerScheduledActionGroupPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ConsoleTypeEnum(str, Enum):
+class InstanceGroupManagerScheduledActionManager():
+ """
+ InstanceGroupManagerScheduledActionManager.
+
+ """
+
+ def __init__(self) -> None:
"""
- The instance console type for which this token may be used.
+ Initialize a InstanceGroupManagerScheduledActionManager object.
+
"""
- SERIAL = 'serial'
- VNC = 'vnc'
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceGroupManagerScheduledActionManagerAutoScale']))
+ raise Exception(msg)
+class InstanceGroupManagerScheduledActionManagerPrototype():
+ """
+ InstanceGroupManagerScheduledActionManagerPrototype.
-class InstanceDisk():
"""
- InstanceDisk.
- :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 user-defined name for this disk.
- :attr str resource_type: The resource type.
- :attr int size: The size of the disk in GB (gigabytes).
+ 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 user-defined name for this instance group membership. Names
+ must be unique within 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,
- interface_type: str,
+ instance: 'InstanceReference',
+ instance_template: 'InstanceTemplateReference',
name: str,
- resource_type: str,
- size: int) -> None:
+ status: str,
+ updated_at: datetime,
+ *,
+ pool_member: 'LoadBalancerPoolMemberReference' = None) -> None:
"""
- Initialize a InstanceDisk object.
+ Initialize a InstanceGroupMembership 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 user-defined name for this disk.
- :param str resource_type: The resource type.
- :param int size: The size of the disk in GB (gigabytes).
+ :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 user-defined name for this instance group membership.
+ Names must be unique within 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.created_at = created_at
+ self.delete_instance_on_membership_delete = delete_instance_on_membership_delete
self.href = href
self.id = id
- self.interface_type = interface_type
+ self.instance = instance
+ self.instance_template = instance_template
self.name = name
- self.resource_type = resource_type
- self.size = size
+ self.pool_member = pool_member
+ self.status = status
+ self.updated_at = updated_at
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceDisk':
- """Initialize a InstanceDisk object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembership':
+ """Initialize a InstanceGroupMembership 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')
+ 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 InstanceDisk 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 InstanceDisk JSON')
- if 'interface_type' in _dict:
- args['interface_type'] = _dict.get('interface_type')
+ 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 \'interface_type\' not present in InstanceDisk JSON')
+ 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 InstanceDisk JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ 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 \'resource_type\' not present in InstanceDisk JSON')
- if 'size' in _dict:
- args['size'] = _dict.get('size')
+ 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 \'size\' not present in InstanceDisk JSON')
+ raise ValueError('Required property \'updated_at\' not present in InstanceGroupMembership JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceDisk object from a json dictionary."""
+ """Initialize a InstanceGroupMembership object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -24700,18 +32484,24 @@ 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, 'href') 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') and self.instance is not None:
+ _dict['instance'] = self.instance.to_dict()
+ if hasattr(self, 'instance_template') and self.instance_template is not None:
+ _dict['instance_template'] = self.instance_template.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'size') and self.size is not None:
- _dict['size'] = self.size
+ if hasattr(self, 'pool_member') and self.pool_member is not None:
+ _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)
return _dict
def _to_dict(self):
@@ -24719,74 +32509,120 @@ 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 InstanceGroupMembership object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDisk') -> 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: 'InstanceDisk') -> bool:
+ def __ne__(self, other: 'InstanceGroupMembership') -> 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):
+ class StatusEnum(str, Enum):
"""
- The resource type.
+ 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.
"""
- INSTANCE_DISK = 'instance_disk'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ HEALTHY = 'healthy'
+ PENDING = 'pending'
+ UNHEALTHY = 'unhealthy'
-class InstanceDiskCollection():
+class InstanceGroupMembershipCollection():
"""
- InstanceDiskCollection.
+ InstanceGroupMembershipCollection.
- :attr List[InstanceDisk] disks: Collection of the instance's disks.
+ :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,
- disks: List['InstanceDisk']) -> None:
+ first: 'InstanceGroupMembershipCollectionFirst',
+ limit: int,
+ memberships: List['InstanceGroupMembership'],
+ total_count: int,
+ *,
+ next: 'InstanceGroupMembershipCollectionNext' = None) -> None:
"""
- Initialize a InstanceDiskCollection object.
+ Initialize a InstanceGroupMembershipCollection object.
- :param List[InstanceDisk] disks: Collection of the instance's disks.
+ :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.disks = disks
+ self.first = first
+ self.limit = limit
+ self.memberships = memberships
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceDiskCollection':
- """Initialize a InstanceDiskCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollection':
+ """Initialize a InstanceGroupMembershipCollection object from a json dictionary."""
args = {}
- if 'disks' in _dict:
- args['disks'] = [InstanceDisk.from_dict(x) for x in _dict.get('disks')]
+ if 'first' in _dict:
+ args['first'] = InstanceGroupMembershipCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'disks\' not present in InstanceDiskCollection JSON')
+ 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(x) for x 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 InstanceDiskCollection 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, 'disks') and self.disks is not None:
- _dict['disks'] = [x.to_dict() for x in self.disks]
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'memberships') and self.memberships is not None:
+ _dict['memberships'] = [x.to_dict() for x in self.memberships]
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -24794,54 +32630,55 @@ 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 InstanceGroupMembershipCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDiskCollection') -> 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: 'InstanceDiskCollection') -> bool:
+ def __ne__(self, other: 'InstanceGroupMembershipCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceDiskPatch():
+class InstanceGroupMembershipCollectionFirst():
"""
- InstanceDiskPatch.
+ A link to the first page of resources.
- :attr str name: (optional) The user-defined name for this disk.
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- *,
- name: str = None) -> None:
+ href: str) -> None:
"""
- Initialize a InstanceDiskPatch object.
+ Initialize a InstanceGroupMembershipCollectionFirst object.
- :param str name: (optional) The user-defined name for this disk.
+ :param str href: The URL for a page of resources.
"""
- self.name = name
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceDiskPatch':
- """Initialize a InstanceDiskPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionFirst':
+ """Initialize a InstanceGroupMembershipCollectionFirst 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 InstanceGroupMembershipCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceDiskPatch 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, '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):
@@ -24849,98 +32686,56 @@ 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 InstanceGroupMembershipCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDiskPatch') -> 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: 'InstanceDiskPatch') -> bool:
+ def __ne__(self, other: 'InstanceGroupMembershipCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceDiskReference():
+class InstanceGroupMembershipCollectionNext():
"""
- InstanceDiskReference.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :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 user-defined name for this disk.
- :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: 'InstanceDiskReferenceDeleted' = None) -> None:
+ href: str) -> None:
"""
- Initialize a InstanceDiskReference object.
+ Initialize a InstanceGroupMembershipCollectionNext object.
- :param str href: The URL for this instance disk.
- :param str id: The unique identifier for this instance disk.
- :param str name: The user-defined name for this disk.
- :param str 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 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) -> 'InstanceDiskReference':
- """Initialize a InstanceDiskReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipCollectionNext':
+ """Initialize a InstanceGroupMembershipCollectionNext 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')
- 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')
+ raise ValueError('Required property \'href\' not present in InstanceGroupMembershipCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceDiskReference 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, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -24948,63 +32743,56 @@ 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 InstanceGroupMembershipCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDiskReference') -> 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: 'InstanceDiskReference') -> bool:
+ def __ne__(self, other: 'InstanceGroupMembershipCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
- INSTANCE_DISK = 'instance_disk'
-
-
-class InstanceDiskReferenceDeleted():
+class InstanceGroupMembershipPatch():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ InstanceGroupMembershipPatch.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr str name: (optional) The user-defined name for this instance group
+ membership. Names must be unique within the instance group.
"""
def __init__(self,
- more_info: str) -> None:
+ *,
+ name: str = None) -> None:
"""
- Initialize a InstanceDiskReferenceDeleted object.
+ Initialize a InstanceGroupMembershipPatch object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str name: (optional) The user-defined name for this instance group
+ membership. Names must be unique within the instance group.
"""
- self.more_info = more_info
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceDiskReferenceDeleted':
- """Initialize a InstanceDiskReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupMembershipPatch':
+ """Initialize a InstanceGroupMembershipPatch 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 'name' in _dict:
+ args['name'] = _dict.get('name')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceDiskReferenceDeleted 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, '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):
@@ -25012,85 +32800,140 @@ 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 InstanceGroupMembershipPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceDiskReferenceDeleted') -> 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: 'InstanceDiskReferenceDeleted') -> bool:
+ def __ne__(self, other: 'InstanceGroupMembershipPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGPU():
+class InstanceGroupPatch():
"""
- The virtual server instance GPU configuration.
+ To add or update load balancer specification for an instance group the
+ `membership_count` must first be set to 0.
- :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 int application_port: (optional) Required if specifying a load balancer
+ pool only. Used by the instance group when scaling up instances to supply the
+ port for the load balancer pool member.
+ :attr InstanceTemplateIdentity instance_template: (optional) Identifies an
+ instance template by a unique property.
+ :attr LoadBalancerIdentity load_balancer: (optional) The load balancer that the
+ load balancer pool used by this group
+ is in. Required when using a load balancer pool.
+ :attr LoadBalancerPoolIdentity load_balancer_pool: (optional) If specified, the
+ load balancer pool will be managed by this
+ group. Instances created by this group will have a new load
+ balancer pool member in that pool created. Must be used with
+ `application_port`.
+ :attr int membership_count: (optional) The number of instances in the instance
+ group.
+ :attr str name: (optional) The user-defined name for this instance group.
+ :attr List[SubnetIdentity] subnets: (optional) The subnets to use when creating
+ new instances.
"""
def __init__(self,
- count: int,
- manufacturer: str,
- memory: int,
- model: str) -> None:
+ *,
+ 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 InstanceGPU object.
+ Initialize a InstanceGroupPatch 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 int application_port: (optional) Required if specifying a load
+ balancer pool only. Used by the instance group when scaling up instances to
+ supply the port for the load balancer pool member.
+ :param InstanceTemplateIdentity instance_template: (optional) Identifies an
+ instance template by a unique property.
+ :param LoadBalancerIdentity load_balancer: (optional) The load balancer
+ that the load balancer pool used by this group
+ is in. Required when using a load balancer pool.
+ :param LoadBalancerPoolIdentity load_balancer_pool: (optional) If
+ specified, the load balancer pool will be managed by this
+ group. Instances created by this group will have a new load
+ balancer pool member in that pool created. Must be used with
+ `application_port`.
+ :param int membership_count: (optional) The number of instances in the
+ instance group.
+ :param str name: (optional) The user-defined name for this instance group.
+ :param List[SubnetIdentity] subnets: (optional) The subnets to use when
+ creating new instances.
"""
- self.count = count
- self.manufacturer = manufacturer
- self.memory = memory
- self.model = model
+ 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) -> 'InstanceGPU':
- """Initialize a InstanceGPU object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupPatch':
+ """Initialize a InstanceGroupPatch 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 '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 InstanceGPU 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, '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, '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 x in self.subnets:
+ if isinstance(x, dict):
+ subnets_list.append(x)
+ else:
+ subnets_list.append(x.to_dict())
+ _dict['subnets'] = subnets_list
return _dict
def _to_dict(self):
@@ -25098,222 +32941,155 @@ 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 InstanceGroupPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGPU') -> 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: 'InstanceGPU') -> bool:
+ def __ne__(self, other: 'InstanceGroupPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroup():
+class InstanceGroupReference():
"""
- InstanceGroup.
+ InstanceGroupReference.
- :attr int application_port: (optional) Required if specifying a load balancer
- pool only. Used by the instance group when scaling up instances to supply the
- port for the load balancer pool member.
- :attr datetime created_at: The date and time that the instance group was
- created.
: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 InstanceTemplateReference instance_template: The template used to create
- new instances for this group.
- :attr LoadBalancerPoolReference load_balancer_pool: (optional) The load balancer
- pool managed by this group. Instances created
- by this group will have a new load balancer pool member in that
- pool created.
- :attr List[InstanceGroupManagerReference] managers: The managers for the
- instance group.
- :attr int membership_count: The number of instances in the instance group.
:attr str name: The user-defined name for this instance group.
- :attr 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_group: 'ResourceGroupReference',
- status: str,
- subnets: List['SubnetReference'],
- updated_at: datetime,
- vpc: 'VPCReference',
*,
- application_port: int = None,
- load_balancer_pool: 'LoadBalancerPoolReference' = None) -> None:
+ deleted: 'InstanceGroupReferenceDeleted' = None) -> None:
"""
- Initialize a InstanceGroup object.
+ Initialize a InstanceGroupReference 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 user-defined name for this instance group.
- :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) Required if specifying a load
- balancer pool only. Used by the instance group when scaling up instances to
- supply the port for the load balancer pool member.
- :param LoadBalancerPoolReference load_balancer_pool: (optional) The load
- balancer pool managed by this group. Instances created
- by this group will have a new load balancer pool member in that
- pool created.
+ :param InstanceGroupReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ some supplementary information.
"""
- self.application_port = application_port
- self.created_at = created_at
self.crn = crn
+ self.deleted = deleted
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_group = resource_group
- self.status = status
- self.subnets = subnets
- self.updated_at = updated_at
- self.vpc = vpc
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroup':
- """Initialize a InstanceGroup object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceGroupReference':
+ """Initialize a InstanceGroupReference 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')
+ 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 InstanceGroup 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 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(x) for x 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')
+ 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 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(x) for x 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'))
+ raise ValueError('Required property \'name\' not present in InstanceGroupReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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:
+ _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 InstanceGroupReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'InstanceGroupReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class InstanceGroupReferenceDeleted():
+ """
+ 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 InstanceGroupReferenceDeleted 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."""
+ args = {}
+ if 'more_info' in _dict:
+ args['more_info'] = _dict.get('more_info')
else:
- raise ValueError('Required property \'vpc\' not present in InstanceGroup JSON')
+ raise ValueError('Required property \'more_info\' not present in InstanceGroupReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroup 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, '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:
- _dict['instance_template'] = self.instance_template.to_dict()
- if hasattr(self, 'load_balancer_pool') and self.load_balancer_pool is not None:
- _dict['load_balancer_pool'] = self.load_balancer_pool.to_dict()
- if hasattr(self, 'managers') and self.managers is not None:
- _dict['managers'] = [x.to_dict() for x in self.managers]
- if hasattr(self, 'membership_count') and self.membership_count is not None:
- _dict['membership_count'] = self.membership_count
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'subnets') and self.subnets is not None:
- _dict['subnets'] = [x.to_dict() for x in self.subnets]
- if hasattr(self, 'updated_at') and self.updated_at is not None:
- _dict['updated_at'] = datetime_to_string(self.updated_at)
- if hasattr(self, 'vpc') and self.vpc is not None:
- _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -25321,116 +33097,137 @@ 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 InstanceGroupReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroup') -> 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: 'InstanceGroup') -> bool:
+ def __ne__(self, other: 'InstanceGroupReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class StatusEnum(str, Enum):
+class InstanceInitialization():
+ """
+ InstanceInitialization.
+
+ :attr List[KeyReference] keys: The public SSH keys used at instance
+ initialization.
+ :attr InstanceInitializationPassword password: (optional)
+ """
+
+ def __init__(self,
+ keys: List['KeyReference'],
+ *,
+ password: 'InstanceInitializationPassword' = None) -> 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 InstanceInitialization object.
+
+ :param List[KeyReference] keys: The public SSH keys used at instance
+ initialization.
+ :param InstanceInitializationPassword password: (optional)
"""
- DELETING = 'deleting'
- HEALTHY = 'healthy'
- SCALING = 'scaling'
- UNHEALTHY = 'unhealthy'
+ self.keys = keys
+ self.password = password
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstanceInitialization':
+ """Initialize a InstanceInitialization object from a json dictionary."""
+ args = {}
+ if 'keys' in _dict:
+ args['keys'] = [KeyReference.from_dict(x) for x in _dict.get('keys')]
+ else:
+ 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 InstanceInitialization object from a json dictionary."""
+ return cls.from_dict(_dict)
-class InstanceGroupCollection():
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'keys') and self.keys is not None:
+ _dict['keys'] = [x.to_dict() for x in self.keys]
+ if hasattr(self, 'password') and self.password is not None:
+ _dict['password'] = self.password.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 InstanceInitialization object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'InstanceInitialization') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class InstanceInitializationPassword():
"""
- InstanceGroupCollection.
+ InstanceInitializationPassword.
- :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.
+ :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,
- first: 'InstanceGroupCollectionFirst',
- instance_groups: List['InstanceGroup'],
- limit: int,
- total_count: int,
- *,
- next: 'InstanceGroupCollectionNext' = None) -> None:
+ encrypted_password: bytes,
+ encryption_key: 'KeyIdentityByFingerprint') -> None:
"""
- Initialize a InstanceGroupCollection object.
+ Initialize a InstanceInitializationPassword 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 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.first = first
- self.instance_groups = instance_groups
- self.limit = limit
- self.next = next
- self.total_count = total_count
+ self.encrypted_password = encrypted_password
+ self.encryption_key = encryption_key
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollection':
- """Initialize a InstanceGroupCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceInitializationPassword':
+ """Initialize a InstanceInitializationPassword object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = InstanceGroupCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in InstanceGroupCollection JSON')
- if 'instance_groups' in _dict:
- args['instance_groups'] = [InstanceGroup.from_dict(x) for x in _dict.get('instance_groups')]
- else:
- raise ValueError('Required property \'instance_groups\' not present in InstanceGroupCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ if 'encrypted_password' in _dict:
+ args['encrypted_password'] = base64.b64decode(_dict.get('encrypted_password'))
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 \'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 \'total_count\' not present in InstanceGroupCollection JSON')
+ raise ValueError('Required property \'encryption_key\' not present in InstanceInitializationPassword JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupCollection 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'instance_groups') and self.instance_groups is not None:
- _dict['instance_groups'] = [x.to_dict() for x in self.instance_groups]
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'encrypted_password') and self.encrypted_password is not None:
+ _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8')
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
return _dict
def _to_dict(self):
@@ -25438,55 +33235,124 @@ 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 InstanceInitializationPassword object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupCollection') -> 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: 'InstanceGroupCollection') -> bool:
+ def __ne__(self, other: 'InstanceInitializationPassword') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupCollectionFirst():
+class InstancePatch():
"""
- A link to the first page of resources.
+ InstancePatch.
- :attr str href: The URL for a page of resources.
+ :attr str name: (optional) The user-defined name for this virtual server
+ instance (and default 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`.
+ :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,
- href: str) -> None:
+ *,
+ name: str = None,
+ placement_target: 'InstancePlacementTargetPatch' = None,
+ profile: 'InstancePatchProfile' = None,
+ total_volume_bandwidth: int = None) -> None:
"""
- Initialize a InstanceGroupCollectionFirst object.
+ Initialize a InstancePatch object.
- :param str href: The URL for a page of resources.
+ :param str name: (optional) The user-defined name for this virtual server
+ instance (and default 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`.
+ :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.href = href
+ self.name = name
+ self.placement_target = placement_target
+ self.profile = profile
+ self.total_volume_bandwidth = total_volume_bandwidth
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionFirst':
- """Initialize a InstanceGroupCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstancePatch':
+ """Initialize a InstancePatch 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')
+ 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupCollectionFirst 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, '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, '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, '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):
@@ -25494,56 +33360,281 @@ 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 InstancePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupCollectionFirst') -> 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: 'InstanceGroupCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstancePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupCollectionNext():
+class InstancePatchProfile():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ 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`.
- :attr str href: The URL for a page of resources.
+ """
+
+ 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:
+ """
+ Initialize a InstancePlacementTarget object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePlacementTargetDedicatedHostGroupReference', 'InstancePlacementTargetDedicatedHostReference', 'InstancePlacementTargetPlacementGroupReference']))
+ raise Exception(msg)
+
+class InstancePlacementTargetPatch():
+ """
+ InstancePlacementTargetPatch.
+
+ """
+
+ def __init__(self) -> 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: (optional) 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 InstanceProfileOSArchitecture os_architecture:
+ :attr InstanceProfilePortSpeed port_speed:
+ :attr InstanceProfileVolumeBandwidth total_volume_bandwidth:
+ :attr InstanceProfileVCPUArchitecture vcpu_architecture:
+ :attr InstanceProfileVCPU vcpu_count:
"""
def __init__(self,
- href: str) -> None:
+ bandwidth: 'InstanceProfileBandwidth',
+ disks: List['InstanceProfileDisk'],
+ href: str,
+ memory: 'InstanceProfileMemory',
+ name: str,
+ os_architecture: 'InstanceProfileOSArchitecture',
+ port_speed: 'InstanceProfilePortSpeed',
+ total_volume_bandwidth: 'InstanceProfileVolumeBandwidth',
+ vcpu_architecture: 'InstanceProfileVCPUArchitecture',
+ vcpu_count: 'InstanceProfileVCPU',
+ *,
+ family: str = None,
+ gpu_count: 'InstanceProfileGPU' = None,
+ gpu_manufacturer: 'InstanceProfileGPUManufacturer' = None,
+ gpu_memory: 'InstanceProfileGPUMemory' = None,
+ gpu_model: 'InstanceProfileGPUModel' = None) -> None:
"""
- Initialize a InstanceGroupCollectionNext object.
+ Initialize a InstanceProfile object.
- :param str href: The URL for a page of resources.
+ :param InstanceProfileBandwidth bandwidth:
+ :param List[InstanceProfileDisk] disks: Collection of the instance
+ profile's disks.
+ :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 InstanceProfileOSArchitecture os_architecture:
+ :param InstanceProfilePortSpeed port_speed:
+ :param InstanceProfileVolumeBandwidth total_volume_bandwidth:
+ :param InstanceProfileVCPUArchitecture vcpu_architecture:
+ :param InstanceProfileVCPU vcpu_count:
+ :param str family: (optional) The product family this virtual server
+ instance profile belongs to.
+ :param InstanceProfileGPU gpu_count: (optional)
+ :param InstanceProfileGPUManufacturer gpu_manufacturer: (optional)
+ :param InstanceProfileGPUMemory gpu_memory: (optional)
+ :param InstanceProfileGPUModel gpu_model: (optional)
"""
+ 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.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
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupCollectionNext':
- """Initialize a InstanceGroupCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfile':
+ """Initialize a InstanceProfile 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(x) for x in _dict.get('disks')]
+ else:
+ raise ValueError('Required property \'disks\' not present in InstanceProfile JSON')
+ if 'family' in _dict:
+ args['family'] = _dict.get('family')
+ 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 InstanceGroupCollectionNext JSON')
+ 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 '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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupCollectionNext 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, '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:
+ _dict['disks'] = [x.to_dict() for x in self.disks]
+ 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:
+ _dict['gpu_manufacturer'] = self.gpu_manufacturer.to_dict()
+ if hasattr(self, 'gpu_memory') and self.gpu_memory is not None:
+ if isinstance(self.gpu_memory, dict):
+ _dict['gpu_memory'] = self.gpu_memory
+ else:
+ _dict['gpu_memory'] = self.gpu_memory.to_dict()
+ if hasattr(self, 'gpu_model') and self.gpu_model is not None:
+ _dict['gpu_model'] = self.gpu_model.to_dict()
if 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, 'os_architecture') and self.os_architecture is not None:
+ _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:
+ _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()
return _dict
def _to_dict(self):
@@ -25551,193 +33642,72 @@ 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 InstanceProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupCollectionNext') -> 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: 'InstanceGroupCollectionNext') -> bool:
+ def __ne__(self, other: 'InstanceProfile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-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 user-defined name for this instance group manager. Names
- must be unique within 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.
-
- :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 user-defined name for this instance group manager.
- Names must be unique within 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)
-
-class InstanceGroupManagerAction():
+class InstanceProfileBandwidth():
"""
- InstanceGroupManagerAction.
+ InstanceProfileBandwidth.
- :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 user-defined name for this instance group manager action.
- Names must be unique within 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 modified.
"""
- 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:
+ def __init__(self) -> None:
"""
- Initialize a InstanceGroupManagerAction object.
+ Initialize a InstanceProfileBandwidth 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 user-defined name for this instance group manager
- action. Names must be unique within 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 modified.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerActionScheduledAction']))
+ ", ".join(['InstanceProfileBandwidthFixed', 'InstanceProfileBandwidthRange', 'InstanceProfileBandwidthEnum', 'InstanceProfileBandwidthDependent']))
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():
+class InstanceProfileCollection():
"""
- InstanceGroupManagerActionGroupPatch.
+ InstanceProfileCollection.
- :attr int membership_count: (optional) The number of members the instance group
- should have at the scheduled time.
+ :attr List[InstanceProfile] profiles: Collection of virtual server instance
+ profiles.
"""
def __init__(self,
- *,
- membership_count: int = None) -> None:
+ profiles: List['InstanceProfile']) -> None:
"""
- Initialize a InstanceGroupManagerActionGroupPatch object.
+ Initialize a InstanceProfileCollection object.
- :param int membership_count: (optional) The number of members the instance
- group should have at the scheduled time.
+ :param List[InstanceProfile] profiles: Collection of virtual server
+ instance profiles.
"""
- self.membership_count = membership_count
+ self.profiles = profiles
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionGroupPatch':
- """Initialize a InstanceGroupManagerActionGroupPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileCollection':
+ """Initialize a InstanceProfileCollection object from a json dictionary."""
args = {}
- if 'membership_count' in _dict:
- args['membership_count'] = _dict.get('membership_count')
+ if 'profiles' in _dict:
+ args['profiles'] = [InstanceProfile.from_dict(x) for x in _dict.get('profiles')]
+ else:
+ raise ValueError('Required property \'profiles\' not present in InstanceProfileCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionGroupPatch 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, 'membership_count') and self.membership_count is not None:
- _dict['membership_count'] = self.membership_count
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ _dict['profiles'] = [x.to_dict() for x in self.profiles]
return _dict
def _to_dict(self):
@@ -25745,66 +33715,81 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerActionGroupPatch object."""
+ """Return a `str` version of this InstanceProfileCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionGroupPatch') -> 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: 'InstanceGroupManagerActionGroupPatch') -> bool:
+ def __ne__(self, other: 'InstanceProfileCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionManagerPatch():
+class InstanceProfileDisk():
"""
- InstanceGroupManagerActionManagerPatch.
+ Disks provided by this profile.
- :attr int max_membership_count: (optional) The maximum number of members the
- instance group should have at the scheduled time.
- :attr int min_membership_count: (optional) The minimum number of members the
- instance group should have at the scheduled time.
+ :attr InstanceProfileDiskQuantity quantity:
+ :attr InstanceProfileDiskSize size:
+ :attr InstanceProfileDiskSupportedInterfaces supported_interface_types:
"""
def __init__(self,
- *,
- max_membership_count: int = None,
- min_membership_count: int = None) -> None:
+ quantity: 'InstanceProfileDiskQuantity',
+ size: 'InstanceProfileDiskSize',
+ supported_interface_types: 'InstanceProfileDiskSupportedInterfaces') -> None:
"""
- Initialize a InstanceGroupManagerActionManagerPatch object.
+ Initialize a InstanceProfileDisk object.
- :param int max_membership_count: (optional) The maximum number of members
- the instance group should have at the scheduled time.
- :param int min_membership_count: (optional) The minimum number of members
- the instance group should have at the scheduled time.
+ :param InstanceProfileDiskQuantity quantity:
+ :param InstanceProfileDiskSize size:
+ :param InstanceProfileDiskSupportedInterfaces supported_interface_types:
"""
- self.max_membership_count = max_membership_count
- self.min_membership_count = min_membership_count
+ self.quantity = quantity
+ self.size = size
+ self.supported_interface_types = supported_interface_types
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionManagerPatch':
- """Initialize a InstanceGroupManagerActionManagerPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileDisk':
+ """Initialize a InstanceProfileDisk 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 '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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionManagerPatch 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, '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, '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:
+ _dict['supported_interface_types'] = self.supported_interface_types.to_dict()
return _dict
def _to_dict(self):
@@ -25812,93 +33797,115 @@ 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 InstanceProfileDisk object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionManagerPatch') -> 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: 'InstanceGroupManagerActionManagerPatch') -> bool:
+ def __ne__(self, other: 'InstanceProfileDisk') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionPatch():
+class InstanceProfileDiskQuantity():
"""
- InstanceGroupManagerActionPatch.
+ InstanceProfileDiskQuantity.
- :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 user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
- :attr datetime run_at: (optional) The date and time the scheduled action will
- run.
+ """
+
+ 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():
+ """
+ InstanceProfileDiskSupportedInterfaces.
+
+ :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,
- *,
- cron_spec: str = None,
- group: 'InstanceGroupManagerActionGroupPatch' = None,
- manager: 'InstanceGroupManagerActionManagerPatch' = None,
- name: str = None,
- run_at: datetime = None) -> None:
+ default: str,
+ type: str,
+ values: List[str]) -> None:
"""
- Initialize a InstanceGroupManagerActionPatch object.
+ Initialize a InstanceProfileDiskSupportedInterfaces 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 user-defined name for this instance group
- manager action. Names must be unique within the instance group manager.
- :param datetime run_at: (optional) The date and time the scheduled action
- will run.
+ :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.cron_spec = cron_spec
- self.group = group
- self.manager = manager
- self.name = name
- self.run_at = run_at
+ self.default = default
+ 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) -> 'InstanceProfileDiskSupportedInterfaces':
+ """Initialize a InstanceProfileDiskSupportedInterfaces 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 '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 InstanceGroupManagerActionPatch 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, 'cron_spec') and self.cron_spec is not None:
- _dict['cron_spec'] = self.cron_spec
- if hasattr(self, 'group') and self.group is not None:
- _dict['group'] = self.group.to_dict()
- if hasattr(self, 'manager') and self.manager is not None:
- _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, '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):
@@ -25906,123 +33913,113 @@ 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 InstanceProfileDiskSupportedInterfaces object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionPatch') -> 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: 'InstanceGroupManagerActionPatch') -> bool:
+ def __ne__(self, other: 'InstanceProfileDiskSupportedInterfaces') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionPrototype():
+ 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():
"""
- InstanceGroupManagerActionPrototype.
+ InstanceProfileGPU.
- :attr str name: (optional) The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
"""
- def __init__(self,
- *,
- name: str = None) -> None:
+ def __init__(self) -> None:
"""
- Initialize a InstanceGroupManagerActionPrototype object.
+ Initialize a InstanceProfileGPU object.
- :param str name: (optional) The user-defined name for this instance group
- manager action. Names must be unique within the instance group manager.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerActionPrototypeScheduledActionPrototype']))
+ ", ".join(['InstanceProfileGPUFixed', 'InstanceProfileGPURange', 'InstanceProfileGPUEnum', 'InstanceProfileGPUDependent']))
raise Exception(msg)
-class InstanceGroupManagerActionReference():
+class InstanceProfileGPUManufacturer():
"""
- InstanceGroupManagerActionReference.
+ InstanceProfileGPUManufacturer.
- :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 user-defined name for this instance group manager action.
- Names must be unique within 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 manufacturer(s) for an instance with
+ this profile.
"""
def __init__(self,
- href: str,
- id: str,
- name: str,
- resource_type: str,
- *,
- deleted: 'InstanceGroupManagerActionReferenceDeleted' = None) -> None:
+ type: str,
+ values: List[str]) -> None:
"""
- Initialize a InstanceGroupManagerActionReference object.
+ Initialize a InstanceProfileGPUManufacturer 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 user-defined name for this instance group manager
- action. Names must be unique within 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 manufacturer(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) -> 'InstanceProfileGPUManufacturer':
+ """Initialize a InstanceProfileGPUManufacturer 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 InstanceProfileGPUManufacturer 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 InstanceProfileGPUManufacturer JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionReference 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, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ 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):
@@ -26030,63 +34027,89 @@ 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 InstanceProfileGPUManufacturer object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionReference') -> 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: 'InstanceGroupManagerActionReference') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUManufacturer') -> 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 InstanceProfileGPUMemory():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ InstanceProfileGPUMemory.
- :attr str more_info: Link to documentation about deleted resources.
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a InstanceProfileGPUMemory object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileGPUMemoryFixed', 'InstanceProfileGPUMemoryRange', 'InstanceProfileGPUMemoryEnum', 'InstanceProfileGPUMemoryDependent']))
+ raise Exception(msg)
+
+class InstanceProfileGPUModel():
+ """
+ InstanceProfileGPUModel.
+
+ :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,
- more_info: str) -> None:
+ type: str,
+ values: List[str]) -> None:
"""
- Initialize a InstanceGroupManagerActionReferenceDeleted object.
+ Initialize a InstanceProfileGPUModel 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 possible GPU model(s) for an instance with
+ this profile.
"""
- self.more_info = more_info
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerActionReferenceDeleted':
- """Initialize a InstanceGroupManagerActionReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceProfileGPUModel':
+ """Initialize a InstanceProfileGPUModel 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 InstanceGroupManagerActionReferenceDeleted JSON')
+ raise ValueError('Required property \'type\' not present in InstanceProfileGPUModel JSON')
+ if 'values' in _dict:
+ args['values'] = _dict.get('values')
+ else:
+ raise ValueError('Required property \'values\' not present in InstanceProfileGPUModel JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerActionReferenceDeleted 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, '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):
@@ -26094,110 +34117,116 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerActionReferenceDeleted object."""
+ """Return a `str` version of this InstanceProfileGPUModel object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionReferenceDeleted') -> 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: 'InstanceGroupManagerActionReferenceDeleted') -> bool:
+ def __ne__(self, other: 'InstanceProfileGPUModel') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionsCollection():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ ENUM = 'enum'
+
+
+class InstanceProfileIdentity():
"""
- InstanceGroupManagerActionsCollection.
+ Identifies an instance profile by a unique property.
- :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) -> None:
+ """
+ Initialize a InstanceProfileIdentity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileIdentityByName', 'InstanceProfileIdentityByHref']))
+ raise Exception(msg)
+
+class InstanceProfileMemory():
+ """
+ InstanceProfileMemory.
+
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a InstanceProfileMemory object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileMemoryFixed', 'InstanceProfileMemoryRange', 'InstanceProfileMemoryEnum', 'InstanceProfileMemoryDependent']))
+ raise Exception(msg)
+
+class InstanceProfileOSArchitecture():
+ """
+ InstanceProfileOSArchitecture.
+
+ :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) -> 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 x in self.actions:
- if isinstance(x, dict):
- actions_list.append(x)
- else:
- actions_list.append(x.to_dict())
- _dict['actions'] = actions_list
- if hasattr(self, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ 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):
@@ -26205,48 +34234,80 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerActionsCollection object."""
+ """Return a `str` version of this InstanceProfileOSArchitecture object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerActionsCollection') -> bool:
+ 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: 'InstanceGroupManagerActionsCollection') -> bool:
+ def __ne__(self, other: 'InstanceProfileOSArchitecture') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerActionsCollectionFirst():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ ENUM = 'enum'
+
+
+class InstanceProfilePortSpeed():
"""
- A link to the first page of resources.
+ InstanceProfilePortSpeed.
- :attr str href: The URL for a page of resources.
+ """
+
+ 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():
+ """
+ InstanceProfileReference.
+
+ :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) -> None:
+ 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:
@@ -26254,6 +34315,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):
@@ -26261,56 +34324,91 @@ 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) -> 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():
+ """
+ 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,
- href: str) -> None:
+ type: str,
+ value: str,
+ *,
+ default: str = None) -> None:
"""
- Initialize a InstanceGroupManagerActionsCollectionNext object.
+ Initialize a InstanceProfileVCPUArchitecture object.
- :param str href: The URL for a page of resources.
+ :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.href = href
+ 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):
@@ -26318,166 +34416,225 @@ 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 InstanceGroupManagerCollection():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ FIXED = 'fixed'
+
+
+class InstanceProfileVolumeBandwidth():
"""
- InstanceGroupManagerCollection.
+ InstanceProfileVolumeBandwidth.
- :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,
- first: 'InstanceGroupManagerCollectionFirst',
- limit: int,
- managers: List['InstanceGroupManager'],
- total_count: int,
- *,
- next: 'InstanceGroupManagerCollectionNext' = None) -> None:
+ def __init__(self) -> None:
"""
- Initialize a InstanceGroupManagerCollection object.
+ Initialize a InstanceProfileVolumeBandwidth 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.
"""
- self.first = first
- self.limit = limit
- self.managers = managers
- self.next = next
- self.total_count = total_count
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerCollection':
- """Initialize a InstanceGroupManagerCollection 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')
- 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 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'managers') and self.managers is not None:
- managers_list = []
- for x in self.managers:
- if isinstance(x, dict):
- managers_list.append(x)
- else:
- managers_list.append(x.to_dict())
- _dict['managers'] = managers_list
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
- return _dict
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstanceProfileVolumeBandwidthFixed', 'InstanceProfileVolumeBandwidthRange', 'InstanceProfileVolumeBandwidthEnum', 'InstanceProfileVolumeBandwidthDependent']))
+ raise Exception(msg)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+class InstancePrototype():
+ """
+ InstancePrototype.
- def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerCollection object."""
- return json.dumps(self.to_dict(), indent=2)
+ :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, at least one key must be specified, and one will be chosen
+ to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :attr str name: (optional) The unique user-defined name for this virtual server
+ instance (and default system hostname). If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional network interfaces to create for the virtual server instance.
+ :attr InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ :attr InstanceProfileIdentity profile: (optional) The profile to use for this
+ virtual server instance.
+ :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 to be made available when setting up
+ the virtual server instance.
+ :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
+ (optional) The volume attachments for this virtual server instance.
+ :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a
+ part of. If specified, it must match
+ the VPC referenced by the subnets of the instance's network interfaces.
+ """
- 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 __init__(self,
+ *,
+ keys: List['KeyIdentity'] = None,
+ name: str = None,
+ network_interfaces: List['NetworkInterfacePrototype'] = None,
+ placement_target: 'InstancePlacementTargetPrototype' = None,
+ profile: 'InstanceProfileIdentity' = None,
+ resource_group: 'ResourceGroupIdentity' = None,
+ total_volume_bandwidth: int = None,
+ user_data: str = None,
+ volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None,
+ vpc: 'VPCIdentity' = None) -> None:
+ """
+ Initialize a InstancePrototype object.
- def __ne__(self, other: 'InstanceGroupManagerCollection') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, at least one key must be specified, and one will be
+ chosen to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str name: (optional) The unique user-defined name for this virtual
+ server instance (and default system hostname). If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional network interfaces to create for the virtual server instance.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ :param InstanceProfileIdentity profile: (optional) The profile to use for
+ this virtual server instance.
+ :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 to be made available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
+ (optional) The volume attachments for this virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC the virtual server instance is
+ to be a part of. If specified, it must match
+ the VPC referenced by the subnets of the instance's network interfaces.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceByVolume', 'InstancePrototypeInstanceBySourceTemplate']))
+ raise Exception(msg)
-class InstanceGroupManagerCollectionFirst():
+class InstanceReference():
"""
- A link to the first page of resources.
+ InstanceReference.
- :attr str href: The URL for a page of resources.
+ :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 user-defined name for this virtual server instance (and
+ default system hostname).
"""
def __init__(self,
- href: str) -> None:
+ 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 user-defined name for this virtual server instance
+ (and default system hostname).
+ :param InstanceReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ 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:
+ _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):
@@ -26485,56 +34642,56 @@ 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) -> None:
+ 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):
@@ -26542,106 +34699,76 @@ 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 user-defined name for this instance group
- manager. Names must be unique within 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) -> 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 user-defined name for this instance group
- manager. Names must be unique within 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):
@@ -26649,126 +34776,212 @@ 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 InstanceGroupManagerPolicy():
+ class CodeEnum(str, Enum):
+ """
+ A snake case string succinctly identifying the status reason.
+ """
+ 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_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 user-defined name for this instance group manager policy.
- Names must be unique within the instance group manager.
- :attr datetime updated_at: The date and time that the instance group manager
- policy was updated.
+ :attr datetime created_at: The date and time that the instance template was
+ created.
+ :attr str crn: The CRN for this instance template.
+ :attr str href: The URL for this instance template.
+ :attr str id: The unique identifier for this instance template.
+ :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, at least one key must be specified, and one will be chosen
+ to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :attr str name: The unique user-defined name for this instance template.
+ :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional network interfaces to create for the virtual server instance.
+ :attr InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ :attr InstanceProfileIdentity profile: (optional) The profile to use for this
+ virtual server instance.
+ :attr ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :attr str user_data: (optional) User data to be made available when setting up
+ the virtual server instance.
+ :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
+ (optional) The volume attachments for this virtual server instance.
+ :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a
+ part of. If specified, it must match
+ the VPC referenced by the subnets of the instance's network interfaces.
"""
def __init__(self,
created_at: datetime,
+ crn: str,
href: str,
id: str,
name: str,
- updated_at: datetime) -> None:
+ resource_group: 'ResourceGroupReference',
+ *,
+ keys: List['KeyIdentity'] = None,
+ network_interfaces: List['NetworkInterfacePrototype'] = None,
+ placement_target: 'InstancePlacementTargetPrototype' = None,
+ profile: 'InstanceProfileIdentity' = None,
+ total_volume_bandwidth: int = None,
+ user_data: str = None,
+ volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None,
+ vpc: 'VPCIdentity' = None) -> None:
"""
- Initialize a 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 user-defined name for this instance group manager
- policy. Names must be unique within 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 unique user-defined name for this instance template.
+ :param ResourceGroupReference resource_group: The resource group for this
+ instance template.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, at least one key must be specified, and one will be
+ chosen to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional network interfaces to create for the virtual server instance.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ :param InstanceProfileIdentity profile: (optional) The profile to use for
+ this virtual server instance.
+ :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
+ megabits per second) allocated exclusively to instance storage volumes. An
+ increase in this value will result in a corresponding decrease to
+ `total_network_bandwidth`.
+ :param str user_data: (optional) User data to be made available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
+ (optional) The volume attachments for this virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC the virtual server instance is
+ to be a part of. If specified, it must match
+ the VPC referenced by the subnets of the instance's network interfaces.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy']))
+ ", ".join(['InstanceTemplateInstanceByImage', 'InstanceTemplateInstanceByVolume']))
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) -> 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:
@@ -26780,14 +34993,14 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'policies') and self.policies is not None:
- policies_list = []
- for x in self.policies:
+ if hasattr(self, 'templates') and self.templates is not None:
+ templates_list = []
+ for x in self.templates:
if isinstance(x, dict):
- policies_list.append(x)
- else:
- policies_list.append(x.to_dict())
- _dict['policies'] = policies_list
+ templates_list.append(x)
+ else:
+ templates_list.append(x.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
@@ -26797,20 +35010,20 @@ 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.
@@ -26820,25 +35033,25 @@ class InstanceGroupManagerPolicyCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a InstanceGroupManagerPolicyCollectionFirst object.
+ Initialize a InstanceTemplateCollectionFirst 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."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionFirst':
+ """Initialize a InstanceTemplateCollectionFirst 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')
+ raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyCollectionFirst object from a json dictionary."""
+ """Initialize a InstanceTemplateCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -26853,20 +35066,20 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPolicyCollectionFirst object."""
+ """Return a `str` version of this InstanceTemplateCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPolicyCollectionFirst') -> 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: 'InstanceGroupManagerPolicyCollectionFirst') -> bool:
+ def __ne__(self, other: 'InstanceTemplateCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerPolicyCollectionNext():
+class InstanceTemplateCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -26877,25 +35090,25 @@ class InstanceGroupManagerPolicyCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a InstanceGroupManagerPolicyCollectionNext object.
+ Initialize a InstanceTemplateCollectionNext 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."""
+ def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionNext':
+ """Initialize a InstanceTemplateCollectionNext 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')
+ raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyCollectionNext object from a json dictionary."""
+ """Initialize a InstanceTemplateCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -26910,194 +35123,69 @@ def _to_dict(self):
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 user-defined name for this instance group manager
- policy. Names must be unique within the instance group manager.
- """
-
- def __init__(self,
- *,
- metric_type: str = None,
- metric_value: int = None,
- name: str = None) -> None:
- """
- Initialize a InstanceGroupManagerPolicyPatch 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 user-defined name for this instance group
- manager policy. Names must be unique within the instance group manager.
- """
- self.metric_type = metric_type
- self.metric_value = metric_value
- self.name = name
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyPatch':
- """Initialize a InstanceGroupManagerPolicyPatch 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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPolicyPatch object."""
+ """Return a `str` version of this InstanceTemplateCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerPolicyPatch') -> 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: 'InstanceGroupManagerPolicyPatch') -> bool:
+ def __ne__(self, other: 'InstanceTemplateCollectionNext') -> 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():
+class InstanceTemplateIdentity():
"""
- InstanceGroupManagerPolicyPrototype.
+ Identifies an instance template by a unique property.
- :attr str name: (optional) The user-defined name for this instance group manager
- policy. Names must be unique within the instance group manager.
"""
- def __init__(self,
- *,
- name: str = None) -> None:
+ def __init__(self) -> None:
"""
- Initialize a InstanceGroupManagerPolicyPrototype object.
+ Initialize a InstanceTemplateIdentity object.
- :param str name: (optional) The user-defined name for this instance group
- manager policy. Names must be unique within the instance group manager.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype']))
+ ", ".join(['InstanceTemplateIdentityById', 'InstanceTemplateIdentityByHref', 'InstanceTemplateIdentityByCRN']))
raise Exception(msg)
-class InstanceGroupManagerPolicyReference():
+class InstanceTemplatePatch():
"""
- InstanceGroupManagerPolicyReference.
+ InstanceTemplatePatch.
- :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 user-defined name for this instance group manager policy.
- Names must be unique within the instance group manager.
+ :attr str name: (optional) The unique user-defined name for this instance
+ template.
"""
def __init__(self,
- href: str,
- id: str,
- name: str,
*,
- deleted: 'InstanceGroupManagerPolicyReferenceDeleted' = None) -> None:
+ name: str = None) -> None:
"""
- Initialize a InstanceGroupManagerPolicyReference object.
+ Initialize a InstanceTemplatePatch 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 user-defined name for this instance group manager
- policy. Names must be unique within 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 name: (optional) The unique user-defined name for this instance
+ template.
"""
- 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) -> 'InstanceTemplatePatch':
+ """Initialize a InstanceTemplatePatch 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceGroupManagerPolicyReference 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, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
return _dict
@@ -27107,166 +35195,194 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this InstanceGroupManagerPolicyReference object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'InstanceGroupManagerPolicyReference') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class InstanceGroupManagerPolicyReferenceDeleted():
- """
- 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 InstanceGroupManagerPolicyReferenceDeleted object.
-
- :param str more_info: Link to documentation about deleted resources.
- """
- self.more_info = more_info
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerPolicyReferenceDeleted':
- """Initialize a InstanceGroupManagerPolicyReferenceDeleted 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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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 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 user-defined name for this instance group
- manager. Names must be unique within the instance group.
+ :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made available
+ to the virtual server instance as cloud-init vendor data. For cloud-init enabled
+ images, these keys will also be added as SSH authorized keys for the
+ administrative user.
+ For Windows images, at least one key must be specified, and one will be chosen
+ to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
+ are optional for other images, but if no keys are specified, the instance will
+ be inaccessible unless the specified image provides another means of access.
+ This property's value is used when provisioning the virtual server instance, but
+ not subsequently managed. Accordingly, it is reflected as an [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :attr str name: (optional) The unique user-defined name for this virtual server
+ instance (and default system hostname). If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional network interfaces to create for the virtual server instance.
+ :attr InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ :attr InstanceProfileIdentity profile: (optional) The profile to use for this
+ virtual server instance.
+ :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 to be made available when setting up
+ the virtual server instance.
+ :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
+ (optional) The volume attachments for this virtual server instance.
+ :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a
+ part of. If specified, it must match
+ the VPC referenced by the subnets of the instance's network interfaces.
"""
def __init__(self,
*,
- management_enabled: bool = None,
- name: str = None) -> None:
+ keys: List['KeyIdentity'] = None,
+ name: str = None,
+ network_interfaces: List['NetworkInterfacePrototype'] = None,
+ placement_target: 'InstancePlacementTargetPrototype' = None,
+ profile: 'InstanceProfileIdentity' = None,
+ resource_group: 'ResourceGroupIdentity' = None,
+ total_volume_bandwidth: int = None,
+ user_data: str = None,
+ volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None,
+ vpc: 'VPCIdentity' = None) -> None:
"""
- Initialize a 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 user-defined name for this instance group
- manager. Names must be unique within the instance group.
+ :param List[KeyIdentity] keys: (optional) The public SSH keys for the
+ administrative user of the virtual server instance. Keys will be made
+ available to the virtual server instance as cloud-init vendor data. For
+ cloud-init enabled images, these keys will also be added as SSH authorized
+ keys for the administrative user.
+ For Windows images, at least one key must be specified, and one will be
+ chosen to encrypt [the administrator
+ password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
+ Keys are optional for other images, but if no keys are specified, the
+ instance will be inaccessible unless the specified image provides another
+ means of access.
+ This property's value is used when provisioning the virtual server
+ instance, but not subsequently managed. Accordingly, it is reflected as an
+ [instance
+ initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
+ property.
+ :param str name: (optional) The unique user-defined name for this virtual
+ server instance (and default system hostname). If unspecified, the name
+ will be a hyphenated list of randomly-selected words.
+ :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
+ additional network interfaces to create for the virtual server instance.
+ :param InstancePlacementTargetPrototype placement_target: (optional) The
+ placement restrictions to use for the virtual server instance.
+ :param InstanceProfileIdentity profile: (optional) The profile to use for
+ this virtual server instance.
+ :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 to be made available when
+ setting up the virtual server instance.
+ :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
+ (optional) The volume attachments for this virtual server instance.
+ :param VPCIdentity vpc: (optional) The VPC the virtual server instance is
+ to be a part of. If specified, it must match
+ the VPC referenced by the subnets of the instance's network interfaces.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype', 'InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype']))
+ ", ".join(['InstanceTemplatePrototypeInstanceByImage', 'InstanceTemplatePrototypeInstanceByVolume', 'InstanceTemplatePrototypeInstanceBySourceTemplate']))
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 user-defined name for this instance group manager. Names
- must be unique within 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 unique user-defined name for this instance template.
"""
def __init__(self,
+ crn: str,
href: str,
id: str,
name: str,
*,
- deleted: 'InstanceGroupManagerReferenceDeleted' = None) -> 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 user-defined name for this instance group manager.
- Names must be unique within 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 unique user-defined name for this instance template.
+ :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:
_dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
@@ -27282,20 +35398,20 @@ 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.
@@ -27306,25 +35422,25 @@ class InstanceGroupManagerReferenceDeleted():
def __init__(self,
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:
@@ -27339,115 +35455,65 @@ def _to_dict(self):
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 number of members the instance group should have
- at the scheduled time.
- """
-
- def __init__(self,
- membership_count: int) -> None:
- """
- Initialize a InstanceGroupManagerScheduledActionGroup object.
-
- :param int membership_count: The number of members the instance group
- should have at the scheduled time.
- """
- self.membership_count = membership_count
-
- @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)
-
- 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 a `str` version of this InstanceTemplateReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceGroupManagerScheduledActionGroup') -> 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: 'InstanceGroupManagerScheduledActionGroup') -> bool:
+ def __ne__(self, other: 'InstanceTemplateReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceGroupManagerScheduledActionGroupPrototype():
+class InstanceVCPU():
"""
- InstanceGroupManagerScheduledActionGroupPrototype.
+ The virtual server instance VCPU configuration.
- :attr int membership_count: The number of members the instance group should have
- at the scheduled time.
+ :attr str architecture: The VCPU architecture.
+ :attr int count: The number of VCPUs assigned.
"""
def __init__(self,
- membership_count: int) -> None:
+ architecture: str,
+ count: int) -> None:
"""
- Initialize a InstanceGroupManagerScheduledActionGroupPrototype object.
+ Initialize a InstanceVCPU object.
- :param int membership_count: The number of members the instance group
- should have at the scheduled time.
+ :param str architecture: The VCPU architecture.
+ :param int count: The number of VCPUs assigned.
"""
- self.membership_count = membership_count
+ self.architecture = architecture
+ self.count = count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceGroupManagerScheduledActionGroupPrototype':
- """Initialize a InstanceGroupManagerScheduledActionGroupPrototype 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 InstanceGroupManagerScheduledActionGroupPrototype JSON')
+ 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')
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
return _dict
def _to_dict(self):
@@ -27455,167 +35521,128 @@ 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 user-defined name for this instance group membership. Names
- must be unique within 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 unique user-defined name for this key. 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) -> 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 user-defined name for this instance group membership.
- Names must be unique within 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 unique user-defined name for this key. 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:
@@ -27623,24 +35650,24 @@ 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:
- _dict['instance'] = self.instance.to_dict()
- if hasattr(self, 'instance_template') and self.instance_template is not None:
- _dict['instance_template'] = self.instance_template.to_dict()
+ if 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:
- _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)
+ if hasattr(self, 'public_key') and self.public_key is not None:
+ _dict['public_key'] = self.public_key
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -27648,105 +35675,92 @@ 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'
+ 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) -> 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(x) for x 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(x) for x 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:
@@ -27754,10 +35768,10 @@ def to_dict(self) -> Dict:
_dict = {}
if hasattr(self, 'first') and self.first is not None:
_dict['first'] = self.first.to_dict()
+ if hasattr(self, 'keys') and self.keys is not None:
+ _dict['keys'] = [x.to_dict() for x in self.keys]
if hasattr(self, 'limit') and self.limit is not None:
_dict['limit'] = self.limit
- if hasattr(self, 'memberships') and self.memberships is not None:
- _dict['memberships'] = [x.to_dict() for x in self.memberships]
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
if hasattr(self, 'total_count') and self.total_count is not None:
@@ -27769,20 +35783,20 @@ 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.
@@ -27792,25 +35806,25 @@ class InstanceGroupMembershipCollectionFirst():
def __init__(self,
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:
@@ -27825,20 +35839,20 @@ 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.
@@ -27849,25 +35863,25 @@ class InstanceGroupMembershipCollectionNext():
def __init__(self,
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:
@@ -27882,197 +35896,69 @@ 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 user-defined name for this instance group
- membership. Names must be unique within the instance group.
"""
- def __init__(self,
- *,
- name: str = None) -> None:
+ def __init__(self) -> None:
"""
- Initialize a InstanceGroupMembershipPatch object.
+ Initialize a KeyIdentity object.
- :param str name: (optional) The user-defined name for this instance group
- membership. Names must be unique within the instance group.
"""
- 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) Required if specifying a load balancer
- pool only. Used by the instance group when scaling up instances to supply the
- port for the load balancer pool member.
- :attr InstanceTemplateIdentity instance_template: (optional) Identifies an
- instance template by a unique property.
- :attr LoadBalancerIdentity load_balancer: (optional) The load balancer that the
- load balancer pool used by this group
- is in. Must be supplied when using a load balancer pool.
- :attr LoadBalancerPoolIdentity load_balancer_pool: (optional) When specified,
- the load balancer pool will be managed by this
- group. Instances created by this group will have a new load
- balancer pool member in that pool created. Must be used with
- `application_port`.
- :attr int membership_count: (optional) The number of instances in the instance
- group.
- :attr str name: (optional) The user-defined name for this instance group.
- :attr List[SubnetIdentity] subnets: (optional) The subnets to use when creating
- new instances.
+ :attr str name: (optional) The user-defined name for this key.
"""
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:
+ name: str = None) -> None:
"""
- Initialize a InstanceGroupPatch object.
+ Initialize a KeyPatch object.
- :param int application_port: (optional) Required if specifying a load
- balancer pool only. Used by the instance group when scaling up instances to
- supply the port for the load balancer pool member.
- :param InstanceTemplateIdentity instance_template: (optional) Identifies an
- instance template by a unique property.
- :param LoadBalancerIdentity load_balancer: (optional) The load balancer
- that the load balancer pool used by this group
- is in. Must be supplied when using a load balancer pool.
- :param LoadBalancerPoolIdentity load_balancer_pool: (optional) When
- specified, the load balancer pool will be managed by this
- group. Instances created by this group will have a new load
- balancer pool member in that pool created. Must be used with
- `application_port`.
- :param int membership_count: (optional) The number of instances in the
- instance group.
- :param str name: (optional) The user-defined name for this instance group.
- :param List[SubnetIdentity] subnets: (optional) The subnets to use when
- creating new instances.
+ :param str name: (optional) The user-defined name for this key.
"""
- 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."""
+ def from_dict(cls, _dict: Dict) -> 'KeyPatch':
+ """Initialize a KeyPatch 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')
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 x in self.subnets:
- if isinstance(x, dict):
- subnets_list.append(x)
- else:
- subnets_list.append(x.to_dict())
- _dict['subnets'] = subnets_list
return _dict
def _to_dict(self):
@@ -28080,83 +35966,94 @@ 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 user-defined name for this instance group.
+ :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 user-defined name for this key.
"""
def __init__(self,
crn: str,
+ fingerprint: str,
href: str,
id: str,
name: str,
*,
- deleted: 'InstanceGroupReferenceDeleted' = None) -> 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 user-defined name for this instance group.
- :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 user-defined name for this key.
+ :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:
@@ -28166,6 +36063,8 @@ def to_dict(self) -> Dict:
_dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
_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:
@@ -28179,20 +36078,20 @@ 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.
@@ -28203,25 +36102,25 @@ class InstanceGroupReferenceDeleted():
def __init__(self,
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:
@@ -28236,66 +36135,276 @@ 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 LoadBalancer():
"""
- InstanceInitialization.
+ LoadBalancer.
- :attr List[KeyReference] keys: The public SSH keys used at instance
- initialization.
- :attr InstanceInitializationPassword password: (optional)
+ :attr datetime created_at: The date and time that this load balancer was
+ created.
+ :attr str crn: The load balancer's CRN.
+ :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 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 unique user-defined name for this load balancer.
+ :attr str operating_status: The operating status of this load balancer.
+ :attr List[LoadBalancerPoolReference] pools: The pools of this load balancer.
+ :attr List[IP] private_ips: The private IP addresses assigned to this load
+ balancer.
+ :attr LoadBalancerProfileReference profile: The profile to use for this load
+ balancer.
+ :attr str provisioning_status: The provisioning status of this load balancer.
+ :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 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 part of.
"""
def __init__(self,
- keys: List['KeyReference'],
- *,
- password: 'InstanceInitializationPassword' = None) -> None:
+ created_at: datetime,
+ crn: str,
+ hostname: str,
+ href: str,
+ id: str,
+ is_public: bool,
+ listeners: List['LoadBalancerListenerReference'],
+ logging: 'LoadBalancerLogging',
+ name: str,
+ operating_status: str,
+ pools: List['LoadBalancerPoolReference'],
+ private_ips: List['IP'],
+ profile: 'LoadBalancerProfileReference',
+ provisioning_status: str,
+ public_ips: List['IP'],
+ resource_group: 'ResourceGroupReference',
+ route_mode: bool,
+ security_groups: List['SecurityGroupReference'],
+ security_groups_supported: bool,
+ subnets: List['SubnetReference']) -> None:
"""
- Initialize a InstanceInitialization object.
+ Initialize a LoadBalancer object.
- :param List[KeyReference] keys: The public SSH keys used at instance
- initialization.
- :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 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 unique user-defined name for this load balancer.
+ :param str operating_status: The operating status of this load balancer.
+ :param List[LoadBalancerPoolReference] pools: The pools of this load
+ balancer.
+ :param List[IP] private_ips: The private IP addresses assigned to this load
+ balancer.
+ :param LoadBalancerProfileReference profile: The profile to use for this
+ load balancer.
+ :param str provisioning_status: The provisioning status of this load
+ balancer.
+ :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 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
+ part of.
"""
- self.keys = keys
- self.password = password
+ self.created_at = created_at
+ self.crn = crn
+ self.hostname = hostname
+ self.href = href
+ self.id = id
+ 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.route_mode = route_mode
+ self.security_groups = security_groups
+ self.security_groups_supported = security_groups_supported
+ self.subnets = subnets
@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 'keys' in _dict:
- args['keys'] = [KeyReference.from_dict(x) for x 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 '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 '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(x) for x 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(x) for x in _dict.get('pools')]
+ else:
+ raise ValueError('Required property \'pools\' not present in LoadBalancer JSON')
+ if 'private_ips' in _dict:
+ args['private_ips'] = [IP.from_dict(x) for x in _dict.get('private_ips')]
+ 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(x) for x 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 '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(x) for x 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(x) for x in _dict.get('subnets')]
+ else:
+ raise ValueError('Required property \'subnets\' 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, 'keys') and self.keys is not None:
- _dict['keys'] = [x.to_dict() for x in self.keys]
- if hasattr(self, 'password') and self.password is not None:
- _dict['password'] = self.password.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, '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, 'is_public') and self.is_public is not None:
+ _dict['is_public'] = self.is_public
+ if hasattr(self, 'listeners') and self.listeners is not None:
+ _dict['listeners'] = [x.to_dict() for x in self.listeners]
+ if hasattr(self, 'logging') and self.logging is not None:
+ _dict['logging'] = self.logging.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'operating_status') and self.operating_status is not None:
+ _dict['operating_status'] = self.operating_status
+ if hasattr(self, 'pools') and self.pools is not None:
+ _dict['pools'] = [x.to_dict() for x in self.pools]
+ if hasattr(self, 'private_ips') and self.private_ips is not None:
+ _dict['private_ips'] = [x.to_dict() for x in self.private_ips]
+ if hasattr(self, 'profile') and self.profile is not None:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'provisioning_status') and self.provisioning_status is not None:
+ _dict['provisioning_status'] = self.provisioning_status
+ if hasattr(self, 'public_ips') and self.public_ips is not None:
+ _dict['public_ips'] = [x.to_dict() for x in self.public_ips]
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'route_mode') and self.route_mode is not None:
+ _dict['route_mode'] = self.route_mode
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ _dict['security_groups'] = [x.to_dict() for x in self.security_groups]
+ if hasattr(self, 'security_groups_supported') and self.security_groups_supported is not None:
+ _dict['security_groups_supported'] = self.security_groups_supported
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ _dict['subnets'] = [x.to_dict() for x in self.subnets]
return _dict
def _to_dict(self):
@@ -28303,177 +36412,121 @@ 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 InstanceInitializationPassword():
- """
- InstanceInitializationPassword.
-
- :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,
- encrypted_password: bytes,
- encryption_key: 'KeyIdentityByFingerprint') -> None:
+ class OperatingStatusEnum(str, Enum):
"""
- Initialize a InstanceInitializationPassword 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.
+ The operating status of this load balancer.
"""
- self.encrypted_password = encrypted_password
- self.encryption_key = encryption_key
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceInitializationPassword':
- """Initialize a InstanceInitializationPassword 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'))
- else:
- raise ValueError('Required property \'encryption_key\' not present in InstanceInitializationPassword JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, 'encrypted_password') and self.encrypted_password is not None:
- _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8')
- if hasattr(self, 'encryption_key') and self.encryption_key is not None:
- _dict['encryption_key'] = self.encryption_key.to_dict()
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ OFFLINE = 'offline'
+ ONLINE = 'online'
- def __str__(self) -> str:
- """Return a `str` version of this InstanceInitializationPassword object."""
- return json.dumps(self.to_dict(), indent=2)
- 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__
+ class ProvisioningStatusEnum(str, Enum):
+ """
+ The provisioning status of this load balancer.
+ """
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ MAINTENANCE_PENDING = 'maintenance_pending'
+ UPDATE_PENDING = 'update_pending'
- def __ne__(self, other: 'InstanceInitializationPassword') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class InstancePatch():
+class LoadBalancerCollection():
"""
- InstancePatch.
+ LoadBalancerCollection.
- :attr str name: (optional) The user-defined name for this virtual server
- instance (and default system hostname).
- :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`.
- :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 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,
+ first: 'LoadBalancerCollectionFirst',
+ limit: int,
+ load_balancers: List['LoadBalancer'],
+ total_count: int,
*,
- name: str = None,
- profile: 'InstancePatchProfile' = None,
- total_volume_bandwidth: int = None) -> None:
+ next: 'LoadBalancerCollectionNext' = None) -> None:
"""
- Initialize a InstancePatch object.
+ Initialize a LoadBalancerCollection object.
- :param str name: (optional) The user-defined name for this virtual server
- instance (and default system hostname).
- :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`.
- :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.name = name
- self.profile = profile
- self.total_volume_bandwidth = total_volume_bandwidth
+ :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.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) -> 'InstancePatch':
- """Initialize a InstancePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollection':
+ """Initialize a LoadBalancerCollection object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- 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 'first' in _dict:
+ args['first'] = LoadBalancerCollectionFirst.from_dict(_dict.get('first'))
+ else:
+ raise ValueError('Required property \'first\' not present in LoadBalancerCollection JSON')
+ if 'limit' in _dict:
+ args['limit'] = _dict.get('limit')
+ else:
+ raise ValueError('Required property \'limit\' not present in LoadBalancerCollection JSON')
+ if 'load_balancers' in _dict:
+ args['load_balancers'] = [LoadBalancer.from_dict(x) for x in _dict.get('load_balancers')]
+ 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 InstancePatch 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, '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, 'total_volume_bandwidth') and self.total_volume_bandwidth is not None:
- _dict['total_volume_bandwidth'] = self.total_volume_bandwidth
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'load_balancers') and self.load_balancers is not None:
+ _dict['load_balancers'] = [x.to_dict() for x in self.load_balancers]
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -28481,266 +36534,55 @@ 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 LoadBalancerCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstancePatch') -> 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: 'InstancePatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerCollection') -> 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`.
-
- """
-
- 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:
- """
- Initialize a InstancePlacementTarget object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstancePlacementTargetDedicatedHostGroupReference', 'InstancePlacementTargetDedicatedHostReference', 'InstancePlacementTargetPlacementGroupReference']))
- 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():
+class LoadBalancerCollectionFirst():
"""
- InstanceProfile.
+ A link to the first page of resources.
- :attr InstanceProfileBandwidth bandwidth:
- :attr List[InstanceProfileDisk] disks: Collection of the instance profile's
- disks.
- :attr str family: (optional) The product family this virtual server instance
- profile belongs to.
- :attr 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 InstanceProfileOSArchitecture os_architecture:
- :attr InstanceProfilePortSpeed port_speed:
- :attr InstanceProfileVolumeBandwidth total_volume_bandwidth:
- :attr InstanceProfileVCPUArchitecture vcpu_architecture:
- :attr InstanceProfileVCPU vcpu_count:
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- bandwidth: 'InstanceProfileBandwidth',
- disks: List['InstanceProfileDisk'],
- href: str,
- memory: 'InstanceProfileMemory',
- name: str,
- os_architecture: 'InstanceProfileOSArchitecture',
- port_speed: 'InstanceProfilePortSpeed',
- total_volume_bandwidth: 'InstanceProfileVolumeBandwidth',
- vcpu_architecture: 'InstanceProfileVCPUArchitecture',
- vcpu_count: 'InstanceProfileVCPU',
- *,
- family: str = None,
- gpu_count: 'InstanceProfileGPU' = None,
- gpu_manufacturer: 'InstanceProfileGPUManufacturer' = None,
- gpu_memory: 'InstanceProfileGPUMemory' = None,
- gpu_model: 'InstanceProfileGPUModel' = None) -> None:
+ href: str) -> None:
"""
- Initialize a InstanceProfile object.
+ Initialize a LoadBalancerCollectionFirst object.
- :param InstanceProfileBandwidth bandwidth:
- :param List[InstanceProfileDisk] disks: Collection of the instance
- profile's disks.
- :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 InstanceProfileOSArchitecture os_architecture:
- :param InstanceProfilePortSpeed port_speed:
- :param InstanceProfileVolumeBandwidth total_volume_bandwidth:
- :param InstanceProfileVCPUArchitecture vcpu_architecture:
- :param InstanceProfileVCPU vcpu_count:
- :param str family: (optional) The product family this virtual server
- instance profile belongs to.
- :param InstanceProfileGPU gpu_count: (optional)
- :param InstanceProfileGPUManufacturer gpu_manufacturer: (optional)
- :param InstanceProfileGPUMemory gpu_memory: (optional)
- :param InstanceProfileGPUModel gpu_model: (optional)
+ :param str href: The URL for a page of resources.
"""
- 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.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
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfile':
- """Initialize a InstanceProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionFirst':
+ """Initialize a LoadBalancerCollectionFirst 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(x) for x in _dict.get('disks')]
- else:
- raise ValueError('Required property \'disks\' not present in InstanceProfile JSON')
- if 'family' in _dict:
- args['family'] = _dict.get('family')
- 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 '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')
+ raise ValueError('Required property \'href\' not present in LoadBalancerCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfile 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, '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:
- _dict['disks'] = [x.to_dict() for x in self.disks]
- 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:
- _dict['gpu_manufacturer'] = self.gpu_manufacturer.to_dict()
- if hasattr(self, 'gpu_memory') and self.gpu_memory is not None:
- if isinstance(self.gpu_memory, dict):
- _dict['gpu_memory'] = self.gpu_memory
- else:
- _dict['gpu_memory'] = self.gpu_memory.to_dict()
- if hasattr(self, 'gpu_model') and self.gpu_model is not None:
- _dict['gpu_model'] = self.gpu_model.to_dict()
if 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, 'os_architecture') and self.os_architecture is not None:
- _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:
- _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()
return _dict
def _to_dict(self):
@@ -28748,72 +36590,56 @@ 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 LoadBalancerCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfile') -> 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: 'InstanceProfile') -> bool:
+ def __ne__(self, other: 'LoadBalancerCollectionFirst') -> 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 LoadBalancerCollectionNext():
"""
- InstanceProfileCollection.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr List[InstanceProfile] profiles: Collection of virtual server instance
- profiles.
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- profiles: List['InstanceProfile']) -> None:
+ href: str) -> None:
"""
- Initialize a InstanceProfileCollection object.
+ Initialize a LoadBalancerCollectionNext object.
- :param List[InstanceProfile] profiles: Collection of virtual server
- instance profiles.
+ :param str href: The URL for a page of resources.
"""
- self.profiles = profiles
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileCollection':
- """Initialize a InstanceProfileCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollectionNext':
+ """Initialize a LoadBalancerCollectionNext object from a json dictionary."""
args = {}
- if 'profiles' in _dict:
- args['profiles'] = [InstanceProfile.from_dict(x) for x in _dict.get('profiles')]
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'profiles\' not present in InstanceProfileCollection JSON')
+ raise ValueError('Required property \'href\' not present in LoadBalancerCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileCollection 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, 'profiles') and self.profiles is not None:
- _dict['profiles'] = [x.to_dict() for x in self.profiles]
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -28821,81 +36647,242 @@ 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 LoadBalancerCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileCollection') -> 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: 'InstanceProfileCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceProfileDisk():
+class LoadBalancerIdentity():
"""
- Disks provided by this profile.
+ Identifies a load balancer by a unique property.
- :attr InstanceProfileDiskQuantity quantity:
- :attr InstanceProfileDiskSize size:
- :attr InstanceProfileDiskSupportedInterfaces supported_interface_types:
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a LoadBalancerIdentity object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerIdentityById', 'LoadBalancerIdentityByCRN', 'LoadBalancerIdentityByHref']))
+ raise Exception(msg)
+
+class LoadBalancerListener():
+ """
+ LoadBalancerListener.
+
+ :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. It is applicable only to `https`
+ protocol.
+ :attr int connection_limit: (optional) The connection limit of the listener.
+ :attr datetime created_at: The date and time that this listener was created.
+ :attr LoadBalancerPoolReference default_pool: (optional) The default pool
+ associated with the listener.
+ :attr str href: The listener's canonical URL.
+ :attr LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If specified,
+ the target listener that requests are redirected to.
+ :attr str id: The unique identifier for this load balancer listener.
+ :attr List[LoadBalancerListenerPolicyReference] policies: (optional) The
+ 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. Load balancers in the `network`
+ family support `tcp`. Load balancers in the `application` family support `tcp`,
+ `http`, and `https`. Each listener in the load balancer must have a unique
+ `port` and `protocol` combination.
+ :attr str provisioning_status: The provisioning status of this listener.
"""
def __init__(self,
- quantity: 'InstanceProfileDiskQuantity',
- size: 'InstanceProfileDiskSize',
- supported_interface_types: 'InstanceProfileDiskSupportedInterfaces') -> None:
+ 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,
+ policies: List['LoadBalancerListenerPolicyReference'] = None) -> None:
"""
- Initialize a InstanceProfileDisk object.
+ Initialize a LoadBalancerListener object.
- :param InstanceProfileDiskQuantity quantity:
- :param InstanceProfileDiskSize size:
- :param InstanceProfileDiskSupportedInterfaces supported_interface_types:
+ :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. Load balancers in the `network`
+ family support `tcp`. Load balancers in the `application` family support
+ `tcp`, `http`, and `https`. Each listener in the load balancer must have a
+ unique `port` and `protocol` combination.
+ :param str provisioning_status: The provisioning status of this listener.
+ :param CertificateInstanceReference certificate_instance: (optional) The
+ certificate instance used for SSL termination. It is applicable only to
+ `https`
+ protocol.
+ :param int connection_limit: (optional) The connection limit of the
+ listener.
+ :param LoadBalancerPoolReference default_pool: (optional) The default pool
+ associated with the listener.
+ :param LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If
+ specified, the target listener that requests are redirected to.
+ :param List[LoadBalancerListenerPolicyReference] policies: (optional) The
+ policies for this listener.
"""
- self.quantity = quantity
- self.size = size
- self.supported_interface_types = supported_interface_types
+ 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.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) -> 'InstanceProfileDisk':
- """Initialize a InstanceProfileDisk object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListener':
+ """Initialize a LoadBalancerListener object from a json dictionary."""
args = {}
- if 'quantity' in _dict:
- args['quantity'] = _dict.get('quantity')
+ 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 'policies' in _dict:
+ args['policies'] = [LoadBalancerListenerPolicyReference.from_dict(x) for x in _dict.get('policies')]
+ if 'port' in _dict:
+ args['port'] = _dict.get('port')
else:
- raise ValueError('Required property \'quantity\' not present in InstanceProfileDisk JSON')
- if 'size' in _dict:
- args['size'] = _dict.get('size')
+ 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 \'size\' not present in InstanceProfileDisk JSON')
- if 'supported_interface_types' in _dict:
- args['supported_interface_types'] = InstanceProfileDiskSupportedInterfaces.from_dict(_dict.get('supported_interface_types'))
+ 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 \'supported_interface_types\' not present in InstanceProfileDisk JSON')
+ 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 InstanceProfileDisk 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, '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:
- _dict['supported_interface_types'] = self.supported_interface_types.to_dict()
+ if hasattr(self, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None:
+ _dict['accept_proxy_protocol'] = self.accept_proxy_protocol
+ if hasattr(self, 'certificate_instance') and self.certificate_instance is not None:
+ _dict['certificate_instance'] = self.certificate_instance.to_dict()
+ if hasattr(self, 'connection_limit') and self.connection_limit is not None:
+ _dict['connection_limit'] = self.connection_limit
+ if hasattr(self, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'default_pool') and self.default_pool is not None:
+ _dict['default_pool'] = self.default_pool.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'https_redirect') and self.https_redirect is not None:
+ _dict['https_redirect'] = self.https_redirect.to_dict()
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'policies') and self.policies is not None:
+ _dict['policies'] = [x.to_dict() for x in self.policies]
+ 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):
@@ -28903,115 +36890,79 @@ 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 LoadBalancerListener object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDisk') -> 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: 'InstanceProfileDisk') -> bool:
+ def __ne__(self, other: 'LoadBalancerListener') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceProfileDiskQuantity():
- """
- InstanceProfileDiskQuantity.
-
- """
-
- def __init__(self) -> None:
+ class ProtocolEnum(str, Enum):
"""
- Initialize a InstanceProfileDiskQuantity object.
-
+ The listener protocol. Load balancers in the `network` family support `tcp`. Load
+ balancers in the `application` family support `tcp`, `http`, and `https`. Each
+ listener in the load balancer must have a unique `port` and `protocol`
+ combination.
"""
- 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.
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
- """
- def __init__(self) -> None:
+ class ProvisioningStatusEnum(str, Enum):
"""
- Initialize a InstanceProfileDiskSize object.
-
+ The provisioning status of this listener.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileDiskSizeFixed', 'InstanceProfileDiskSizeRange', 'InstanceProfileDiskSizeEnum', 'InstanceProfileDiskSizeDependent']))
- raise Exception(msg)
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ MAINTENANCE_PENDING = 'maintenance_pending'
+ UPDATE_PENDING = 'update_pending'
-class InstanceProfileDiskSupportedInterfaces():
+
+class LoadBalancerListenerCollection():
"""
- InstanceProfileDiskSupportedInterfaces.
+ LoadBalancerListenerCollection.
- :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 List[LoadBalancerListener] listeners: Collection of listeners.
"""
def __init__(self,
- default: str,
- type: str,
- values: List[str]) -> None:
+ listeners: List['LoadBalancerListener']) -> None:
"""
- Initialize a InstanceProfileDiskSupportedInterfaces object.
+ Initialize a LoadBalancerListenerCollection 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 List[LoadBalancerListener] listeners: Collection of listeners.
"""
- self.default = default
- self.type = type
- self.values = values
+ self.listeners = listeners
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileDiskSupportedInterfaces':
- """Initialize a InstanceProfileDiskSupportedInterfaces object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerCollection':
+ """Initialize a LoadBalancerListenerCollection 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')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileDiskSupportedInterfaces JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ if 'listeners' in _dict:
+ args['listeners'] = [LoadBalancerListener.from_dict(x) for x in _dict.get('listeners')]
else:
- raise ValueError('Required property \'values\' not present in InstanceProfileDiskSupportedInterfaces JSON')
+ raise ValueError('Required property \'listeners\' not present in LoadBalancerListenerCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceProfileDiskSupportedInterfaces 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, '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, 'listeners') and self.listeners is not None:
+ _dict['listeners'] = [x.to_dict() for x in self.listeners]
return _dict
def _to_dict(self):
@@ -29019,113 +36970,74 @@ 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 LoadBalancerListenerCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileDiskSupportedInterfaces') -> 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: 'InstanceProfileDiskSupportedInterfaces') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerCollection') -> 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():
- """
- InstanceProfileGPU.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a InstanceProfileGPU object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileGPUFixed', 'InstanceProfileGPURange', 'InstanceProfileGPUEnum', 'InstanceProfileGPUDependent']))
- raise Exception(msg)
-
-class InstanceProfileGPUManufacturer():
+class LoadBalancerListenerHTTPSRedirect():
"""
- InstanceProfileGPUManufacturer.
+ LoadBalancerListenerHTTPSRedirect.
- :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 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,
- type: str,
- values: List[str]) -> None:
+ http_status_code: int,
+ listener: 'LoadBalancerListenerReference',
+ *,
+ uri: str = None) -> None:
"""
- Initialize a InstanceProfileGPUManufacturer object.
+ Initialize a LoadBalancerListenerHTTPSRedirect 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 int http_status_code: The HTTP status code for this redirect.
+ :param LoadBalancerListenerReference listener:
+ :param str uri: (optional) The redirect relative target URI.
"""
- 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) -> 'InstanceProfileGPUManufacturer':
- """Initialize a InstanceProfileGPUManufacturer object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirect':
+ """Initialize a LoadBalancerListenerHTTPSRedirect object from a json dictionary."""
args = {}
- 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 InstanceProfileGPUManufacturer JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
+ 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 \'values\' not present in InstanceProfileGPUManufacturer JSON')
+ 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 InstanceProfileGPUManufacturer 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, '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:
+ _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):
@@ -29133,89 +37045,76 @@ 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 LoadBalancerListenerHTTPSRedirect object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUManufacturer') -> 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: 'InstanceProfileGPUManufacturer') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirect') -> 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 InstanceProfileGPUMemory():
- """
- InstanceProfileGPUMemory.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a InstanceProfileGPUMemory object.
-
- """
- 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 LoadBalancerListenerHTTPSRedirectPatch():
"""
- InstanceProfileGPUModel.
+ LoadBalancerListenerHTTPSRedirectPatch.
- :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 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,
- type: str,
- values: List[str]) -> None:
+ *,
+ http_status_code: int = None,
+ listener: 'LoadBalancerListenerIdentity' = None,
+ uri: str = None) -> None:
"""
- Initialize a InstanceProfileGPUModel object.
+ Initialize a LoadBalancerListenerHTTPSRedirectPatch 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 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.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) -> 'InstanceProfileGPUModel':
- """Initialize a InstanceProfileGPUModel object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirectPatch':
+ """Initialize a LoadBalancerListenerHTTPSRedirectPatch object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
- else:
- raise ValueError('Required property \'type\' not present in InstanceProfileGPUModel JSON')
- if 'values' in _dict:
- args['values'] = _dict.get('values')
- else:
- raise ValueError('Required property \'values\' not present in InstanceProfileGPUModel 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 InstanceProfileGPUModel 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, '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):
@@ -29223,116 +37122,79 @@ 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 LoadBalancerListenerHTTPSRedirectPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileGPUModel') -> 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: 'InstanceProfileGPUModel') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirectPatch') -> 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:
- """
- Initialize a InstanceProfileIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileIdentityByName', 'InstanceProfileIdentityByHref']))
- raise Exception(msg)
-
-class InstanceProfileMemory():
- """
- InstanceProfileMemory.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a InstanceProfileMemory object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileMemoryFixed', 'InstanceProfileMemoryRange', 'InstanceProfileMemoryEnum', 'InstanceProfileMemoryDependent']))
- raise Exception(msg)
-
-class InstanceProfileOSArchitecture():
+class LoadBalancerListenerHTTPSRedirectPrototype():
"""
- InstanceProfileOSArchitecture.
+ LoadBalancerListenerHTTPSRedirectPrototype.
- :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 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]) -> None:
+ http_status_code: int,
+ listener: 'LoadBalancerListenerIdentity',
+ *,
+ uri: str = None) -> None:
"""
- Initialize a InstanceProfileOSArchitecture object.
+ Initialize a LoadBalancerListenerHTTPSRedirectPrototype 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 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) -> 'InstanceProfileOSArchitecture':
- """Initialize a InstanceProfileOSArchitecture 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 InstanceProfileOSArchitecture 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 InstanceProfileOSArchitecture 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 InstanceProfileOSArchitecture 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 InstanceProfileOSArchitecture 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):
@@ -29340,89 +37202,228 @@ 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 LoadBalancerListenerHTTPSRedirectPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileOSArchitecture') -> 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: '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'
-
+ def __ne__(self, other: 'LoadBalancerListenerHTTPSRedirectPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class InstanceProfilePortSpeed():
+class LoadBalancerListenerIdentity():
"""
- InstanceProfilePortSpeed.
+ Identifies a load balancer listener by a unique property.
"""
def __init__(self) -> None:
"""
- Initialize a InstanceProfilePortSpeed object.
+ Initialize a LoadBalancerListenerIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfilePortSpeedFixed', 'InstanceProfilePortSpeedDependent']))
+ ", ".join(['LoadBalancerListenerIdentityById', 'LoadBalancerListenerIdentityByHref']))
raise Exception(msg)
-class InstanceProfileReference():
+class LoadBalancerListenerPatch():
"""
- InstanceProfileReference.
+ LoadBalancerListenerPatch.
- :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 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 used for SSL termination. It is applicable only to `https`
+ protocol.
+ :attr int connection_limit: (optional) The connection limit of the listener.
+ :attr LoadBalancerPoolIdentity default_pool: (optional) The default pool
+ associated with the listener. The specified pool must:
+ - Belong to this load balancer
+ - Have the same `protocol` as this listener
+ - Not already be the default pool for another listener.
+ :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 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. Additional
+ restrictions:
+ - If this load balancer is in the `network` family, the protocol must be `tcp`.
+ - If this listener has `https_redirect` specified, the protocol must be `http`.
+ - If this listener is a listener's `https_redirect` target, the protocol must be
+ `https`.
"""
def __init__(self,
- href: str,
- name: str) -> None:
+ *,
+ accept_proxy_protocol: bool = None,
+ certificate_instance: 'CertificateInstanceIdentity' = None,
+ connection_limit: int = None,
+ default_pool: 'LoadBalancerPoolIdentity' = None,
+ https_redirect: 'LoadBalancerListenerHTTPSRedirectPatch' = None,
+ port: int = None,
+ port_max: int = None,
+ port_min: int = None,
+ protocol: str = None) -> None:
"""
- Initialize a InstanceProfileReference object.
+ Initialize a LoadBalancerListenerPatch 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 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 used for SSL termination. It is applicable only to
+ `https`
+ protocol.
+ :param int connection_limit: (optional) The connection limit of the
+ listener.
+ :param LoadBalancerPoolIdentity default_pool: (optional) The default pool
+ associated with the listener. The specified pool must:
+ - Belong to this load balancer
+ - Have the same `protocol` as this listener
+ - Not already be the default pool for another listener.
+ :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 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.
+ Additional restrictions:
+ - If this load balancer is in the `network` family, the protocol must be
+ `tcp`.
+ - If this listener has `https_redirect` specified, the protocol must be
+ `http`.
+ - If this listener is a listener's `https_redirect` target, the protocol
+ must be `https`.
"""
- self.href = href
- 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.port = port
+ self.port_max = port_max
+ self.port_min = port_min
+ self.protocol = protocol
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceProfileReference':
- """Initialize a InstanceProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPatch':
+ """Initialize a LoadBalancerListenerPatch 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 '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 '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 InstanceProfileReference 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, '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, '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:
+ _dict['https_redirect'] = self.https_redirect.to_dict()
+ if hasattr(self, 'port') and self.port is not None:
+ _dict['port'] = self.port
+ if hasattr(self, 'port_max') and self.port_max is not None:
+ _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):
@@ -29430,91 +37431,173 @@ 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 LoadBalancerListenerPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileReference') -> 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: 'InstanceProfileReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceProfileVCPU():
- """
- InstanceProfileVCPU.
-
- """
-
- def __init__(self) -> None:
+ class ProtocolEnum(str, Enum):
"""
- Initialize a InstanceProfileVCPU object.
-
+ The listener protocol. Each listener in the load balancer must have a unique
+ `port` and `protocol` combination. Additional restrictions:
+ - If this load balancer is in the `network` family, the protocol must be `tcp`.
+ - If this listener has `https_redirect` specified, the protocol must be `http`.
+ - If this listener is a listener's `https_redirect` target, the protocol must be
+ `https`.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceProfileVCPUFixed', 'InstanceProfileVCPURange', 'InstanceProfileVCPUEnum', 'InstanceProfileVCPUDependent']))
- raise Exception(msg)
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
-class InstanceProfileVCPUArchitecture():
+
+class LoadBalancerListenerPolicy():
"""
- InstanceProfileVCPUArchitecture.
+ LoadBalancerListenerPolicy.
- :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 datetime created_at: The date and time that this policy was created.
+ :attr str href: The listener policy's canonical URL.
+ :attr str id: The policy's unique identifier.
+ :attr str name: The user-defined name for this policy.
+ :attr int priority: Priority of the policy. Lower value indicates higher
+ priority.
+ :attr str provisioning_status: The provisioning status of this policy.
+ :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,
- value: str,
+ action: str,
+ created_at: datetime,
+ href: str,
+ id: str,
+ name: str,
+ priority: int,
+ provisioning_status: str,
+ rules: List['LoadBalancerListenerPolicyRuleReference'],
*,
- default: str = None) -> None:
+ target: 'LoadBalancerListenerPolicyTarget' = None) -> None:
"""
- Initialize a InstanceProfileVCPUArchitecture object.
+ Initialize a LoadBalancerListenerPolicy 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 datetime created_at: The date and time that this policy was created.
+ :param str href: The listener policy's canonical URL.
+ :param str id: The policy's unique identifier.
+ :param str name: The user-defined name for this policy.
+ :param int priority: Priority of the policy. Lower value indicates higher
+ priority.
+ :param str provisioning_status: The provisioning status of this policy.
+ :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.default = default
- self.type = type
- self.value = value
+ 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) -> 'InstanceProfileVCPUArchitecture':
- """Initialize a InstanceProfileVCPUArchitecture object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicy':
+ """Initialize a LoadBalancerListenerPolicy 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 LoadBalancerListenerPolicy JSON')
+ if 'created_at' in _dict:
+ args['created_at'] = string_to_datetime(_dict.get('created_at'))
else:
- raise ValueError('Required property \'value\' not present in InstanceProfileVCPUArchitecture 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(x) for x 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 InstanceProfileVCPUArchitecture 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, '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, '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:
+ _dict['rules'] = [x.to_dict() for x in self.rules]
+ 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):
@@ -29522,225 +37605,81 @@ 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 LoadBalancerListenerPolicy object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceProfileVCPUArchitecture') -> 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: 'InstanceProfileVCPUArchitecture') -> 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):
+ 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'
-
-
-class InstanceProfileVolumeBandwidth():
- """
- InstanceProfileVolumeBandwidth.
-
- """
+ FORWARD = 'forward'
+ HTTPS_REDIRECT = 'https_redirect'
+ REDIRECT = 'redirect'
+ REJECT = 'reject'
- def __init__(self) -> None:
- """
- Initialize a InstanceProfileVolumeBandwidth object.
+ class ProvisioningStatusEnum(str, Enum):
"""
- 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 List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, at least one key must be specified, and one will be chosen
- to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr str name: (optional) The unique user-defined name for this virtual server
- instance (and default system hostname). If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional network interfaces to create for the virtual server instance.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The profile to use for this
- virtual server instance.
- :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 to be made available when setting up
- the virtual server instance.
- :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
- (optional) The volume attachments for this virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a
- part of. If specified, it must match
- the VPC referenced by the subnets of the instance's network interfaces.
- """
-
- def __init__(self,
- *,
- keys: List['KeyIdentity'] = None,
- name: str = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None,
- vpc: 'VPCIdentity' = None) -> None:
+ The provisioning status of this policy.
"""
- Initialize a InstancePrototype object.
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ MAINTENANCE_PENDING = 'maintenance_pending'
+ UPDATE_PENDING = 'update_pending'
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, at least one key must be specified, and one will be
- chosen to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param str name: (optional) The unique user-defined name for this virtual
- server instance (and default system hostname). If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional network interfaces to create for the virtual server instance.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The profile to use for
- this virtual server instance.
- :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 to be made available when
- setting up the virtual server instance.
- :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
- (optional) The volume attachments for this virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC the virtual server instance is
- to be a part of. If specified, it must match
- the VPC referenced by the subnets of the instance's network interfaces.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstancePrototypeInstanceByImage', 'InstancePrototypeInstanceByVolume', 'InstancePrototypeInstanceBySourceTemplate']))
- raise Exception(msg)
-class InstanceReference():
+class LoadBalancerListenerPolicyCollection():
"""
- InstanceReference.
+ LoadBalancerListenerPolicyCollection.
- :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 user-defined name for this virtual server instance (and
- default system hostname).
+ :attr List[LoadBalancerListenerPolicy] policies: Collection of policies.
"""
def __init__(self,
- crn: str,
- href: str,
- id: str,
- name: str,
- *,
- deleted: 'InstanceReferenceDeleted' = None) -> None:
+ policies: List['LoadBalancerListenerPolicy']) -> None:
"""
- Initialize a InstanceReference object.
+ Initialize a LoadBalancerListenerPolicyCollection 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 user-defined name for this virtual server instance
- (and default system hostname).
- :param InstanceReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted and provides
- some supplementary information.
+ :param List[LoadBalancerListenerPolicy] policies: Collection of policies.
"""
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
+ self.policies = policies
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceReference':
- """Initialize a InstanceReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyCollection':
+ """Initialize a LoadBalancerListenerPolicyCollection 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 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')
+ if 'policies' in _dict:
+ args['policies'] = [LoadBalancerListenerPolicy.from_dict(x) for x in _dict.get('policies')]
else:
- raise ValueError('Required property \'name\' not present in InstanceReference JSON')
+ raise ValueError('Required property \'policies\' not present in LoadBalancerListenerPolicyCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'policies') and self.policies is not None:
+ _dict['policies'] = [x.to_dict() for x in self.policies]
return _dict
def _to_dict(self):
@@ -29748,56 +37687,87 @@ 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 LoadBalancerListenerPolicyCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceReference') -> 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: 'InstanceReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceReferenceDeleted():
+class LoadBalancerListenerPolicyPatch():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ LoadBalancerListenerPolicyPatch.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr str name: (optional) The user-defined name for this policy. Names must be
+ unique within the load balancer listener the policy resides in.
+ :attr 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,
- more_info: str) -> None:
+ *,
+ name: str = None,
+ priority: int = None,
+ target: 'LoadBalancerListenerPolicyTargetPatch' = None) -> None:
"""
- Initialize a InstanceReferenceDeleted object.
+ Initialize a LoadBalancerListenerPolicyPatch object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str name: (optional) The user-defined name for this policy. Names
+ must be unique within the load balancer listener the policy resides in.
+ :param 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.more_info = more_info
+ self.name = name
+ self.priority = priority
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceReferenceDeleted':
- """Initialize a InstanceReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPatch':
+ """Initialize a LoadBalancerListenerPolicyPatch 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 InstanceReferenceDeleted 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceReferenceDeleted 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, '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
+ 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):
@@ -29805,76 +37775,117 @@ 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 LoadBalancerListenerPolicyPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceReferenceDeleted') -> 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: 'InstanceReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceStatusReason():
+class LoadBalancerListenerPolicyPrototype():
"""
- InstanceStatusReason.
+ LoadBalancerListenerPolicyPrototype.
- :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 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 user-defined name for this policy. Names must be
+ unique within the load balancer listener the policy resides in.
+ :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,
- code: str,
- message: str,
+ action: str,
+ priority: int,
*,
- more_info: str = None) -> None:
+ name: str = None,
+ rules: List['LoadBalancerListenerPolicyRulePrototype'] = None,
+ target: 'LoadBalancerListenerPolicyTargetPrototype' = None) -> None:
"""
- Initialize a InstanceStatusReason object.
+ Initialize a LoadBalancerListenerPolicyPrototype 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 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 user-defined name for this policy. Names
+ must be unique within the load balancer listener the policy resides in.
+ :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.code = code
- self.message = message
- self.more_info = more_info
+ self.action = action
+ self.name = name
+ self.priority = priority
+ self.rules = rules
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceStatusReason':
- """Initialize a InstanceStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPrototype':
+ """Initialize a LoadBalancerListenerPolicyPrototype object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
+ if 'action' in _dict:
+ args['action'] = _dict.get('action')
else:
- raise ValueError('Required property \'code\' not present in InstanceStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ 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 \'message\' not present in InstanceStatusReason JSON')
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ raise ValueError('Required property \'priority\' not present in LoadBalancerListenerPolicyPrototype JSON')
+ if 'rules' in _dict:
+ args['rules'] = [LoadBalancerListenerPolicyRulePrototype.from_dict(x) for x in _dict.get('rules')]
+ if 'target' in _dict:
+ args['target'] = _dict.get('target')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceStatusReason 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, '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, '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:
+ _dict['rules'] = [x.to_dict() for x in self.rules]
+ 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):
@@ -29882,232 +37893,150 @@ 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 LoadBalancerListenerPolicyPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceStatusReason') -> 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: 'InstanceStatusReason') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class CodeEnum(str, Enum):
+ class ActionEnum(str, Enum):
"""
- A snake case string succinctly identifying the status reason.
+ 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.
"""
- 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_STORAGE = 'cannot_start_storage'
- ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
- STOPPED_FOR_IMAGE_CREATION = 'stopped_for_image_creation'
+ FORWARD = 'forward'
+ HTTPS_REDIRECT = 'https_redirect'
+ REDIRECT = 'redirect'
+ REJECT = 'reject'
-class InstanceTemplate():
+class LoadBalancerListenerPolicyReference():
"""
- InstanceTemplate.
+ LoadBalancerListenerPolicyReference.
- :attr datetime created_at: The date and time that the instance template was
- created.
- :attr str crn: The CRN for this instance template.
- :attr str href: The URL for this instance template.
- :attr str id: The unique identifier for this instance template.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, at least one key must be specified, and one will be chosen
- to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr str name: The unique user-defined name for this instance template.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional network interfaces to create for the virtual server instance.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The profile to use for this
- virtual server instance.
- :attr ResourceGroupReference resource_group: The resource group for this
- instance template.
- :attr int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :attr str user_data: (optional) User data to be made available when setting up
- the virtual server instance.
- :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
- (optional) The volume attachments for this virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a
- part of. If specified, it must match
- the VPC referenced by the subnets of the instance's network interfaces.
+ :attr 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.
"""
def __init__(self,
- created_at: datetime,
- crn: str,
href: str,
id: str,
- name: str,
- resource_group: 'ResourceGroupReference',
*,
- keys: List['KeyIdentity'] = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None,
- vpc: 'VPCIdentity' = None) -> None:
+ deleted: 'LoadBalancerListenerPolicyReferenceDeleted' = None) -> None:
"""
- Initialize a InstanceTemplate object.
+ Initialize a LoadBalancerListenerPolicyReference object.
- :param datetime created_at: The date and time that the instance template
- was created.
- :param str crn: The CRN for this instance template.
- :param str href: The URL for this instance template.
- :param str id: The unique identifier for this instance template.
- :param str name: The unique user-defined name for this instance template.
- :param ResourceGroupReference resource_group: The resource group for this
- instance template.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, at least one key must be specified, and one will be
- chosen to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional network interfaces to create for the virtual server instance.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The profile to use for
- this virtual server instance.
- :param int total_volume_bandwidth: (optional) The amount of bandwidth (in
- megabits per second) allocated exclusively to instance storage volumes. An
- increase in this value will result in a corresponding decrease to
- `total_network_bandwidth`.
- :param str user_data: (optional) User data to be made available when
- setting up the virtual server instance.
- :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
- (optional) The volume attachments for this virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC the virtual server instance is
- to be a part of. If specified, it must match
- the VPC referenced by the subnets of the instance's network interfaces.
+ :param str href: The listener policy's canonical URL.
+ :param str id: The policy's unique identifier.
+ :param LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted
+ and provides
+ some supplementary information.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceTemplateInstanceByImage', 'InstanceTemplateInstanceByVolume']))
- raise Exception(msg)
+ self.deleted = deleted
+ self.href = href
+ self.id = id
-class InstanceTemplateCollection():
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReference':
+ """Initialize a LoadBalancerListenerPolicyReference 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')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerPolicyReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'LoadBalancerListenerPolicyReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class LoadBalancerListenerPolicyReferenceDeleted():
"""
- InstanceTemplateCollection.
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :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 more_info: Link to documentation about deleted resources.
"""
def __init__(self,
- first: 'InstanceTemplateCollectionFirst',
- limit: int,
- templates: List['InstanceTemplate'],
- total_count: int,
- *,
- next: 'InstanceTemplateCollectionNext' = None) -> None:
+ more_info: str) -> None:
"""
- Initialize a InstanceTemplateCollection object.
+ Initialize a LoadBalancerListenerPolicyReferenceDeleted 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 more_info: Link to documentation about deleted resources.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.templates = templates
- self.total_count = total_count
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollection':
- """Initialize a InstanceTemplateCollection 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')
- 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')
- else:
- raise ValueError('Required property \'templates\' not present in InstanceTemplateCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ 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 \'total_count\' not present in InstanceTemplateCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateCollection object from a json dictionary."""
+ """Initialize a LoadBalancerListenerPolicyReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'templates') and self.templates is not None:
- templates_list = []
- for x in self.templates:
- if isinstance(x, dict):
- templates_list.append(x)
- else:
- templates_list.append(x.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, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -30115,55 +38044,144 @@ 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 LoadBalancerListenerPolicyReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateCollection') -> bool:
+ 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__
- def __ne__(self, other: 'InstanceTemplateCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceTemplateCollectionFirst():
+class LoadBalancerListenerPolicyRule():
"""
- A link to the first page of resources.
+ LoadBalancerListenerPolicyRule.
- :attr str href: The URL for a page of resources.
+ :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.
+ :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,
- href: str) -> None:
+ condition: str,
+ created_at: datetime,
+ href: str,
+ id: str,
+ provisioning_status: str,
+ type: str,
+ value: str,
+ *,
+ field: str = None) -> None:
"""
- Initialize a InstanceTemplateCollectionFirst object.
+ Initialize a LoadBalancerListenerPolicyRule object.
- :param str href: The URL for a page of resources.
+ :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.
+ :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.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) -> 'InstanceTemplateCollectionFirst':
- """Initialize a InstanceTemplateCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRule':
+ """Initialize a LoadBalancerListenerPolicyRule 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 InstanceTemplateCollectionFirst 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 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')
+ 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 InstanceTemplateCollectionFirst 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, '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:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -30171,56 +38189,89 @@ 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 LoadBalancerListenerPolicyRule object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateCollectionFirst') -> 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: 'InstanceTemplateCollectionFirst') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRule') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceTemplateCollectionNext():
+ 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.
+ """
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ MAINTENANCE_PENDING = 'maintenance_pending'
+ 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():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ LoadBalancerListenerPolicyRuleCollection.
- :attr str href: The URL for a page of resources.
+ :attr List[LoadBalancerListenerPolicyRule] rules: Collection of rules.
"""
def __init__(self,
- href: str) -> None:
+ rules: List['LoadBalancerListenerPolicyRule']) -> None:
"""
- Initialize a InstanceTemplateCollectionNext object.
+ Initialize a LoadBalancerListenerPolicyRuleCollection object.
- :param str href: The URL for a page of resources.
+ :param List[LoadBalancerListenerPolicyRule] rules: Collection of rules.
"""
- self.href = href
+ self.rules = rules
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplateCollectionNext':
- """Initialize a InstanceTemplateCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleCollection':
+ """Initialize a LoadBalancerListenerPolicyRuleCollection object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if 'rules' in _dict:
+ args['rules'] = [LoadBalancerListenerPolicyRule.from_dict(x) for x in _dict.get('rules')]
else:
- raise ValueError('Required property \'href\' not present in InstanceTemplateCollectionNext JSON')
+ raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicyRuleCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateCollectionNext 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'rules') and self.rules is not None:
+ _dict['rules'] = [x.to_dict() for x in self.rules]
return _dict
def _to_dict(self):
@@ -30228,71 +38279,98 @@ 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 LoadBalancerListenerPolicyRuleCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateCollectionNext') -> 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: 'InstanceTemplateCollectionNext') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRuleCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceTemplateIdentity():
- """
- Identifies an instance template by a unique property.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a InstanceTemplateIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceTemplateIdentityById', 'InstanceTemplateIdentityByHref', 'InstanceTemplateIdentityByCRN']))
- raise Exception(msg)
-
-class InstanceTemplatePatch():
+class LoadBalancerListenerPolicyRulePatch():
"""
- InstanceTemplatePatch.
+ LoadBalancerListenerPolicyRulePatch.
- :attr str name: (optional) The unique user-defined name for this instance
- template.
+ :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,
*,
- name: str = None) -> None:
+ condition: str = None,
+ field: str = None,
+ type: str = None,
+ value: str = None) -> None:
"""
- Initialize a InstanceTemplatePatch object.
+ Initialize a LoadBalancerListenerPolicyRulePatch object.
- :param str name: (optional) The unique user-defined name for this instance
- template.
+ :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.name = name
+ self.condition = condition
+ self.field = field
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceTemplatePatch':
- """Initialize a InstanceTemplatePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePatch':
+ """Initialize a LoadBalancerListenerPolicyRulePatch object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ 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 InstanceTemplatePatch 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, 'name') and self.name is not None:
- _dict['name'] = self.name
+ 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):
@@ -30300,202 +38378,229 @@ 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 LoadBalancerListenerPolicyRulePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplatePatch') -> 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: 'InstanceTemplatePatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRulePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceTemplatePrototype():
+ 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():
"""
- InstanceTemplatePrototype.
+ LoadBalancerListenerPolicyRulePrototype.
- :attr List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made available
- to the virtual server instance as cloud-init vendor data. For cloud-init enabled
- images, these keys will also be added as SSH authorized keys for the
- administrative user.
- For Windows images, at least one key must be specified, and one will be chosen
- to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization). Keys
- are optional for other images, but if no keys are specified, the instance will
- be inaccessible unless the specified image provides another means of access.
- This property's value is used when provisioning the virtual server instance, but
- not subsequently managed. Accordingly, it is reflected as an [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :attr str name: (optional) The unique user-defined name for this virtual server
- instance (and default system hostname). If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional network interfaces to create for the virtual server instance.
- :attr InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :attr InstanceProfileIdentity profile: (optional) The profile to use for this
- virtual server instance.
- :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 to be made available when setting up
- the virtual server instance.
- :attr List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
- (optional) The volume attachments for this virtual server instance.
- :attr VPCIdentity vpc: (optional) The VPC the virtual server instance is to be a
- part of. If specified, it must match
- the VPC referenced by the subnets of the instance's network interfaces.
+ :attr 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,
+ condition: str,
+ type: str,
+ value: str,
*,
- keys: List['KeyIdentity'] = None,
- name: str = None,
- network_interfaces: List['NetworkInterfacePrototype'] = None,
- placement_target: 'InstancePlacementTargetPrototype' = None,
- profile: 'InstanceProfileIdentity' = None,
- resource_group: 'ResourceGroupIdentity' = None,
- total_volume_bandwidth: int = None,
- user_data: str = None,
- volume_attachments: List['VolumeAttachmentPrototypeInstanceContext'] = None,
- vpc: 'VPCIdentity' = None) -> None:
+ field: str = None) -> None:
"""
- Initialize a InstanceTemplatePrototype object.
+ Initialize a LoadBalancerListenerPolicyRulePrototype object.
- :param List[KeyIdentity] keys: (optional) The public SSH keys for the
- administrative user of the virtual server instance. Keys will be made
- available to the virtual server instance as cloud-init vendor data. For
- cloud-init enabled images, these keys will also be added as SSH authorized
- keys for the administrative user.
- For Windows images, at least one key must be specified, and one will be
- chosen to encrypt [the administrator
- password](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization).
- Keys are optional for other images, but if no keys are specified, the
- instance will be inaccessible unless the specified image provides another
- means of access.
- This property's value is used when provisioning the virtual server
- instance, but not subsequently managed. Accordingly, it is reflected as an
- [instance
- initialization](https://cloud.ibm.com/apidocs/vpc#get-instance-initialization)
- property.
- :param str name: (optional) The unique user-defined name for this virtual
- server instance (and default system hostname). If unspecified, the name
- will be a hyphenated list of randomly-selected words.
- :param List[NetworkInterfacePrototype] network_interfaces: (optional) The
- additional network interfaces to create for the virtual server instance.
- :param InstancePlacementTargetPrototype placement_target: (optional) The
- placement restrictions to use for the virtual server instance.
- :param InstanceProfileIdentity profile: (optional) The profile to use for
- this virtual server instance.
- :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 to be made available when
- setting up the virtual server instance.
- :param List[VolumeAttachmentPrototypeInstanceContext] volume_attachments:
- (optional) The volume attachments for this virtual server instance.
- :param VPCIdentity vpc: (optional) The VPC the virtual server instance is
- to be a part of. If specified, it must match
- the VPC referenced by the subnets of the instance's network interfaces.
+ :param 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.condition = condition
+ self.field = field
+ self.type = type
+ self.value = value
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePrototype':
+ """Initialize a LoadBalancerListenerPolicyRulePrototype object from a json dictionary."""
+ args = {}
+ if 'condition' in _dict:
+ args['condition'] = _dict.get('condition')
+ 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')
+ else:
+ raise ValueError('Required property \'type\' not present in LoadBalancerListenerPolicyRulePrototype JSON')
+ if 'value' in _dict:
+ args['value'] = _dict.get('value')
+ else:
+ raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRulePrototype JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerPolicyRulePrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'LoadBalancerListenerPolicyRulePrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class ConditionEnum(str, Enum):
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['InstanceTemplatePrototypeInstanceByImage', 'InstanceTemplatePrototypeInstanceByVolume', 'InstanceTemplatePrototypeInstanceBySourceTemplate']))
- raise Exception(msg)
+ The condition of the rule.
+ """
+ CONTAINS = 'contains'
+ EQUALS = 'equals'
+ MATCHES_REGEX = 'matches_regex'
-class InstanceTemplateReference():
+
+ 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():
"""
- InstanceTemplateReference.
+ LoadBalancerListenerPolicyRuleReference.
- :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
+ :attr LoadBalancerListenerPolicyRuleReferenceDeleted 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 unique user-defined name for this instance template.
+ :attr str href: The rule's canonical URL.
+ :attr str id: The rule's unique identifier.
"""
def __init__(self,
- crn: str,
href: str,
id: str,
- name: str,
*,
- deleted: 'InstanceTemplateReferenceDeleted' = None) -> None:
+ deleted: 'LoadBalancerListenerPolicyRuleReferenceDeleted' = None) -> None:
"""
- Initialize a InstanceTemplateReference object.
+ Initialize a LoadBalancerListenerPolicyRuleReference 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 unique user-defined name for this instance template.
- :param InstanceTemplateReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted and
- provides
+ :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.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) -> 'LoadBalancerListenerPolicyRuleReference':
+ """Initialize a LoadBalancerListenerPolicyRuleReference 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'] = LoadBalancerListenerPolicyRuleReferenceDeleted.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 LoadBalancerListenerPolicyRuleReference 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 LoadBalancerListenerPolicyRuleReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
_dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -30503,20 +38608,20 @@ 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 LoadBalancerListenerPolicyRuleReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateReference') -> 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: 'InstanceTemplateReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceTemplateReferenceDeleted():
+class LoadBalancerListenerPolicyRuleReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -30527,25 +38632,25 @@ class InstanceTemplateReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a InstanceTemplateReferenceDeleted object.
+ Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted 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) -> 'LoadBalancerListenerPolicyRuleReferenceDeleted':
+ """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted 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 LoadBalancerListenerPolicyRuleReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceTemplateReferenceDeleted object from a json dictionary."""
+ """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -30560,65 +38665,221 @@ 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 LoadBalancerListenerPolicyRuleReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceTemplateReferenceDeleted') -> 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: 'InstanceTemplateReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class InstanceVCPU():
+class LoadBalancerListenerPolicyTarget():
"""
- The virtual server instance VCPU configuration.
+ - 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 architecture: The VCPU architecture.
- :attr int count: The number of VCPUs assigned.
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a LoadBalancerListenerPolicyTarget object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerListenerPolicyTargetLoadBalancerPoolReference', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect']))
+ raise Exception(msg)
+
+class LoadBalancerListenerPolicyTargetPatch():
+ """
+ - 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) -> 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 int connection_limit: (optional) The connection limit of the listener.
+ :attr LoadBalancerPoolIdentityByName default_pool: (optional) The default pool
+ associated with the listener.
+ :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. Load balancers in the `network`
+ family support `tcp`. Load balancers in the `application` family support `tcp`,
+ `http`, and `https`. Each listener in the load balancer must have a unique
+ `port` and `protocol` combination.
"""
def __init__(self,
- architecture: str,
- count: int) -> None:
+ protocol: str,
+ *,
+ accept_proxy_protocol: bool = None,
+ connection_limit: int = None,
+ default_pool: 'LoadBalancerPoolIdentityByName' = None,
+ port: int = None,
+ port_max: int = None,
+ port_min: int = None) -> None:
"""
- Initialize a InstanceVCPU object.
+ Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object.
- :param str architecture: The VCPU architecture.
- :param int count: The number of VCPUs assigned.
+ :param str protocol: The listener protocol. Load balancers in the `network`
+ family support `tcp`. Load balancers in the `application` family support
+ `tcp`, `http`, and `https`. Each listener in the load balancer must have a
+ unique `port` and `protocol` combination.
+ :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 int connection_limit: (optional) The connection limit of the
+ listener.
+ :param LoadBalancerPoolIdentityByName default_pool: (optional) The default
+ pool associated with the listener.
+ :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.architecture = architecture
- self.count = count
+ self.accept_proxy_protocol = accept_proxy_protocol
+ self.connection_limit = connection_limit
+ self.default_pool = default_pool
+ self.port = port
+ self.port_max = port_max
+ self.port_min = port_min
+ self.protocol = protocol
@classmethod
- def from_dict(cls, _dict: Dict) -> 'InstanceVCPU':
- """Initialize a InstanceVCPU object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPrototypeLoadBalancerContext':
+ """Initialize a LoadBalancerListenerPrototypeLoadBalancerContext 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')
+ if 'accept_proxy_protocol' in _dict:
+ args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol')
+ 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 '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 \'count\' not present in InstanceVCPU JSON')
+ raise ValueError('Required property \'protocol\' not present in LoadBalancerListenerPrototypeLoadBalancerContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a InstanceVCPU 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, '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, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None:
+ _dict['accept_proxy_protocol'] = self.accept_proxy_protocol
+ if hasattr(self, 'connection_limit') and self.connection_limit is not None:
+ _dict['connection_limit'] = self.connection_limit
+ if hasattr(self, 'default_pool') and self.default_pool is not None:
+ _dict['default_pool'] = self.default_pool.to_dict()
+ if hasattr(self, '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):
@@ -30626,153 +38887,205 @@ 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 LoadBalancerListenerPrototypeLoadBalancerContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'InstanceVCPU') -> 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: 'InstanceVCPU') -> bool:
+ def __ne__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class Key():
+ class ProtocolEnum(str, Enum):
+ """
+ The listener protocol. Load balancers in the `network` family support `tcp`. Load
+ balancers in the `application` family support `tcp`, `http`, and `https`. Each
+ listener in the load balancer must have a unique `port` and `protocol`
+ combination.
+ """
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
+
+
+class LoadBalancerListenerReference():
"""
- Key.
+ LoadBalancerListenerReference.
- :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 unique user-defined name for this key. 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 LoadBalancerListenerReferenceDeleted 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.
"""
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) -> None:
+ *,
+ deleted: 'LoadBalancerListenerReferenceDeleted' = None) -> None:
"""
- Initialize a Key object.
+ Initialize a LoadBalancerListenerReference 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 unique user-defined name for this key. 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 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.created_at = created_at
- self.crn = crn
- self.fingerprint = fingerprint
+ self.deleted = deleted
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
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Key':
- """Initialize a Key object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReference':
+ """Initialize a LoadBalancerListenerReference 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 'deleted' in _dict:
+ 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 Key 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 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')
+ raise ValueError('Required property \'id\' not present in LoadBalancerListenerReference JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this LoadBalancerListenerReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'LoadBalancerListenerReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class LoadBalancerListenerReferenceDeleted():
+ """
+ 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 LoadBalancerListenerReferenceDeleted 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."""
+ args = {}
+ if 'more_info' in _dict:
+ args['more_info'] = _dict.get('more_info')
else:
- raise ValueError('Required property \'type\' not present in Key JSON')
+ raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerReferenceDeleted JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerListenerReferenceDeleted object from 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 LoadBalancerListenerReferenceDeleted 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 __ne__(self, other: 'LoadBalancerListenerReferenceDeleted') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class LoadBalancerLogging():
+ """
+ The logging configuration for this load balancer.
+
+ :attr LoadBalancerLoggingDatapath datapath: (optional) The datapath logging
+ configuration for this load balancer.
+ """
+
+ def __init__(self,
+ *,
+ datapath: 'LoadBalancerLoggingDatapath' = None) -> None:
+ """
+ Initialize a LoadBalancerLogging object.
+
+ :param LoadBalancerLoggingDatapath datapath: (optional) The datapath
+ logging configuration for this load balancer.
+ """
+ self.datapath = datapath
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerLogging':
+ """Initialize a LoadBalancerLogging object from a json dictionary."""
+ args = {}
+ if 'datapath' in _dict:
+ args['datapath'] = LoadBalancerLoggingDatapath.from_dict(_dict.get('datapath'))
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Key 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, '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:
- _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, 'datapath') and self.datapath is not None:
+ _dict['datapath'] = self.datapath.to_dict()
return _dict
def _to_dict(self):
@@ -30780,107 +39093,57 @@ 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 LoadBalancerLogging object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Key') -> 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: 'Key') -> bool:
+ def __ne__(self, other: 'LoadBalancerLogging') -> 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.
- """
- RSA = 'rsa'
-
-
-class KeyCollection():
+class LoadBalancerLoggingDatapath():
"""
- 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: Indicates whether datapath logging is active for this load
+ balancer.
"""
def __init__(self,
- first: 'KeyCollectionFirst',
- keys: List['Key'],
- limit: int,
- total_count: int,
- *,
- next: 'KeyCollectionNext' = None) -> None:
+ active: bool) -> None:
"""
- Initialize a KeyCollection object.
+ Initialize a LoadBalancerLoggingDatapath 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: Indicates whether datapath logging is 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) -> 'LoadBalancerLoggingDatapath':
+ """Initialize a LoadBalancerLoggingDatapath 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(x) for x 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')
+ if 'active' in _dict:
+ args['active'] = _dict.get('active')
else:
- raise ValueError('Required property \'total_count\' not present in KeyCollection JSON')
+ raise ValueError('Required property \'active\' not present in LoadBalancerLoggingDatapath JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyCollection 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'keys') and self.keys is not None:
- _dict['keys'] = [x.to_dict() for x in self.keys]
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'active') and self.active is not None:
+ _dict['active'] = self.active
return _dict
def _to_dict(self):
@@ -30888,55 +39151,69 @@ 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 LoadBalancerLoggingDatapath object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyCollection') -> 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: 'KeyCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerLoggingDatapath') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class KeyCollectionFirst():
+class LoadBalancerPatch():
"""
- A link to the first page of resources.
+ LoadBalancerPatch.
- :attr str href: The URL for a page of resources.
+ :attr LoadBalancerLogging 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 unique user-defined name for this load balancer.
"""
def __init__(self,
- href: str) -> None:
+ *,
+ logging: 'LoadBalancerLogging' = None,
+ name: str = None) -> None:
"""
- Initialize a KeyCollectionFirst object.
+ Initialize a LoadBalancerPatch object.
- :param str href: The URL for a page of resources.
+ :param LoadBalancerLogging 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 unique user-defined name for this load
+ balancer.
"""
- self.href = href
+ self.logging = logging
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyCollectionFirst':
- """Initialize a KeyCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPatch':
+ """Initialize a LoadBalancerPatch 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 'logging' in _dict:
+ args['logging'] = LoadBalancerLogging.from_dict(_dict.get('logging'))
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyCollectionFirst 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'logging') and self.logging is not None:
+ _dict['logging'] = self.logging.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -30944,56 +39221,197 @@ 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 LoadBalancerPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyCollectionFirst') -> 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: 'KeyCollectionFirst') -> bool:
+ def __ne__(self, other: 'LoadBalancerPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class KeyCollectionNext():
+class LoadBalancerPool():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ LoadBalancerPool.
- :attr str href: The URL for a page of resources.
+ :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 user-defined name for this load balancer pool.
+ :attr str protocol: The protocol used for this load balancer pool.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool on which the unexpected
+ property value was encountered.
+ :attr str provisioning_status: The provisioning status of this pool.
+ :attr str proxy_protocol: The PROXY protocol setting for this pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `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,
- href: str) -> None:
+ algorithm: str,
+ created_at: datetime,
+ health_monitor: 'LoadBalancerPoolHealthMonitor',
+ href: str,
+ id: str,
+ name: str,
+ protocol: str,
+ provisioning_status: str,
+ proxy_protocol: str,
+ *,
+ instance_group: 'InstanceGroupReference' = None,
+ members: List['LoadBalancerPoolMemberReference'] = None,
+ session_persistence: 'LoadBalancerPoolSessionPersistence' = None) -> None:
"""
- Initialize a KeyCollectionNext object.
+ Initialize a LoadBalancerPool object.
- :param str href: The URL for a page of resources.
+ :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 user-defined name for this load balancer pool.
+ :param str protocol: The protocol used for this load balancer pool.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the pool on
+ which the unexpected property value was encountered.
+ :param str provisioning_status: The provisioning status of this pool.
+ :param str proxy_protocol: The PROXY protocol setting for this pool:
+ - `v1`: Enabled with version 1 (human-readable header format)
+ - `v2`: Enabled with version 2 (binary header format)
+ - `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.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) -> 'KeyCollectionNext':
- """Initialize a KeyCollectionNext object from a json dictionary."""
+ 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 KeyCollectionNext 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 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(x) for x 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)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyCollectionNext 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, '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:
+ _dict['health_monitor'] = self.health_monitor.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'instance_group') and self.instance_group is not None:
+ _dict['instance_group'] = self.instance_group.to_dict()
+ if hasattr(self, 'members') and self.members is not None:
+ _dict['members'] = [x.to_dict() for x in self.members]
+ 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:
+ _dict['session_persistence'] = self.session_persistence.to_dict()
return _dict
def _to_dict(self):
@@ -31001,69 +39419,103 @@ 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 LoadBalancerPool object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyCollectionNext') -> 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: 'KeyCollectionNext') -> bool:
+ def __ne__(self, other: 'LoadBalancerPool') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class KeyIdentity():
- """
- Identifies a key by a unique property.
+ class AlgorithmEnum(str, Enum):
+ """
+ The load balancing algorithm.
+ """
+ LEAST_CONNECTIONS = 'least_connections'
+ ROUND_ROBIN = 'round_robin'
+ WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
- """
- def __init__(self) -> None:
+ class ProtocolEnum(str, Enum):
"""
- Initialize a KeyIdentity object.
+ The protocol used for this load balancer pool.
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool on which the unexpected
+ property value was encountered.
+ """
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
+
+ class ProvisioningStatusEnum(str, Enum):
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['KeyIdentityById', 'KeyIdentityByCRN', 'KeyIdentityByHref', 'KeyIdentityByFingerprint']))
- raise Exception(msg)
+ The provisioning status of this pool.
+ """
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ MAINTENANCE_PENDING = 'maintenance_pending'
+ UPDATE_PENDING = 'update_pending'
-class KeyPatch():
+
+ 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():
"""
- KeyPatch.
+ LoadBalancerPoolCollection.
- :attr str name: (optional) The user-defined name for this key.
+ :attr List[LoadBalancerPool] pools: Collection of pools.
"""
def __init__(self,
- *,
- name: str = None) -> None:
+ pools: List['LoadBalancerPool']) -> None:
"""
- Initialize a KeyPatch object.
+ Initialize a LoadBalancerPoolCollection object.
- :param str name: (optional) The user-defined name for this key.
+ :param List[LoadBalancerPool] pools: Collection of pools.
"""
- self.name = name
+ self.pools = pools
@classmethod
- def from_dict(cls, _dict: Dict) -> 'KeyPatch':
- """Initialize a KeyPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolCollection':
+ """Initialize a LoadBalancerPoolCollection object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if 'pools' in _dict:
+ args['pools'] = [LoadBalancerPool.from_dict(x) for x in _dict.get('pools')]
+ else:
+ raise ValueError('Required property \'pools\' not present in LoadBalancerPoolCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a KeyPatch 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, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'pools') and self.pools is not None:
+ _dict['pools'] = [x.to_dict() for x in self.pools]
return _dict
def _to_dict(self):
@@ -31071,111 +39523,121 @@ 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 LoadBalancerPoolCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyPatch') -> 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: 'KeyPatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class KeyReference():
+class LoadBalancerPoolHealthMonitor():
"""
- KeyReference.
+ LoadBalancerPoolHealthMonitor.
- :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 user-defined name for this key.
+ :attr int delay: The health check interval in seconds. Interval must be greater
+ than timeout value.
+ :attr int max_retries: The health check max retries.
+ :attr int port: (optional) The health check port number. If specified, this
+ overrides the ports specified in the server member resources.
+ :attr int timeout: The health check timeout in seconds.
+ :attr str type: The protocol type of this load balancer pool health monitor.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the health monitor on which the
+ unexpected property value was encountered.
+ :attr str url_path: (optional) The health check URL path. Applicable only if the
+ health monitor `type` is `http` or
+ `https`. This value must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
def __init__(self,
- crn: str,
- fingerprint: str,
- href: str,
- id: str,
- name: str,
+ delay: int,
+ max_retries: int,
+ timeout: int,
+ type: str,
*,
- deleted: 'KeyReferenceDeleted' = None) -> None:
+ port: int = None,
+ url_path: str = None) -> None:
"""
- Initialize a KeyReference object.
+ Initialize a LoadBalancerPoolHealthMonitor 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 user-defined name for this key.
- :param KeyReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted and provides
- some supplementary information.
+ :param int delay: The health check interval in seconds. Interval must be
+ greater than timeout value.
+ :param int max_retries: The health check max retries.
+ :param int timeout: The health check timeout in seconds.
+ :param str type: The protocol type of this load balancer pool health
+ monitor.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the health
+ monitor on which the unexpected property value was encountered.
+ :param int port: (optional) The health check port number. If specified,
+ this overrides the ports specified in the server member resources.
+ :param str url_path: (optional) The health check URL path. Applicable only
+ if the health monitor `type` is `http` or
+ `https`. This value must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
- self.crn = crn
- self.deleted = deleted
- self.fingerprint = fingerprint
- self.href = href
- self.id = id
- 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) -> 'KeyReference':
- """Initialize a KeyReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitor':
+ """Initialize a LoadBalancerPoolHealthMonitor object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- 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')
+ if 'delay' in _dict:
+ args['delay'] = _dict.get('delay')
else:
- raise ValueError('Required property \'fingerprint\' not present in KeyReference JSON')
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ 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 \'href\' not present in KeyReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ 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 \'id\' not present in KeyReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitor JSON')
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
else:
- raise ValueError('Required property \'name\' not present in KeyReference JSON')
+ 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 KeyReference object from a json dictionary."""
+ """Initialize a LoadBalancerPoolHealthMonitor object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, '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, '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):
@@ -31183,56 +39645,128 @@ 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 LoadBalancerPoolHealthMonitor object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyReference') -> bool:
+ 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: 'KeyReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolHealthMonitor') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class KeyReferenceDeleted():
+ class TypeEnum(str, Enum):
+ """
+ The protocol type of this load balancer pool health monitor.
+ 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():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ LoadBalancerPoolHealthMonitorPatch.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr int delay: The health check interval in seconds. Interval must be greater
+ than timeout value.
+ :attr int max_retries: The health check max retries.
+ :attr int port: (optional) The health check port number. If specified, this
+ overrides the ports specified in the server member resources. Specify `null` to
+ remove an existing port value.
+ :attr int timeout: The health check timeout in seconds.
+ :attr str type: The protocol type of this load balancer pool health monitor.
+ :attr str url_path: (optional) The health check URL path. Applicable only if the
+ health monitor `type` is `http` or
+ `https`. This value must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
def __init__(self,
- more_info: str) -> None:
+ delay: int,
+ max_retries: int,
+ timeout: int,
+ type: str,
+ *,
+ port: int = None,
+ url_path: str = None) -> None:
"""
- Initialize a KeyReferenceDeleted object.
+ Initialize a LoadBalancerPoolHealthMonitorPatch object.
- :param str more_info: Link to documentation about deleted resources.
+ :param int delay: The health check interval in seconds. Interval must be
+ greater than timeout value.
+ :param int max_retries: The health check max retries.
+ :param int timeout: The health check timeout in seconds.
+ :param str type: The protocol type of this load balancer pool health
+ monitor.
+ :param int port: (optional) The health check port number. If specified,
+ this overrides the ports specified in the server member resources. Specify
+ `null` to remove an existing port value.
+ :param str url_path: (optional) The health check URL path. Applicable only
+ if the health monitor `type` is `http` or
+ `https`. This value must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
- self.more_info = more_info
+ 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) -> 'KeyReferenceDeleted':
- """Initialize a KeyReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPatch':
+ """Initialize a LoadBalancerPoolHealthMonitorPatch object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if 'delay' in _dict:
+ args['delay'] = _dict.get('delay')
else:
- raise ValueError('Required property \'more_info\' not present in KeyReferenceDeleted 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 KeyReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ 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):
@@ -31240,276 +39774,122 @@ 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 LoadBalancerPoolHealthMonitorPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'KeyReferenceDeleted') -> 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: 'KeyReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolHealthMonitorPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancer():
+ class TypeEnum(str, Enum):
+ """
+ The protocol type of this load balancer pool health monitor.
+ """
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
+
+
+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 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 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 unique user-defined name for this load balancer.
- :attr str operating_status: The operating status of this load balancer.
- :attr List[LoadBalancerPoolReference] pools: The pools of this load balancer.
- :attr List[IP] private_ips: The private IP addresses assigned to this load
- balancer.
- :attr LoadBalancerProfileReference profile: The profile to use for this load
- balancer.
- :attr str provisioning_status: The provisioning status of this load balancer.
- :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 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 part of.
+ :attr int delay: The health check interval in seconds. Interval must be greater
+ than timeout value.
+ :attr int max_retries: The health check max retries.
+ :attr int port: (optional) The health check port number. If specified, this
+ overrides the ports specified in the server member resources.
+ :attr int timeout: The health check timeout in seconds.
+ :attr str type: The protocol type of this load balancer pool health monitor.
+ :attr str url_path: (optional) The health check URL path. Applicable only if the
+ health monitor `type` is `http` or
+ `https`. This value must be in the format of an [origin-form request
+ 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,
- is_public: bool,
- listeners: List['LoadBalancerListenerReference'],
- logging: 'LoadBalancerLogging',
- name: str,
- operating_status: str,
- pools: List['LoadBalancerPoolReference'],
- private_ips: List['IP'],
- profile: 'LoadBalancerProfileReference',
- provisioning_status: str,
- public_ips: List['IP'],
- resource_group: 'ResourceGroupReference',
- route_mode: bool,
- security_groups: List['SecurityGroupReference'],
- security_groups_supported: bool,
- subnets: List['SubnetReference']) -> None:
+ delay: int,
+ max_retries: int,
+ timeout: int,
+ type: str,
+ *,
+ port: int = None,
+ url_path: str = None) -> None:
"""
- Initialize a LoadBalancer object.
+ Initialize a LoadBalancerPoolHealthMonitorPrototype 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 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 unique user-defined name for this load balancer.
- :param str operating_status: The operating status of this load balancer.
- :param List[LoadBalancerPoolReference] pools: The pools of this load
- balancer.
- :param List[IP] private_ips: The private IP addresses assigned to this load
- balancer.
- :param LoadBalancerProfileReference profile: The profile to use for this
- load balancer.
- :param str provisioning_status: The provisioning status of this load
- balancer.
- :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 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
- part of.
+ :param int delay: The health check interval in seconds. Interval must be
+ greater than timeout value.
+ :param int max_retries: The health check max retries.
+ :param int timeout: The health check timeout in seconds.
+ :param str type: The protocol type of this load balancer pool health
+ monitor.
+ :param int port: (optional) The health check port number. If specified,
+ this overrides the ports specified in the server member resources.
+ :param str url_path: (optional) The health check URL path. Applicable only
+ if the health monitor `type` is `http` or
+ `https`. This value must be in the format of an [origin-form request
+ target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
"""
- self.created_at = created_at
- self.crn = crn
- self.hostname = hostname
- self.href = href
- self.id = id
- 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.route_mode = route_mode
- self.security_groups = security_groups
- self.security_groups_supported = security_groups_supported
- self.subnets = subnets
+ 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) -> 'LoadBalancer':
- """Initialize a LoadBalancer object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPrototype':
+ """Initialize a LoadBalancerPoolHealthMonitorPrototype 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 '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 '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(x) for x 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(x) for x in _dict.get('pools')]
- else:
- raise ValueError('Required property \'pools\' not present in LoadBalancer JSON')
- if 'private_ips' in _dict:
- args['private_ips'] = [IP.from_dict(x) for x in _dict.get('private_ips')]
- 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(x) for x 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 'route_mode' in _dict:
- args['route_mode'] = _dict.get('route_mode')
+ if 'delay' in _dict:
+ args['delay'] = _dict.get('delay')
else:
- raise ValueError('Required property \'route_mode\' not present in LoadBalancer JSON')
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')]
+ 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 \'security_groups\' not present in LoadBalancer JSON')
- if 'security_groups_supported' in _dict:
- args['security_groups_supported'] = _dict.get('security_groups_supported')
+ 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 \'security_groups_supported\' not present in LoadBalancer JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
+ raise ValueError('Required property \'timeout\' not present in LoadBalancerPoolHealthMonitorPrototype JSON')
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
else:
- raise ValueError('Required property \'subnets\' not present in LoadBalancer JSON')
+ 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 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, '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, '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, 'is_public') and self.is_public is not None:
- _dict['is_public'] = self.is_public
- if hasattr(self, 'listeners') and self.listeners is not None:
- _dict['listeners'] = [x.to_dict() for x in self.listeners]
- if hasattr(self, 'logging') and self.logging is not None:
- _dict['logging'] = self.logging.to_dict()
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'operating_status') and self.operating_status is not None:
- _dict['operating_status'] = self.operating_status
- if hasattr(self, 'pools') and self.pools is not None:
- _dict['pools'] = [x.to_dict() for x in self.pools]
- if hasattr(self, 'private_ips') and self.private_ips is not None:
- _dict['private_ips'] = [x.to_dict() for x in self.private_ips]
- if hasattr(self, 'profile') and self.profile is not None:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'provisioning_status') and self.provisioning_status is not None:
- _dict['provisioning_status'] = self.provisioning_status
- if hasattr(self, 'public_ips') and self.public_ips is not None:
- _dict['public_ips'] = [x.to_dict() for x in self.public_ips]
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'route_mode') and self.route_mode is not None:
- _dict['route_mode'] = self.route_mode
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- _dict['security_groups'] = [x.to_dict() for x in self.security_groups]
- if hasattr(self, 'security_groups_supported') and self.security_groups_supported is not None:
- _dict['security_groups_supported'] = self.security_groups_supported
- if hasattr(self, 'subnets') and self.subnets is not None:
- _dict['subnets'] = [x.to_dict() for x in self.subnets]
+ @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):
@@ -31517,121 +39897,79 @@ 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 of this load balancer pool health monitor.
"""
- OFFLINE = 'offline'
- ONLINE = 'online'
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
- class ProvisioningStatusEnum(str, Enum):
- """
- The provisioning status of this load balancer.
+class LoadBalancerPoolIdentity():
+ """
+ Identifies a load balancer pool by a unique property.
+
+ """
+
+ def __init__(self) -> None:
"""
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- MAINTENANCE_PENDING = 'maintenance_pending'
- UPDATE_PENDING = 'update_pending'
+ Initialize a LoadBalancerPoolIdentity object.
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerPoolIdentityById', 'LoadBalancerPoolIdentityByHref']))
+ raise Exception(msg)
-class LoadBalancerCollection():
+class LoadBalancerPoolIdentityByName():
"""
- LoadBalancerCollection.
+ LoadBalancerPoolIdentityByName.
- :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 str name: The user-defined name for this load balancer pool.
"""
def __init__(self,
- first: 'LoadBalancerCollectionFirst',
- limit: int,
- load_balancers: List['LoadBalancer'],
- total_count: int,
- *,
- next: 'LoadBalancerCollectionNext' = None) -> None:
+ name: str) -> None:
"""
- Initialize a LoadBalancerCollection object.
+ Initialize a LoadBalancerPoolIdentityByName 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 str name: The user-defined name for this load balancer pool.
"""
- self.first = first
- self.limit = limit
- self.load_balancers = load_balancers
- self.next = next
- self.total_count = total_count
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerCollection':
- """Initialize a LoadBalancerCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolIdentityByName':
+ """Initialize a LoadBalancerPoolIdentityByName object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = LoadBalancerCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in LoadBalancerCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- raise ValueError('Required property \'limit\' not present in LoadBalancerCollection JSON')
- if 'load_balancers' in _dict:
- args['load_balancers'] = [LoadBalancer.from_dict(x) for x in _dict.get('load_balancers')]
- 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')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
else:
- raise ValueError('Required property \'total_count\' not present in LoadBalancerCollection JSON')
+ raise ValueError('Required property \'name\' not present in LoadBalancerPoolIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerCollection object from a json dictionary."""
+ """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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'load_balancers') and self.load_balancers is not None:
- _dict['load_balancers'] = [x.to_dict() for x in self.load_balancers]
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -31639,55 +39977,146 @@ 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 LoadBalancerPoolIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerCollection') -> bool:
+ 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: 'LoadBalancerCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerCollectionFirst():
+class LoadBalancerPoolMember():
"""
- A link to the first page of resources.
+ LoadBalancerPoolMember.
- :attr str href: The URL for a page of resources.
+ :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.
+ :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.
+ :attr int weight: (optional) Weight of the server member. Applicable only if the
+ pool algorithm is
+ `weighted_round_robin`.
"""
def __init__(self,
- href: str) -> None:
+ created_at: datetime,
+ health: str,
+ href: str,
+ id: str,
+ port: int,
+ provisioning_status: str,
+ target: 'LoadBalancerPoolMemberTarget',
+ *,
+ weight: int = None) -> None:
"""
- Initialize a LoadBalancerCollectionFirst object.
+ Initialize a LoadBalancerPoolMember object.
- :param str href: The URL for a page of resources.
+ :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.
+ :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.
+ :param int weight: (optional) Weight of the server member. Applicable only
+ if the pool algorithm is
+ `weighted_round_robin`.
"""
+ 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) -> 'LoadBalancerCollectionFirst':
- """Initialize a LoadBalancerCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMember':
+ """Initialize a LoadBalancerPoolMember 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 'href' in _dict:
args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in LoadBalancerPoolMember 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')
+ 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 LoadBalancerCollectionFirst 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, '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['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):
@@ -31695,56 +40124,76 @@ 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 LoadBalancerPoolMember object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerCollectionFirst') -> 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: 'LoadBalancerCollectionFirst') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMember') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerCollectionNext():
+ class HealthEnum(str, Enum):
+ """
+ Health of the server member in the pool.
+ """
+ FAULTED = 'faulted'
+ OK = 'ok'
+ UNKNOWN = 'unknown'
+
+
+ class ProvisioningStatusEnum(str, Enum):
+ """
+ The provisioning status of this member.
+ """
+ ACTIVE = 'active'
+ CREATE_PENDING = 'create_pending'
+ DELETE_PENDING = 'delete_pending'
+ FAILED = 'failed'
+ MAINTENANCE_PENDING = 'maintenance_pending'
+ UPDATE_PENDING = 'update_pending'
+
+
+class LoadBalancerPoolMemberCollection():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ LoadBalancerPoolMemberCollection.
- :attr str href: The URL for a page of resources.
+ :attr List[LoadBalancerPoolMember] members: Collection of members.
"""
def __init__(self,
- href: str) -> None:
+ members: List['LoadBalancerPoolMember']) -> None:
"""
- Initialize a LoadBalancerCollectionNext 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) -> 'LoadBalancerCollectionNext':
- """Initialize a LoadBalancerCollectionNext 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(x) for x in _dict.get('members')]
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerCollectionNext JSON')
+ raise ValueError('Required property \'members\' not present in LoadBalancerPoolMemberCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerCollectionNext 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:
+ _dict['members'] = [x.to_dict() for x in self.members]
return _dict
def _to_dict(self):
@@ -31752,244 +40201,97 @@ 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 LoadBalancerPoolMemberCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerCollectionNext') -> 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: 'LoadBalancerCollectionNext') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerIdentity():
- """
- Identifies a load balancer by a unique property.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a LoadBalancerIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerIdentityById', 'LoadBalancerIdentityByCRN', 'LoadBalancerIdentityByHref']))
- raise Exception(msg)
-
-class LoadBalancerListener():
+class LoadBalancerPoolMemberPatch():
"""
- LoadBalancerListener.
+ LoadBalancerPoolMemberPatch.
- :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. It is applicable only to `https`
- protocol.
- :attr int connection_limit: (optional) The connection limit of the listener.
- :attr datetime created_at: The date and time that this listener was created.
- :attr LoadBalancerPoolReference default_pool: (optional) The default pool
- associated with the listener.
- :attr str href: The listener's canonical URL.
- :attr LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If specified,
- the target listener that requests are redirected to.
- :attr str id: The unique identifier for this load balancer listener.
- :attr List[LoadBalancerListenerPolicyReference] policies: (optional) The
- policies for this listener.
- :attr int port: 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.
- :attr int port_max: The inclusive upper bound of the range of ports used by this
- listener.
- 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.
- Only load balancers in the `network` family support more than one port per
- listener.
- :attr str protocol: The listener protocol. Load balancers in the `network`
- family support `tcp`. Load balancers in the `application` family support `tcp`,
- `http`, and `https`. Each listener in the load balancer must have a unique
- `port` and `protocol` combination.
- :attr str provisioning_status: The provisioning status of this listener.
+ :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.
+ :attr int weight: (optional) Weight of the server member. Applicable only if the
+ pool algorithm is
+ `weighted_round_robin`.
"""
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,
- policies: List['LoadBalancerListenerPolicyReference'] = None) -> None:
+ port: int = None,
+ target: 'LoadBalancerPoolMemberTargetPrototype' = None,
+ weight: int = None) -> None:
"""
- Initialize a LoadBalancerListener object.
+ Initialize a LoadBalancerPoolMemberPatch 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. Each listener in the load balancer must have a unique
- `port` and `protocol` combination.
- :param int port_max: The inclusive upper bound of the range of ports used
- by this listener.
- 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.
- Only load balancers in the `network` family support more than one port per
- listener.
- :param str protocol: The listener protocol. Load balancers in the `network`
- family support `tcp`. Load balancers in the `application` family support
- `tcp`, `http`, and `https`. Each listener in the load balancer must have a
- unique `port` and `protocol` combination.
- :param str provisioning_status: The provisioning status of this listener.
- :param CertificateInstanceReference certificate_instance: (optional) The
- certificate instance used for SSL termination. It is applicable only to
- `https`
- protocol.
- :param int connection_limit: (optional) The connection limit of the
- listener.
- :param LoadBalancerPoolReference default_pool: (optional) The default pool
- associated with the listener.
- :param LoadBalancerListenerHTTPSRedirect https_redirect: (optional) If
- specified, the target listener that requests are redirected to.
- :param List[LoadBalancerListenerPolicyReference] policies: (optional) The
- policies for this listener.
+ :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.
+ :param int weight: (optional) Weight of the server member. Applicable only
+ if the pool algorithm is
+ `weighted_round_robin`.
"""
- 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.policies = policies
self.port = port
- self.port_max = port_max
- self.port_min = port_min
- self.protocol = protocol
- self.provisioning_status = provisioning_status
+ self.target = target
+ self.weight = weight
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListener':
- """Initialize a LoadBalancerListener object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPatch':
+ """Initialize a LoadBalancerPoolMemberPatch 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 'policies' in _dict:
- args['policies'] = [LoadBalancerListenerPolicyReference.from_dict(x) for x 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')
+ 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 LoadBalancerListener 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, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None:
- _dict['accept_proxy_protocol'] = self.accept_proxy_protocol
- if hasattr(self, 'certificate_instance') and self.certificate_instance is not None:
- _dict['certificate_instance'] = self.certificate_instance.to_dict()
- if hasattr(self, 'connection_limit') and self.connection_limit is not None:
- _dict['connection_limit'] = self.connection_limit
- if hasattr(self, 'created_at') and self.created_at is not None:
- _dict['created_at'] = datetime_to_string(self.created_at)
- if hasattr(self, 'default_pool') and self.default_pool is not None:
- _dict['default_pool'] = self.default_pool.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'https_redirect') and self.https_redirect is not None:
- _dict['https_redirect'] = self.https_redirect.to_dict()
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'policies') and self.policies is not None:
- _dict['policies'] = [x.to_dict() for x in self.policies]
+ _dict = {}
if hasattr(self, 'port') and self.port is not None:
_dict['port'] = self.port
- if hasattr(self, 'port_max') and self.port_max is not None:
- _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
+ 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):
@@ -31997,79 +40299,100 @@ 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 LoadBalancerPoolMemberPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListener') -> 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: 'LoadBalancerListener') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ProtocolEnum(str, Enum):
- """
- The listener protocol. Load balancers in the `network` family support `tcp`. Load
- balancers in the `application` family support `tcp`, `http`, and `https`. Each
- listener in the load balancer must have a unique `port` and `protocol`
- combination.
- """
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
-
-
- class ProvisioningStatusEnum(str, Enum):
- """
- The provisioning status of this listener.
- """
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- MAINTENANCE_PENDING = 'maintenance_pending'
- UPDATE_PENDING = 'update_pending'
-
-
-class LoadBalancerListenerCollection():
+class LoadBalancerPoolMemberPrototype():
"""
- LoadBalancerListenerCollection.
+ LoadBalancerPoolMemberPrototype.
- :attr List[LoadBalancerListener] listeners: Collection of listeners.
+ :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.
+ :attr int weight: (optional) Weight of the server member. Applicable only if the
+ pool algorithm is
+ `weighted_round_robin`.
"""
def __init__(self,
- listeners: List['LoadBalancerListener']) -> None:
+ port: int,
+ target: 'LoadBalancerPoolMemberTargetPrototype',
+ *,
+ weight: int = None) -> None:
"""
- Initialize a LoadBalancerListenerCollection object.
+ Initialize a LoadBalancerPoolMemberPrototype object.
- :param List[LoadBalancerListener] listeners: Collection of listeners.
+ :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.
+ :param int weight: (optional) Weight of the server member. Applicable only
+ if the pool algorithm is
+ `weighted_round_robin`.
"""
- self.listeners = listeners
+ self.port = port
+ self.target = target
+ self.weight = weight
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerCollection':
- """Initialize a LoadBalancerListenerCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPrototype':
+ """Initialize a LoadBalancerPoolMemberPrototype object from a json dictionary."""
args = {}
- if 'listeners' in _dict:
- args['listeners'] = [LoadBalancerListener.from_dict(x) for x in _dict.get('listeners')]
+ if 'port' in _dict:
+ args['port'] = _dict.get('port')
else:
- raise ValueError('Required property \'listeners\' not present in LoadBalancerListenerCollection JSON')
+ raise ValueError('Required property \'port\' not present in LoadBalancerPoolMemberPrototype JSON')
+ if 'target' in _dict:
+ args['target'] = _dict.get('target')
+ else:
+ 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 LoadBalancerListenerCollection 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, 'listeners') and self.listeners is not None:
- _dict['listeners'] = [x.to_dict() for x in self.listeners]
+ 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):
@@ -32077,74 +40400,79 @@ 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 LoadBalancerPoolMemberPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerCollection') -> 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: 'LoadBalancerListenerCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerHTTPSRedirect():
+class LoadBalancerPoolMemberReference():
"""
- LoadBalancerListenerHTTPSRedirect.
+ LoadBalancerPoolMemberReference.
- :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 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,
- http_status_code: int,
- listener: 'LoadBalancerListenerReference',
+ href: str,
+ id: str,
*,
- uri: str = None) -> None:
+ deleted: 'LoadBalancerPoolMemberReferenceDeleted' = None) -> None:
"""
- Initialize a LoadBalancerListenerHTTPSRedirect object.
+ Initialize a LoadBalancerPoolMemberReference 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 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.http_status_code = http_status_code
- self.listener = listener
- self.uri = uri
+ self.deleted = deleted
+ self.href = href
+ self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerHTTPSRedirect':
- """Initialize a LoadBalancerListenerHTTPSRedirect object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReference':
+ """Initialize a LoadBalancerPoolMemberReference 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'] = LoadBalancerPoolMemberReferenceDeleted.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 LoadBalancerPoolMemberReference 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 LoadBalancerPoolMemberReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerHTTPSRedirect 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, 'http_status_code') and self.http_status_code is not None:
- _dict['http_status_code'] = self.http_status_code
- if hasattr(self, 'listener') and self.listener is not None:
- _dict['listener'] = self.listener.to_dict()
- if hasattr(self, 'uri') and self.uri is not None:
- _dict['uri'] = self.uri
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -32152,76 +40480,56 @@ 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 LoadBalancerPoolMemberReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirect') -> 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: 'LoadBalancerListenerHTTPSRedirect') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerHTTPSRedirectPatch():
+class LoadBalancerPoolMemberReferenceDeleted():
"""
- 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) -> None:
+ more_info: str) -> None:
"""
- Initialize a LoadBalancerListenerHTTPSRedirectPatch object.
+ Initialize a LoadBalancerPoolMemberReferenceDeleted 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) -> 'LoadBalancerPoolMemberReferenceDeleted':
+ """Initialize a LoadBalancerPoolMemberReferenceDeleted 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 LoadBalancerPoolMemberReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerHTTPSRedirectPatch 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, '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):
@@ -32229,79 +40537,151 @@ 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 LoadBalancerPoolMemberReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirectPatch') -> 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: 'LoadBalancerListenerHTTPSRedirectPatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolMemberReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerHTTPSRedirectPrototype():
+class LoadBalancerPoolMemberTarget():
"""
- LoadBalancerListenerHTTPSRedirectPrototype.
+ The pool member target. Load balancers in the `network` family support virtual server
+ instances. Load balancers in the `application` family support IP addresses.
- :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) -> None:
+ """
+ Initialize a LoadBalancerPoolMemberTarget object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerPoolMemberTargetInstanceReference', 'LoadBalancerPoolMemberTargetIP']))
+ raise Exception(msg)
+
+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.
+
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a LoadBalancerPoolMemberTargetPrototype object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentity', 'LoadBalancerPoolMemberTargetPrototypeIP']))
+ raise Exception(msg)
+
+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 user-defined name for this load balancer pool.
+ :attr str protocol: (optional) The protocol used for this load balancer pool.
+ The enumerated values for this property are expected to expand in the future.
+ When processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool on which the unexpected
+ property value was encountered.
+ :attr str 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,
- http_status_code: int,
- listener: 'LoadBalancerListenerIdentity',
*,
- uri: str = None) -> None:
+ algorithm: str = None,
+ health_monitor: 'LoadBalancerPoolHealthMonitorPatch' = None,
+ name: str = None,
+ protocol: str = None,
+ proxy_protocol: str = None,
+ session_persistence: 'LoadBalancerPoolSessionPersistencePatch' = None) -> None:
"""
- Initialize a LoadBalancerListenerHTTPSRedirectPrototype object.
+ Initialize a LoadBalancerPoolPatch 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 algorithm: (optional) The load balancing algorithm.
+ :param LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The
+ health monitor of this pool.
+ :param str name: (optional) The user-defined name for this load balancer
+ pool.
+ :param str protocol: (optional) The protocol used for this load balancer
+ pool.
+ The enumerated values for this property are expected to expand in the
+ future. When processing this property, check for and log unknown values.
+ Optionally halt processing and surface the error, or bypass the pool on
+ which the unexpected property value was encountered.
+ :param str 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.http_status_code = http_status_code
- self.listener = listener
- self.uri = uri
+ 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) -> 'LoadBalancerListenerHTTPSRedirectPrototype':
- """Initialize a LoadBalancerListenerHTTPSRedirectPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPatch':
+ """Initialize a LoadBalancerPoolPatch 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')
- else:
- raise ValueError('Required property \'listener\' not present in LoadBalancerListenerHTTPSRedirectPrototype JSON')
- if 'uri' in _dict:
- args['uri'] = _dict.get('uri')
+ 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')
+ 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 LoadBalancerListenerHTTPSRedirectPrototype 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, '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, 'algorithm') and self.algorithm is not None:
+ _dict['algorithm'] = self.algorithm
+ if hasattr(self, 'health_monitor') and self.health_monitor is not None:
+ _dict['health_monitor'] = self.health_monitor.to_dict()
+ if 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:
+ _dict['session_persistence'] = self.session_persistence.to_dict()
return _dict
def _to_dict(self):
@@ -32309,219 +40689,174 @@ 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 LoadBalancerPoolPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerHTTPSRedirectPrototype') -> 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: 'LoadBalancerListenerHTTPSRedirectPrototype') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolPatch') -> 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.
+ class AlgorithmEnum(str, Enum):
+ """
+ The load balancing algorithm.
+ """
+ LEAST_CONNECTIONS = 'least_connections'
+ ROUND_ROBIN = 'round_robin'
+ WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
- """
- def __init__(self) -> None:
+ class ProtocolEnum(str, Enum):
"""
- Initialize a LoadBalancerListenerIdentity object.
+ The protocol used for this load balancer pool.
+ The enumerated values for this property are expected to expand in the future. When
+ processing this property, check for and log unknown values. Optionally halt
+ processing and surface the error, or bypass the pool on which the unexpected
+ property value was encountered.
+ """
+ HTTP = 'http'
+ HTTPS = 'https'
+ TCP = 'tcp'
+
+ class ProxyProtocolEnum(str, Enum):
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerListenerIdentityById', 'LoadBalancerListenerIdentityByHref']))
- raise Exception(msg)
+ 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 LoadBalancerListenerPatch():
+
+class LoadBalancerPoolPrototype():
"""
- LoadBalancerListenerPatch.
+ LoadBalancerPoolPrototype.
- :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 used for SSL termination. It is applicable only to `https`
- protocol.
- :attr int connection_limit: (optional) The connection limit of the listener.
- :attr LoadBalancerPoolIdentity default_pool: (optional) The default pool
- associated with the listener. The specified pool must:
- - Belong to this load balancer
- - Have the same `protocol` as this listener
- - Not already be the default pool for another listener.
- :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 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 support
- different values for `port_min` and `port_max`. When route mode is enabled,
- only a value of
- `65535` is supported for `port_max`.
- :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 support
- different values for `port_min` and `port_max`. When route mode is enabled,
- only a value of
- `1` is supported for `port_min`.
- :attr str protocol: (optional) The listener protocol. Each listener in the load
- balancer must have a unique `port` and `protocol` combination. Additional
- restrictions:
- - If this load balancer is in the `network` family, the protocol must be `tcp`.
- - If this listener has `https_redirect` specified, the protocol must be `http`.
- - If this listener is a listener's `https_redirect` target, the protocol must be
+ :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 user-defined name for this load balancer pool. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :attr str protocol: The protocol used for this load balancer pool. Load
+ balancers in the `network` family support `tcp`. Load balancers in the
+ `application` family support `tcp`, `http`, and
`https`.
+ :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,
+ algorithm: str,
+ health_monitor: 'LoadBalancerPoolHealthMonitorPrototype',
+ protocol: str,
*,
- accept_proxy_protocol: bool = None,
- certificate_instance: 'CertificateInstanceIdentity' = None,
- connection_limit: int = None,
- default_pool: 'LoadBalancerPoolIdentity' = None,
- https_redirect: 'LoadBalancerListenerHTTPSRedirectPatch' = None,
- port: int = None,
- port_max: int = None,
- port_min: int = None,
- protocol: str = None) -> None:
+ members: List['LoadBalancerPoolMemberPrototype'] = None,
+ name: str = None,
+ proxy_protocol: str = None,
+ session_persistence: 'LoadBalancerPoolSessionPersistencePrototype' = None) -> None:
"""
- Initialize a LoadBalancerListenerPatch object.
+ Initialize a LoadBalancerPoolPrototype 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 used for SSL termination. It is applicable only to
- `https`
- protocol.
- :param int connection_limit: (optional) The connection limit of the
- listener.
- :param LoadBalancerPoolIdentity default_pool: (optional) The default pool
- associated with the listener. The specified pool must:
- - Belong to this load balancer
- - Have the same `protocol` as this listener
- - Not already be the default pool for another listener.
- :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
+ :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`. Load balancers in the
+ `application` family support `tcp`, `http`, and
`https`.
- Specify `null` to remove any existing https redirect.
- :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 support
- different values for `port_min` and `port_max`. When route mode is
- enabled, only a value of
- `65535` is supported for `port_max`.
- :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 support
- different values for `port_min` and `port_max`. When route mode is
- enabled, only a value of
- `1` is supported for `port_min`.
- :param str protocol: (optional) The listener protocol. Each listener in the
- load balancer must have a unique `port` and `protocol` combination.
- Additional restrictions:
- - If this load balancer is in the `network` family, the protocol must be
- `tcp`.
- - If this listener has `https_redirect` specified, the protocol must be
- `http`.
- - If this listener is a listener's `https_redirect` target, the protocol
- must be `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 user-defined name for this load balancer
+ pool. 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.accept_proxy_protocol = accept_proxy_protocol
- self.certificate_instance = certificate_instance
- self.connection_limit = connection_limit
- self.default_pool = default_pool
- self.https_redirect = https_redirect
- self.port = port
- self.port_max = port_max
- self.port_min = port_min
+ 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) -> 'LoadBalancerListenerPatch':
- """Initialize a LoadBalancerListenerPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPrototype':
+ """Initialize a LoadBalancerPoolPrototype 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 '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 'algorithm' in _dict:
+ args['algorithm'] = _dict.get('algorithm')
+ 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'))
+ else:
+ raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPoolPrototype JSON')
+ if 'members' in _dict:
+ args['members'] = [LoadBalancerPoolMemberPrototype.from_dict(x) for x in _dict.get('members')]
+ 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 LoadBalancerListenerPatch 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, '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:
- _dict['https_redirect'] = self.https_redirect.to_dict()
- if hasattr(self, 'port') and self.port is not None:
- _dict['port'] = self.port
- if hasattr(self, 'port_max') and self.port_max is not None:
- _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, 'algorithm') and self.algorithm is not None:
+ _dict['algorithm'] = self.algorithm
+ if hasattr(self, 'health_monitor') and self.health_monitor is not None:
+ _dict['health_monitor'] = self.health_monitor.to_dict()
+ if hasattr(self, 'members') and self.members is not None:
+ _dict['members'] = [x.to_dict() for x in self.members]
+ 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:
+ _dict['session_persistence'] = self.session_persistence.to_dict()
return _dict
def _to_dict(self):
@@ -32529,26 +40864,33 @@ 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 LoadBalancerPoolPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPatch') -> 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: 'LoadBalancerListenerPatch') -> 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.
+ """
+ LEAST_CONNECTIONS = 'least_connections'
+ ROUND_ROBIN = 'round_robin'
+ WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
+
+
class ProtocolEnum(str, Enum):
"""
- The listener protocol. Each listener in the load balancer must have a unique
- `port` and `protocol` combination. Additional restrictions:
- - If this load balancer is in the `network` family, the protocol must be `tcp`.
- - If this listener has `https_redirect` specified, the protocol must be `http`.
- - If this listener is a listener's `https_redirect` target, the protocol must be
+ The protocol used for this load balancer pool. Load balancers in the `network`
+ family support `tcp`. Load balancers in the `application` family support `tcp`,
+ `http`, and
`https`.
"""
HTTP = 'http'
@@ -32556,146 +40898,90 @@ class ProtocolEnum(str, Enum):
TCP = 'tcp'
-class LoadBalancerListenerPolicy():
+ 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():
"""
- LoadBalancerListenerPolicy.
+ LoadBalancerPoolReference.
- :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 user-defined name for this policy.
- :attr int priority: Priority of the policy. Lower value indicates higher
- priority.
- :attr str provisioning_status: The provisioning status of this policy.
- :attr 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 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 user-defined name for this load balancer pool.
"""
def __init__(self,
- action: str,
- created_at: datetime,
href: str,
id: str,
name: str,
- priority: int,
- provisioning_status: str,
- rules: List['LoadBalancerListenerPolicyRuleReference'],
*,
- target: 'LoadBalancerListenerPolicyTarget' = None) -> None:
+ deleted: 'LoadBalancerPoolReferenceDeleted' = None) -> None:
"""
- Initialize a LoadBalancerListenerPolicy object.
+ Initialize a LoadBalancerPoolReference 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 user-defined name for this policy.
- :param int priority: Priority of the policy. Lower value indicates higher
- priority.
- :param str provisioning_status: The provisioning status of this policy.
- :param 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 href: The pool's canonical URL.
+ :param str id: The unique identifier for this load balancer pool.
+ :param str name: The user-defined name for this load balancer pool.
+ :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted and
+ provides
+ some supplementary information.
"""
- self.action = action
- self.created_at = created_at
+ self.deleted = deleted
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) -> 'LoadBalancerListenerPolicy':
- """Initialize a LoadBalancerListenerPolicy object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReference':
+ """Initialize a LoadBalancerPoolReference 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 '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 LoadBalancerListenerPolicy JSON')
+ 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 LoadBalancerListenerPolicy JSON')
+ 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 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(x) for x in _dict.get('rules')]
- else:
- raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicy JSON')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ raise ValueError('Required property \'name\' not present in LoadBalancerPoolReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicy 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, '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, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, '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:
- _dict['rules'] = [x.to_dict() for x in self.rules]
- 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):
@@ -32703,81 +40989,127 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerListenerPolicy object."""
+ """Return a `str` version of this LoadBalancerPoolReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicy') -> 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: 'LoadBalancerListenerPolicy') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolReference') -> 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 LoadBalancerPoolReferenceDeleted():
+ """
+ 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 ProvisioningStatusEnum(str, Enum):
+ def __init__(self,
+ more_info: str) -> None:
"""
- The provisioning status of this policy.
+ Initialize a LoadBalancerPoolReferenceDeleted object.
+
+ :param str more_info: Link to documentation about deleted resources.
"""
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- MAINTENANCE_PENDING = 'maintenance_pending'
- UPDATE_PENDING = 'update_pending'
+ self.more_info = more_info
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReferenceDeleted':
+ """Initialize a LoadBalancerPoolReferenceDeleted 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 LoadBalancerPoolReferenceDeleted JSON')
+ return cls(**args)
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary."""
+ return cls.from_dict(_dict)
-class LoadBalancerListenerPolicyCollection():
+ 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 LoadBalancerPoolReferenceDeleted object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'LoadBalancerPoolReferenceDeleted') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class LoadBalancerPoolSessionPersistence():
"""
- LoadBalancerListenerPolicyCollection.
+ LoadBalancerPoolSessionPersistence.
- :attr List[LoadBalancerListenerPolicy] policies: Collection of policies.
+ :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,
- policies: List['LoadBalancerListenerPolicy']) -> None:
+ type: str,
+ *,
+ cookie_name: str = None) -> None:
"""
- Initialize a LoadBalancerListenerPolicyCollection object.
+ Initialize a LoadBalancerPoolSessionPersistence object.
- :param List[LoadBalancerListenerPolicy] policies: Collection of policies.
+ :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.policies = policies
+ self.cookie_name = cookie_name
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyCollection':
- """Initialize a LoadBalancerListenerPolicyCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistence':
+ """Initialize a LoadBalancerPoolSessionPersistence object from a json dictionary."""
args = {}
- if 'policies' in _dict:
- args['policies'] = [LoadBalancerListenerPolicy.from_dict(x) for x in _dict.get('policies')]
+ 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 \'policies\' not present in LoadBalancerListenerPolicyCollection JSON')
+ raise ValueError('Required property \'type\' not present in LoadBalancerPoolSessionPersistence JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyCollection 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, 'policies') and self.policies is not None:
- _dict['policies'] = [x.to_dict() for x in self.policies]
+ 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):
@@ -32785,87 +41117,80 @@ 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 LoadBalancerPoolSessionPersistence object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyCollection') -> 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: 'LoadBalancerListenerPolicyCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolSessionPersistence') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyPatch():
+ 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 LoadBalancerPoolSessionPersistencePatch():
"""
- LoadBalancerListenerPolicyPatch.
+ The session persistence configuration. Specify `null` to remove any existing session
+ persistence configuration.
- :attr str name: (optional) The user-defined name for this policy. Names must be
- unique within the load balancer listener the policy resides in.
- :attr 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 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,
*,
- name: str = None,
- priority: int = None,
- target: 'LoadBalancerListenerPolicyTargetPatch' = None) -> None:
+ cookie_name: str = None,
+ type: str = None) -> None:
"""
- Initialize a LoadBalancerListenerPolicyPatch object.
+ Initialize a LoadBalancerPoolSessionPersistencePatch object.
- :param str name: (optional) The user-defined name for this policy. Names
- must be unique within the load balancer listener the policy resides in.
- :param 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 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.name = name
- self.priority = priority
- self.target = target
+ self.cookie_name = cookie_name
+ self.type = type
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPatch':
- """Initialize a LoadBalancerListenerPolicyPatch object from a json dictionary."""
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePatch':
+ """Initialize a LoadBalancerPoolSessionPersistencePatch object from a json dictionary."""
args = {}
- 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')
+ 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 LoadBalancerListenerPolicyPatch 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, '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()
+ 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):
@@ -32873,117 +41198,80 @@ 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 LoadBalancerPoolSessionPersistencePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyPatch') -> 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: 'LoadBalancerListenerPolicyPatch') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolSessionPersistencePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyPrototype():
+ 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 LoadBalancerPoolSessionPersistencePrototype():
"""
- LoadBalancerListenerPolicyPrototype.
+ 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 str name: (optional) The user-defined name for this policy. Names must be
- unique within the load balancer listener the policy resides in.
- :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 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,
- priority: int,
+ type: str,
*,
- name: str = None,
- rules: List['LoadBalancerListenerPolicyRulePrototype'] = None,
- target: 'LoadBalancerListenerPolicyTargetPrototype' = None) -> None:
+ cookie_name: str = None) -> None:
"""
- Initialize a LoadBalancerListenerPolicyPrototype 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 int priority: Priority of the policy. Lower value indicates higher
- priority.
- :param str name: (optional) The user-defined name for this policy. Names
- must be unique within the load balancer listener the policy resides in.
- :param 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 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.name = name
- self.priority = priority
- self.rules = rules
- self.target = target
+ self.cookie_name = cookie_name
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyPrototype':
- """Initialize a LoadBalancerListenerPolicyPrototype 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 LoadBalancerListenerPolicyPrototype JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'priority' in _dict:
- args['priority'] = _dict.get('priority')
+ 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 \'priority\' not present in LoadBalancerListenerPolicyPrototype JSON')
- if 'rules' in _dict:
- args['rules'] = [LoadBalancerListenerPolicyRulePrototype.from_dict(x) for x in _dict.get('rules')]
- 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 LoadBalancerListenerPolicyPrototype 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, '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:
- _dict['rules'] = [x.to_dict() for x in self.rules]
- 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):
@@ -32991,93 +41279,125 @@ 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 LoadBalancerPoolSessionPersistencePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyPrototype') -> bool:
+ 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__
- def __ne__(self, other: 'LoadBalancerListenerPolicyPrototype') -> bool:
+ def __ne__(self, other: 'LoadBalancerPoolSessionPersistencePrototype') -> 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 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.
+ The session persistence type. The `http_cookie` and `app_cookie` types are
+ applicable only to the `http` and `https` protocols.
"""
- FORWARD = 'forward'
- HTTPS_REDIRECT = 'https_redirect'
- REDIRECT = 'redirect'
- REJECT = 'reject'
+ APP_COOKIE = 'app_cookie'
+ HTTP_COOKIE = 'http_cookie'
+ SOURCE_IP = 'source_ip'
-class LoadBalancerListenerPolicyReference():
+class LoadBalancerProfile():
"""
- LoadBalancerListenerPolicyReference.
+ LoadBalancerProfile.
- :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 str family: The product family this load balancer profile belongs to.
+ :attr str href: The URL for this load balancer profile.
+ :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:
"""
def __init__(self,
+ family: str,
href: str,
- id: str,
- *,
- deleted: 'LoadBalancerListenerPolicyReferenceDeleted' = None) -> None:
+ logging_supported: 'LoadBalancerProfileLoggingSupported',
+ name: str,
+ route_mode_supported: 'LoadBalancerProfileRouteModeSupported',
+ security_groups_supported: 'LoadBalancerProfileSecurityGroupsSupported') -> None:
"""
- Initialize a LoadBalancerListenerPolicyReference object.
+ Initialize a LoadBalancerProfile object.
- :param str href: The listener policy's canonical URL.
- :param str id: The policy's unique identifier.
- :param LoadBalancerListenerPolicyReferenceDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted
- and provides
- some supplementary information.
+ :param str family: The product family this load balancer profile belongs
+ to.
+ :param str href: The URL for this load balancer profile.
+ :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:
"""
- self.deleted = deleted
+ self.family = family
self.href = href
- self.id = id
+ self.logging_supported = logging_supported
+ self.name = name
+ self.route_mode_supported = route_mode_supported
+ self.security_groups_supported = security_groups_supported
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReference':
- """Initialize a LoadBalancerListenerPolicyReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfile':
+ """Initialize a LoadBalancerProfile object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- args['deleted'] = LoadBalancerListenerPolicyReferenceDeleted.from_dict(_dict.get('deleted'))
+ 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 LoadBalancerListenerPolicyReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'href\' 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 \'id\' not present in LoadBalancerListenerPolicyReference JSON')
+ 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyReference 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, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'family') and self.family is not None:
+ _dict['family'] = self.family
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, 'logging_supported') and self.logging_supported is not None:
+ _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()
return _dict
def _to_dict(self):
@@ -33085,56 +41405,103 @@ 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 LoadBalancerProfile object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyReference') -> 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: 'LoadBalancerListenerPolicyReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfile') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyReferenceDeleted():
+class LoadBalancerProfileCollection():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ LoadBalancerProfileCollection.
- :attr str more_info: Link to documentation about deleted resources.
+ :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,
- more_info: str) -> None:
+ first: 'LoadBalancerProfileCollectionFirst',
+ limit: int,
+ profiles: List['LoadBalancerProfile'],
+ total_count: int,
+ *,
+ next: 'LoadBalancerProfileCollectionNext' = None) -> None:
"""
- Initialize a LoadBalancerListenerPolicyReferenceDeleted object.
+ Initialize a LoadBalancerProfileCollection object.
- :param str more_info: Link to documentation about deleted resources.
+ :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.more_info = more_info
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.profiles = profiles
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyReferenceDeleted':
- """Initialize a LoadBalancerListenerPolicyReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollection':
+ """Initialize a LoadBalancerProfileCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if 'first' in _dict:
+ args['first'] = LoadBalancerProfileCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyReferenceDeleted JSON')
+ 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(x) for x 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 LoadBalancerListenerPolicyReferenceDeleted 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, '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:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ _dict['profiles'] = [x.to_dict() for x in self.profiles]
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -33142,144 +41509,55 @@ 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 LoadBalancerProfileCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyReferenceDeleted') -> 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: 'LoadBalancerListenerPolicyReferenceDeleted') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfileCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyRule():
+class LoadBalancerProfileCollectionFirst():
"""
- LoadBalancerListenerPolicyRule.
+ A link to the first page of resources.
- :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.
- :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 str href: The URL for a page of resources.
"""
def __init__(self,
- condition: str,
- created_at: datetime,
- href: str,
- id: str,
- provisioning_status: str,
- type: str,
- value: str,
- *,
- field: str = None) -> None:
+ href: str) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRule object.
+ Initialize a LoadBalancerProfileCollectionFirst 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.
- :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 href: The URL for a page of resources.
"""
- 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) -> 'LoadBalancerProfileCollectionFirst':
+ """Initialize a LoadBalancerProfileCollectionFirst 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')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
- else:
- raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRule JSON')
+ raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRule 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, '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:
- _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -33287,89 +41565,56 @@ 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 LoadBalancerProfileCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRule') -> 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: '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 ProvisioningStatusEnum(str, Enum):
- """
- The provisioning status of this rule.
- """
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- MAINTENANCE_PENDING = 'maintenance_pending'
- 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'
-
+ def __ne__(self, other: 'LoadBalancerProfileCollectionFirst') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
-class LoadBalancerListenerPolicyRuleCollection():
+class LoadBalancerProfileCollectionNext():
"""
- LoadBalancerListenerPolicyRuleCollection.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr List[LoadBalancerListenerPolicyRule] rules: Collection of rules.
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- rules: List['LoadBalancerListenerPolicyRule']) -> None:
+ href: str) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRuleCollection object.
+ Initialize a LoadBalancerProfileCollectionNext object.
- :param List[LoadBalancerListenerPolicyRule] rules: Collection of rules.
+ :param str href: The URL for a page of resources.
"""
- self.rules = rules
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRuleCollection':
- """Initialize a LoadBalancerListenerPolicyRuleCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionNext':
+ """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary."""
args = {}
- if 'rules' in _dict:
- args['rules'] = [LoadBalancerListenerPolicyRule.from_dict(x) for x in _dict.get('rules')]
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'rules\' not present in LoadBalancerListenerPolicyRuleCollection JSON')
+ raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRuleCollection 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, 'rules') and self.rules is not None:
- _dict['rules'] = [x.to_dict() for x in self.rules]
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -33377,94 +41622,78 @@ 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 LoadBalancerProfileCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRuleCollection') -> 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: 'LoadBalancerListenerPolicyRuleCollection') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfileCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyRulePatch():
+class LoadBalancerProfileIdentity():
"""
- LoadBalancerListenerPolicyRulePatch.
+ Identifies a load balancer profile by a unique property.
- :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) -> 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 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,
- *,
- condition: str = None,
- field: str = None,
- type: str = None,
- value: str = None) -> None:
+ type: str,
+ value: List[str]) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRulePatch object.
+ Initialize a LoadBalancerProfileLoggingSupported 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.
+ :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.field = field
self.type = type
self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePatch':
- """Initialize a LoadBalancerListenerPolicyRulePatch 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')
- if 'field' in _dict:
- args['field'] = _dict.get('field')
if 'type' in _dict:
args['type'] = _dict.get('type')
+ else:
+ 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 LoadBalancerProfileLoggingSupported JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRulePatch 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, '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:
@@ -33476,126 +41705,83 @@ 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 LoadBalancerProfileLoggingSupported object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRulePatch') -> 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: 'LoadBalancerListenerPolicyRulePatch') -> 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 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 LoadBalancerListenerPolicyRulePrototype():
+class LoadBalancerProfileReference():
"""
- LoadBalancerListenerPolicyRulePrototype.
+ LoadBalancerProfileReference.
- :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 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,
- condition: str,
- type: str,
- value: str,
- *,
- field: str = None) -> None:
+ family: str,
+ href: str,
+ name: str) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRulePrototype object.
+ Initialize a LoadBalancerProfileReference 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 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.condition = condition
- self.field = field
- self.type = type
- self.value = value
+ self.family = family
+ self.href = href
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerPolicyRulePrototype':
- """Initialize a LoadBalancerListenerPolicyRulePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileReference':
+ """Initialize a LoadBalancerProfileReference object from a json dictionary."""
args = {}
- if 'condition' in _dict:
- args['condition'] = _dict.get('condition')
+ if 'family' in _dict:
+ args['family'] = _dict.get('family')
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 \'family\' not present in LoadBalancerProfileReference JSON')
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'type\' not present in LoadBalancerListenerPolicyRulePrototype JSON')
- if 'value' in _dict:
- args['value'] = _dict.get('value')
+ raise ValueError('Required property \'href\' not present in LoadBalancerProfileReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
else:
- raise ValueError('Required property \'value\' not present in LoadBalancerListenerPolicyRulePrototype JSON')
+ raise ValueError('Required property \'name\' not present in LoadBalancerProfileReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRulePrototype 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, '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, '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):
@@ -33603,102 +41789,178 @@ 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 LoadBalancerProfileReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRulePrototype') -> 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: 'LoadBalancerListenerPolicyRulePrototype') -> bool:
+ def __ne__(self, other: 'LoadBalancerProfileReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ConditionEnum(str, Enum):
+class LoadBalancerProfileRouteModeSupported():
+ """
+ LoadBalancerProfileRouteModeSupported.
+
+ """
+
+ def __init__(self) -> None:
"""
- The condition of the rule.
+ Initialize a LoadBalancerProfileRouteModeSupported object.
+
"""
- CONTAINS = 'contains'
- EQUALS = 'equals'
- MATCHES_REGEX = 'matches_regex'
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerProfileRouteModeSupportedFixed', 'LoadBalancerProfileRouteModeSupportedDependent']))
+ raise Exception(msg)
+
+class LoadBalancerProfileSecurityGroupsSupported():
+ """
+ LoadBalancerProfileSecurityGroupsSupported.
+ """
- class TypeEnum(str, Enum):
+ def __init__(self) -> None:
"""
- The type of the rule.
- Body rules are applied to form-encoded request bodies using the `UTF-8` character
- set.
+ Initialize a LoadBalancerProfileSecurityGroupsSupported object.
+
"""
- BODY = 'body'
- HEADER = 'header'
- HOSTNAME = 'hostname'
- PATH = 'path'
- QUERY = 'query'
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['LoadBalancerProfileSecurityGroupsSupportedFixed', 'LoadBalancerProfileSecurityGroupsSupportedDependent']))
+ raise Exception(msg)
+class LoadBalancerReferenceDeleted():
+ """
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
-class LoadBalancerListenerPolicyRuleReference():
+ :attr str more_info: Link to documentation about deleted resources.
"""
- LoadBalancerListenerPolicyRuleReference.
- :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,
+ 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) -> 'LoadBalancerReferenceDeleted':
+ """Initialize a LoadBalancerReferenceDeleted 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 LoadBalancerReferenceDeleted JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 LoadBalancerReferenceDeleted object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'LoadBalancerReferenceDeleted') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class LoadBalancerStatistics():
+ """
+ LoadBalancerStatistics.
+
+ :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,
- href: str,
- id: str,
- *,
- deleted: 'LoadBalancerListenerPolicyRuleReferenceDeleted' = None) -> None:
+ active_connections: int,
+ connection_rate: float,
+ data_processed_this_month: int,
+ throughput: float) -> None:
"""
- Initialize a LoadBalancerListenerPolicyRuleReference object.
+ Initialize a LoadBalancerStatistics 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 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.deleted = deleted
- self.href = href
- self.id = id
+ 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) -> 'LoadBalancerListenerPolicyRuleReference':
- """Initialize a LoadBalancerListenerPolicyRuleReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'LoadBalancerStatistics':
+ """Initialize a LoadBalancerStatistics 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')
+ if 'active_connections' in _dict:
+ args['active_connections'] = _dict.get('active_connections')
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerListenerPolicyRuleReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ 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 \'id\' not present in LoadBalancerListenerPolicyRuleReference JSON')
+ 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerPolicyRuleReference 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, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
+ if hasattr(self, '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):
@@ -33706,56 +41968,142 @@ 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 LoadBalancerStatistics object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRuleReference') -> 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: 'LoadBalancerListenerPolicyRuleReference') -> bool:
+ def __ne__(self, other: 'LoadBalancerStatistics') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyRuleReferenceDeleted():
+class NetworkACL():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ NetworkACL.
- :attr str more_info: Link to documentation about deleted resources.
+ :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 user-defined name for this network ACL.
+ :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 is a part of.
"""
def __init__(self,
- more_info: str) -> None:
+ 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 LoadBalancerListenerPolicyRuleReferenceDeleted object.
+ Initialize a NetworkACL object.
- :param str more_info: Link to documentation about deleted resources.
+ :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 user-defined name for this network ACL.
+ :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 is a part of.
"""
- self.more_info = more_info
+ 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) -> 'LoadBalancerListenerPolicyRuleReferenceDeleted':
- """Initialize a LoadBalancerListenerPolicyRuleReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACL':
+ """Initialize a NetworkACL object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ 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 NetworkACL JSON')
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkACL JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
else:
- raise ValueError('Required property \'more_info\' not present in LoadBalancerListenerPolicyRuleReferenceDeleted JSON')
+ 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(x) for x in _dict.get('rules')]
+ else:
+ raise ValueError('Required property \'rules\' not present in NetworkACL JSON')
+ if 'subnets' in _dict:
+ args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
+ 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 LoadBalancerListenerPolicyRuleReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ 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:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'rules') and self.rules is not None:
+ _dict['rules'] = [x.to_dict() for x in self.rules]
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ _dict['subnets'] = [x.to_dict() for x in self.subnets]
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ _dict['vpc'] = self.vpc.to_dict()
return _dict
def _to_dict(self):
@@ -33763,212 +42111,101 @@ 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 NetworkACL object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> 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: 'LoadBalancerListenerPolicyRuleReferenceDeleted') -> bool:
+ def __ne__(self, other: 'NetworkACL') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerPolicyTarget():
- """
- - 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) -> None:
- """
- Initialize a LoadBalancerListenerPolicyTarget object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerListenerPolicyTargetLoadBalancerPoolReference', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerPolicyRedirectURL', 'LoadBalancerListenerPolicyTargetLoadBalancerListenerHTTPSRedirect']))
- raise Exception(msg)
-
-class LoadBalancerListenerPolicyTargetPatch():
- """
- - 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) -> 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():
+class NetworkACLCollection():
"""
- LoadBalancerListenerPrototypeLoadBalancerContext.
+ NetworkACLCollection.
- :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 int connection_limit: (optional) The connection limit of the listener.
- :attr LoadBalancerPoolIdentityByName default_pool: (optional) The default pool
- associated with the listener.
- :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 support
- different values for `port_min` and `port_max`. When route mode is enabled,
- only a value of
- `65535` is supported for `port_max`.
- :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 support
- different values for `port_min` and `port_max`. When route mode is enabled,
- only a value of
- `1` is supported for `port_min`.
- :attr str protocol: The listener protocol. Load balancers in the `network`
- family support `tcp`. Load balancers in the `application` family support `tcp`,
- `http`, and `https`. Each listener in the load balancer must have a unique
- `port` and `protocol` combination.
+ :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,
- protocol: str,
+ first: 'NetworkACLCollectionFirst',
+ limit: int,
+ network_acls: List['NetworkACL'],
+ total_count: int,
*,
- accept_proxy_protocol: bool = None,
- connection_limit: int = None,
- default_pool: 'LoadBalancerPoolIdentityByName' = None,
- port: int = None,
- port_max: int = None,
- port_min: int = None) -> None:
+ next: 'NetworkACLCollectionNext' = None) -> None:
"""
- Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object.
+ Initialize a NetworkACLCollection object.
- :param str protocol: The listener protocol. Load balancers in the `network`
- family support `tcp`. Load balancers in the `application` family support
- `tcp`, `http`, and `https`. Each listener in the load balancer must have a
- unique `port` and `protocol` combination.
- :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 int connection_limit: (optional) The connection limit of the
- listener.
- :param LoadBalancerPoolIdentityByName default_pool: (optional) The default
- pool associated with the listener.
- :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 support
- different values for `port_min` and `port_max`. When route mode is
- enabled, only a value of
- `65535` is supported for `port_max`.
- :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 support
- different values for `port_min` and `port_max`. When route mode is
- enabled, only a value of
- `1` is supported for `port_min`.
+ :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.accept_proxy_protocol = accept_proxy_protocol
- self.connection_limit = connection_limit
- self.default_pool = default_pool
- self.port = port
- self.port_max = port_max
- self.port_min = port_min
- self.protocol = protocol
+ 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) -> 'LoadBalancerListenerPrototypeLoadBalancerContext':
- """Initialize a LoadBalancerListenerPrototypeLoadBalancerContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLCollection':
+ """Initialize a NetworkACLCollection object from a json dictionary."""
args = {}
- if 'accept_proxy_protocol' in _dict:
- args['accept_proxy_protocol'] = _dict.get('accept_proxy_protocol')
- 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 '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 'first' in _dict:
+ args['first'] = NetworkACLCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'protocol\' not present in LoadBalancerListenerPrototypeLoadBalancerContext 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(x) for x 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 LoadBalancerListenerPrototypeLoadBalancerContext 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, 'accept_proxy_protocol') and self.accept_proxy_protocol is not None:
- _dict['accept_proxy_protocol'] = self.accept_proxy_protocol
- if hasattr(self, 'connection_limit') and self.connection_limit is not None:
- _dict['connection_limit'] = self.connection_limit
- if hasattr(self, 'default_pool') and self.default_pool is not None:
- _dict['default_pool'] = self.default_pool.to_dict()
- if hasattr(self, '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, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'network_acls') and self.network_acls is not None:
+ _dict['network_acls'] = [x.to_dict() for x in self.network_acls]
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -33976,91 +42213,55 @@ 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 NetworkACLCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> 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: 'LoadBalancerListenerPrototypeLoadBalancerContext') -> bool:
+ def __ne__(self, other: 'NetworkACLCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ProtocolEnum(str, Enum):
- """
- The listener protocol. Load balancers in the `network` family support `tcp`. Load
- balancers in the `application` family support `tcp`, `http`, and `https`. Each
- listener in the load balancer must have a unique `port` and `protocol`
- combination.
- """
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
-
-
-class LoadBalancerListenerReference():
+class NetworkACLCollectionFirst():
"""
- LoadBalancerListenerReference.
+ A link to the first page of resources.
- :attr LoadBalancerListenerReferenceDeleted 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 a page of resources.
"""
def __init__(self,
- href: str,
- id: str,
- *,
- deleted: 'LoadBalancerListenerReferenceDeleted' = None) -> None:
+ href: str) -> None:
"""
- Initialize a LoadBalancerListenerReference object.
+ Initialize a NetworkACLCollectionFirst 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
- some supplementary information.
+ :param str href: The URL for a page of resources.
"""
- self.deleted = deleted
self.href = href
- self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerListenerReference':
- """Initialize a LoadBalancerListenerReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionFirst':
+ """Initialize a NetworkACLCollectionFirst object from a json dictionary."""
args = {}
- if 'deleted' in _dict:
- 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 LoadBalancerListenerReference 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 \'href\' not present in NetworkACLCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerReference object from a json dictionary."""
+ """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, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
return _dict
def _to_dict(self):
@@ -34068,56 +42269,56 @@ 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 NetworkACLCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerReference') -> bool:
+ def __eq__(self, other: 'NetworkACLCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerListenerReference') -> bool:
+ def __ne__(self, other: 'NetworkACLCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerListenerReferenceDeleted():
+class NetworkACLCollectionNext():
"""
- 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) -> None:
+ href: str) -> None:
"""
- Initialize a LoadBalancerListenerReferenceDeleted object.
+ Initialize a NetworkACLCollectionNext 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) -> 'LoadBalancerListenerReferenceDeleted':
- """Initialize a LoadBalancerListenerReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionNext':
+ """Initialize a NetworkACLCollectionNext 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 LoadBalancerListenerReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in NetworkACLCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerListenerReferenceDeleted object from a json dictionary."""
+ """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, '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):
@@ -34125,56 +42326,71 @@ 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 NetworkACLCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerListenerReferenceDeleted') -> bool:
+ 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: 'LoadBalancerListenerReferenceDeleted') -> bool:
+ def __ne__(self, other: 'NetworkACLCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerLogging():
+class NetworkACLIdentity():
"""
- The logging configuration for this load balancer.
+ Identifies a network ACL by a unique property.
- :attr LoadBalancerLoggingDatapath datapath: (optional) The datapath logging
- configuration for this load balancer.
+ """
+
+ def __init__(self) -> 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 user-defined name for this network ACL. Names
+ must be unique within the VPC the network ACL resides in.
"""
def __init__(self,
*,
- datapath: 'LoadBalancerLoggingDatapath' = None) -> None:
+ name: str = None) -> None:
"""
- Initialize a LoadBalancerLogging object.
+ Initialize a NetworkACLPatch object.
- :param LoadBalancerLoggingDatapath datapath: (optional) The datapath
- logging configuration for this load balancer.
+ :param str name: (optional) The user-defined name for this network ACL.
+ Names must be unique within the VPC the network ACL resides in.
"""
- self.datapath = datapath
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerLogging':
- """Initialize a LoadBalancerLogging object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLPatch':
+ """Initialize a NetworkACLPatch object from a json dictionary."""
args = {}
- if 'datapath' in _dict:
- args['datapath'] = LoadBalancerLoggingDatapath.from_dict(_dict.get('datapath'))
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerLogging 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, 'datapath') and self.datapath is not None:
- _dict['datapath'] = self.datapath.to_dict()
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -34182,57 +42398,132 @@ 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 NetworkACLPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerLogging') -> 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: 'LoadBalancerLogging') -> bool:
+ def __ne__(self, other: 'NetworkACLPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerLoggingDatapath():
+class NetworkACLPrototype():
"""
- The datapath logging configuration for this load balancer.
+ NetworkACLPrototype.
- :attr bool active: Indicates whether datapath logging is active for this load
- balancer.
+ :attr str name: (optional) The user-defined name for this network ACL. Names
+ must be unique within the VPC the network ACL resides in. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :attr ResourceGroupIdentity resource_group: (optional) The resource group to
+ use. If unspecified, the account's [default resource
+ group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.
+ :attr VPCIdentity vpc: The VPC this network ACL is to be a part of.
"""
def __init__(self,
- active: bool) -> None:
+ vpc: 'VPCIdentity',
+ *,
+ name: str = None,
+ resource_group: 'ResourceGroupIdentity' = None) -> None:
"""
- Initialize a LoadBalancerLoggingDatapath object.
+ Initialize a NetworkACLPrototype object.
- :param bool active: Indicates whether datapath logging is active for this
- load balancer.
+ :param VPCIdentity vpc: The VPC this network ACL is to be a part of.
+ :param str name: (optional) The user-defined name for this network ACL.
+ Names must be unique within the VPC the network ACL resides in. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :param 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.
"""
- self.active = active
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['NetworkACLPrototypeNetworkACLByRules', 'NetworkACLPrototypeNetworkACLBySourceNetworkACL']))
+ raise Exception(msg)
+
+class NetworkACLReference():
+ """
+ NetworkACLReference.
+
+ :attr str crn: The CRN for this network ACL.
+ :attr NetworkACLReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted and provides
+ some supplementary information.
+ :attr str href: The URL for this network ACL.
+ :attr str id: The unique identifier for this network ACL.
+ :attr str name: The user-defined name for this network ACL.
+ """
+
+ def __init__(self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
+ *,
+ deleted: 'NetworkACLReferenceDeleted' = None) -> None:
+ """
+ Initialize a NetworkACLReference 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 user-defined name for this network ACL.
+ :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) -> 'LoadBalancerLoggingDatapath':
- """Initialize a LoadBalancerLoggingDatapath object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLReference':
+ """Initialize a NetworkACLReference object from a json dictionary."""
args = {}
- if 'active' in _dict:
- args['active'] = _dict.get('active')
+ 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'] = NetworkACLReferenceDeleted.from_dict(_dict.get('deleted'))
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkACLReference JSON')
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
else:
- raise ValueError('Required property \'active\' not present in LoadBalancerLoggingDatapath 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 LoadBalancerLoggingDatapath 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, 'active') and self.active is not None:
- _dict['active'] = self.active
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -34240,69 +42531,56 @@ 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 NetworkACLReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerLoggingDatapath') -> 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: 'LoadBalancerLoggingDatapath') -> bool:
+ def __ne__(self, other: 'NetworkACLReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPatch():
+class NetworkACLReferenceDeleted():
"""
- LoadBalancerPatch.
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :attr LoadBalancerLogging 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 unique user-defined name for this load balancer.
+ :attr str more_info: Link to documentation about deleted resources.
"""
def __init__(self,
- *,
- logging: 'LoadBalancerLogging' = None,
- name: str = None) -> None:
+ more_info: str) -> None:
"""
- Initialize a LoadBalancerPatch object.
+ Initialize a NetworkACLReferenceDeleted object.
- :param LoadBalancerLogging 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 unique user-defined name for this load
- balancer.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.logging = logging
- self.name = name
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPatch':
- """Initialize a LoadBalancerPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLReferenceDeleted':
+ """Initialize a NetworkACLReferenceDeleted object from a json dictionary."""
args = {}
- if 'logging' in _dict:
- args['logging'] = LoadBalancerLogging.from_dict(_dict.get('logging'))
- 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 NetworkACLReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPatch object from a json dictionary."""
+ """Initialize a NetworkACLReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'logging') and self.logging is not None:
- _dict['logging'] = self.logging.to_dict()
- if 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):
@@ -34310,301 +42588,255 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPatch object."""
+ """Return a `str` version of this NetworkACLReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPatch') -> bool:
+ 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: 'LoadBalancerPatch') -> bool:
+ def __ne__(self, other: 'NetworkACLReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPool():
+class NetworkACLRule():
"""
- LoadBalancerPool.
+ NetworkACLRule.
- :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 user-defined name for this load balancer pool.
- :attr str protocol: The protocol used for this load balancer pool.
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the pool on which the unexpected
- property value was encountered.
- :attr str provisioning_status: The provisioning status of this pool.
- :attr str proxy_protocol: The PROXY protocol setting for this pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `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: Whether to allow or deny matching traffic.
+ :attr NetworkACLRuleReference before: (optional) The rule that this rule is
+ immediately before. If absent, this is the last rule.
+ :attr datetime created_at: The date and time that the rule was created.
+ :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0`
+ applies to all addresses.
+ :attr str direction: Whether the traffic to be matched is `inbound` or
+ `outbound`.
+ :attr str href: The URL for this network ACL rule.
+ :attr str id: The unique identifier for this network ACL rule.
+ :attr str ip_version: The IP version for this rule.
+ :attr str name: The user-defined name for this rule. Names must be unique within
+ the network ACL the rule resides in. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :attr str protocol: The protocol to enforce.
+ :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to
+ all addresses.
"""
def __init__(self,
- algorithm: str,
+ action: str,
created_at: datetime,
- health_monitor: 'LoadBalancerPoolHealthMonitor',
+ destination: str,
+ direction: str,
href: str,
id: str,
+ ip_version: str,
name: str,
protocol: str,
- provisioning_status: str,
- proxy_protocol: str,
+ source: str,
*,
- instance_group: 'InstanceGroupReference' = None,
- members: List['LoadBalancerPoolMemberReference'] = None,
- session_persistence: 'LoadBalancerPoolSessionPersistence' = None) -> None:
+ before: 'NetworkACLRuleReference' = None) -> None:
"""
- Initialize a LoadBalancerPool object.
+ Initialize a NetworkACLRule 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 user-defined name for this load balancer pool.
- :param str protocol: The protocol used for this load balancer pool.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the pool on
- which the unexpected property value was encountered.
- :param str provisioning_status: The provisioning status of this pool.
- :param str proxy_protocol: The PROXY protocol setting for this pool:
- - `v1`: Enabled with version 1 (human-readable header format)
- - `v2`: Enabled with version 2 (binary header format)
- - `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: Whether to allow or deny matching traffic.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination CIDR block. The CIDR block
+ `0.0.0.0/0` applies to all addresses.
+ :param str direction: Whether the traffic to be matched is `inbound` or
+ `outbound`.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The user-defined name for this rule. Names must be unique
+ within the network ACL the rule resides in. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source CIDR block. The CIDR block `0.0.0.0/0`
+ applies to all addresses.
+ :param NetworkACLRuleReference before: (optional) The rule that this rule
+ is immediately before. If absent, this is the last rule.
"""
- 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
+ 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) -> '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(x) for x 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)
+ 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):
- """Initialize a LoadBalancerPool object from a json dictionary."""
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a NetworkACLRule object from 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:
- _dict['health_monitor'] = self.health_monitor.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'instance_group') and self.instance_group is not None:
- _dict['instance_group'] = self.instance_group.to_dict()
- if hasattr(self, 'members') and self.members is not None:
- _dict['members'] = [x.to_dict() for x in self.members]
- 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:
- _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)
+ @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 __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__
+ class ActionEnum(str, Enum):
+ """
+ Whether to allow or deny matching traffic.
+ """
+ ALLOW = 'allow'
+ DENY = 'deny'
- 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):
+ class DirectionEnum(str, Enum):
"""
- The load balancing algorithm.
+ Whether the traffic to be matched is `inbound` or `outbound`.
"""
- LEAST_CONNECTIONS = 'least_connections'
- ROUND_ROBIN = 'round_robin'
- WEIGHTED_ROUND_ROBIN = 'weighted_round_robin'
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
- class ProtocolEnum(str, Enum):
+ class IpVersionEnum(str, Enum):
"""
- The protocol used for this load balancer pool.
- The enumerated values for this property are expected to expand in the future. When
- processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the pool on which the unexpected
- property value was encountered.
+ The IP version for this rule.
"""
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
+ IPV4 = 'ipv4'
+ IPV6 = 'ipv6'
- class ProvisioningStatusEnum(str, Enum):
+class NetworkACLRuleBeforePatch():
+ """
+ The rule to move this rule immediately before. Specify `null` to move this rule after
+ all existing rules.
+
+ """
+
+ def __init__(self) -> None:
"""
- The provisioning status of this pool.
+ Initialize a NetworkACLRuleBeforePatch object.
+
"""
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- MAINTENANCE_PENDING = 'maintenance_pending'
- UPDATE_PENDING = 'update_pending'
+ 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 omitted, this rule will be
+ inserted after all existing rules.
- 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`).
+ """
+
+ def __init__(self) -> None:
"""
- DISABLED = 'disabled'
- V1 = 'v1'
- V2 = 'v2'
+ 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 LoadBalancerPoolCollection():
+class NetworkACLRuleCollection():
"""
- LoadBalancerPoolCollection.
+ NetworkACLRuleCollection.
- :attr List[LoadBalancerPool] pools: Collection of pools.
+ :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,
- pools: List['LoadBalancerPool']) -> None:
+ first: 'NetworkACLRuleCollectionFirst',
+ limit: int,
+ rules: List['NetworkACLRuleItem'],
+ total_count: int,
+ *,
+ next: 'NetworkACLRuleCollectionNext' = None) -> None:
"""
- Initialize a LoadBalancerPoolCollection object.
+ Initialize a NetworkACLRuleCollection object.
- :param List[LoadBalancerPool] pools: Collection of pools.
+ :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.pools = pools
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.rules = rules
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolCollection':
- """Initialize a LoadBalancerPoolCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollection':
+ """Initialize a NetworkACLRuleCollection object from a json dictionary."""
args = {}
- if 'pools' in _dict:
- args['pools'] = [LoadBalancerPool.from_dict(x) for x in _dict.get('pools')]
+ if 'first' in _dict:
+ args['first'] = NetworkACLRuleCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'pools\' not present in LoadBalancerPoolCollection 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(x) for x 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 LoadBalancerPoolCollection 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, 'pools') and self.pools is not None:
- _dict['pools'] = [x.to_dict() for x in self.pools]
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'rules') and self.rules is not None:
+ _dict['rules'] = [x.to_dict() for x in self.rules]
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -34612,121 +42844,55 @@ 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 NetworkACLRuleCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolCollection') -> 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: 'LoadBalancerPoolCollection') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolHealthMonitor():
+class NetworkACLRuleCollectionFirst():
"""
- LoadBalancerPoolHealthMonitor.
+ A link to the first page of resources.
- :attr int delay: The health check interval in seconds. Interval must be greater
- than timeout value.
- :attr int max_retries: The health check max retries.
- :attr int port: (optional) The health check port number. If specified, this
- overrides the ports specified in the server member resources.
- :attr int timeout: The health check timeout in seconds.
- :attr str type: The protocol type of this load balancer pool health monitor.
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the health monitor on which the
- unexpected property value was encountered.
- :attr str url_path: (optional) The health check URL path. Applicable only if the
- health monitor `type` is `http` or
- `https`. This value must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- delay: int,
- max_retries: int,
- timeout: int,
- type: str,
- *,
- port: int = None,
- url_path: str = None) -> None:
+ href: str) -> None:
"""
- Initialize a LoadBalancerPoolHealthMonitor object.
+ Initialize a NetworkACLRuleCollectionFirst object.
- :param int delay: The health check interval in seconds. Interval must be
- greater than timeout value.
- :param int max_retries: The health check max retries.
- :param int timeout: The health check timeout in seconds.
- :param str type: The protocol type of this load balancer pool health
- monitor.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the health
- monitor on which the unexpected property value was encountered.
- :param int port: (optional) The health check port number. If specified,
- this overrides the ports specified in the server member resources.
- :param str url_path: (optional) The health check URL path. Applicable only
- if the health monitor `type` is `http` or
- `https`. This value must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :param str href: The URL for a page of resources.
"""
- self.delay = delay
- self.max_retries = max_retries
- self.port = port
- self.timeout = timeout
- self.type = type
- self.url_path = url_path
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitor':
- """Initialize a LoadBalancerPoolHealthMonitor object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollectionFirst':
+ """Initialize a NetworkACLRuleCollectionFirst 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 'href' in _dict:
+ args['href'] = _dict.get('href')
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 \'href\' not present in NetworkACLRuleCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolHealthMonitor 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, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -34734,128 +42900,56 @@ 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 NetworkACLRuleCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolHealthMonitor') -> 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: 'LoadBalancerPoolHealthMonitor') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
- """
- The protocol type of this load balancer pool health monitor.
- 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 NetworkACLRuleCollectionNext():
"""
- LoadBalancerPoolHealthMonitorPatch.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr int delay: The health check interval in seconds. Interval must be greater
- than timeout value.
- :attr int max_retries: The health check max retries.
- :attr int port: (optional) The health check port number. If specified, this
- overrides the ports specified in the server member resources. Specify `null` to
- remove an existing port value.
- :attr int timeout: The health check timeout in seconds.
- :attr str type: The protocol type of this load balancer pool health monitor.
- :attr str url_path: (optional) The health check URL path. Applicable only if the
- health monitor `type` is `http` or
- `https`. This value must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- delay: int,
- max_retries: int,
- timeout: int,
- type: str,
- *,
- port: int = None,
- url_path: str = None) -> None:
+ href: str) -> None:
"""
- Initialize a LoadBalancerPoolHealthMonitorPatch object.
+ Initialize a NetworkACLRuleCollectionNext object.
- :param int delay: The health check interval in seconds. Interval must be
- greater than timeout value.
- :param int max_retries: The health check max retries.
- :param int timeout: The health check timeout in seconds.
- :param str type: The protocol type of this load balancer pool health
- monitor.
- :param int port: (optional) The health check port number. If specified,
- this overrides the ports specified in the server member resources. Specify
- `null` to remove an existing port value.
- :param str url_path: (optional) The health check URL path. Applicable only
- if the health monitor `type` is `http` or
- `https`. This value must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :param str href: The URL for a page of resources.
"""
- self.delay = delay
- self.max_retries = max_retries
- self.port = port
- self.timeout = timeout
- self.type = type
- self.url_path = url_path
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPatch':
- """Initialize a LoadBalancerPoolHealthMonitorPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleCollectionNext':
+ """Initialize a NetworkACLRuleCollectionNext object from a json dictionary."""
args = {}
- if 'delay' in _dict:
- args['delay'] = _dict.get('delay')
- else:
- 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')
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
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 \'href\' not present in NetworkACLRuleCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolHealthMonitorPatch 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, '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, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -34863,122 +42957,288 @@ 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 NetworkACLRuleCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolHealthMonitorPatch') -> 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: 'LoadBalancerPoolHealthMonitorPatch') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+class NetworkACLRuleItem():
+ """
+ NetworkACLRuleItem.
+
+ :attr str action: Whether to allow or deny matching traffic.
+ :attr NetworkACLRuleReference before: (optional) The rule that this rule is
+ immediately before. In a rule collection, this always
+ refers to the next item in the collection. If absent, this is the last rule.
+ :attr datetime created_at: The date and time that the rule was created.
+ :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0`
+ applies to all addresses.
+ :attr str direction: Whether the traffic to be matched is `inbound` or
+ `outbound`.
+ :attr str href: The URL for this network ACL rule.
+ :attr str id: The unique identifier for this network ACL rule.
+ :attr str ip_version: The IP version for this rule.
+ :attr str name: The user-defined name for this rule. Names must be unique within
+ the network ACL the rule resides in. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :attr str protocol: The protocol to enforce.
+ :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to
+ all 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:
"""
- The protocol type of this load balancer pool health monitor.
+ Initialize a NetworkACLRuleItem object.
+
+ :param str action: Whether to allow or deny matching traffic.
+ :param datetime created_at: The date and time that the rule was created.
+ :param str destination: The destination CIDR block. The CIDR block
+ `0.0.0.0/0` applies to all addresses.
+ :param str direction: Whether the traffic to be matched is `inbound` or
+ `outbound`.
+ :param str href: The URL for this network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str ip_version: The IP version for this rule.
+ :param str name: The user-defined name for this rule. Names must be unique
+ within the network ACL the rule resides in. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source CIDR block. The CIDR block `0.0.0.0/0`
+ applies to all addresses.
+ :param 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.
"""
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
+ 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) -> '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: Dict):
+ """Initialize a NetworkACLRuleItem object from a json dictionary."""
+ return cls.from_dict(_dict)
-class LoadBalancerPoolHealthMonitorPrototype():
+ @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):
+ """
+ Whether to allow or deny matching traffic.
+ """
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ Whether the traffic to be matched is `inbound` or `outbound`.
+ """
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version for this rule.
+ """
+ IPV4 = 'ipv4'
+ IPV6 = 'ipv6'
+
+
+class NetworkACLRulePatch():
"""
- LoadBalancerPoolHealthMonitorPrototype.
+ NetworkACLRulePatch.
- :attr int delay: The health check interval in seconds. Interval must be greater
- than timeout value.
- :attr int max_retries: The health check max retries.
- :attr int port: (optional) The health check port number. If specified, this
- overrides the ports specified in the server member resources.
- :attr int timeout: The health check timeout in seconds.
- :attr str type: The protocol type of this load balancer pool health monitor.
- :attr str url_path: (optional) The health check URL path. Applicable only if the
- health monitor `type` is `http` or
- `https`. This value must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :attr str action: (optional) Whether to allow or deny matching traffic.
+ :attr NetworkACLRuleBeforePatch before: (optional) The rule to move this rule
+ immediately before. Specify `null` to move this rule after
+ all existing rules.
+ :attr int code: (optional) The ICMP traffic code to allow.
+ :attr str destination: (optional) The destination IP address or CIDR block. The
+ CIDR block `0.0.0.0/0` applies to all addresses.
+ :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP
+ destination port range.
+ :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP
+ destination port range.
+ :attr str direction: (optional) Whether the traffic to be matched is `inbound`
+ or `outbound`.
+ :attr str name: (optional) The user-defined name for this rule. Names must be
+ unique within the network ACL the rule resides in.
+ :attr str source: (optional) The source IP address or CIDR block. The CIDR
+ block `0.0.0.0/0` applies to all addresses.
+ :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP
+ source port range.
+ :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP
+ source port range.
+ :attr int type: (optional) The ICMP traffic type to allow.
"""
def __init__(self,
- delay: int,
- max_retries: int,
- timeout: int,
- type: str,
*,
- port: int = None,
- url_path: str = None) -> 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,
+ source: str = None,
+ source_port_max: int = None,
+ source_port_min: int = None,
+ type: int = None) -> None:
"""
- Initialize a LoadBalancerPoolHealthMonitorPrototype object.
+ Initialize a NetworkACLRulePatch object.
- :param int delay: The health check interval in seconds. Interval must be
- greater than timeout value.
- :param int max_retries: The health check max retries.
- :param int timeout: The health check timeout in seconds.
- :param str type: The protocol type of this load balancer pool health
- monitor.
- :param int port: (optional) The health check port number. If specified,
- this overrides the ports specified in the server member resources.
- :param str url_path: (optional) The health check URL path. Applicable only
- if the health monitor `type` is `http` or
- `https`. This value must be in the format of an [origin-form request
- target](https://tools.ietf.org/html/rfc7230#section-5.3.1).
+ :param str action: (optional) Whether to allow or deny matching traffic.
+ :param NetworkACLRuleBeforePatch before: (optional) The rule to move this
+ rule immediately before. Specify `null` to move this rule after
+ all existing rules.
+ :param int code: (optional) The ICMP traffic code to allow.
+ :param str destination: (optional) The destination IP address or CIDR
+ block. The CIDR block `0.0.0.0/0` applies to all addresses.
+ :param int destination_port_max: (optional) The inclusive upper bound of
+ TCP/UDP destination port range.
+ :param int destination_port_min: (optional) The inclusive lower bound of
+ TCP/UDP destination port range.
+ :param str direction: (optional) Whether the traffic to be matched is
+ `inbound` or `outbound`.
+ :param str name: (optional) The user-defined name for this rule. Names must
+ be unique within the network ACL the rule resides in.
+ :param str source: (optional) The source IP address or CIDR block. The
+ CIDR block `0.0.0.0/0` applies to all addresses.
+ :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP
+ source port range.
+ :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP
+ source port range.
+ :param int type: (optional) The ICMP traffic type to allow.
"""
- self.delay = delay
- self.max_retries = max_retries
- self.port = port
- self.timeout = timeout
+ 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.source = source
+ self.source_port_max = source_port_max
+ self.source_port_min = source_port_min
self.type = type
- self.url_path = url_path
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolHealthMonitorPrototype':
- """Initialize a LoadBalancerPoolHealthMonitorPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRulePatch':
+ """Initialize a NetworkACLRulePatch 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 '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 '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')
- 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."""
+ """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, '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, '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, '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, '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
- if hasattr(self, 'url_path') and self.url_path is not None:
- _dict['url_path'] = self.url_path
return _dict
def _to_dict(self):
@@ -34986,216 +43246,301 @@ 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 NetworkACLRulePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolHealthMonitorPrototype') -> 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: 'LoadBalancerPoolHealthMonitorPrototype') -> bool:
+ def __ne__(self, other: 'NetworkACLRulePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class TypeEnum(str, Enum):
+ class ActionEnum(str, Enum):
+ """
+ Whether to allow or deny matching traffic.
+ """
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
"""
- The protocol type of this load balancer pool health monitor.
+ Whether the traffic to be matched is `inbound` or `outbound`.
"""
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
-class LoadBalancerPoolIdentity():
+class NetworkACLRulePrototype():
"""
- Identifies a load balancer pool by a unique property.
+ NetworkACLRulePrototype.
+ :attr str action: Whether to allow or deny matching traffic.
+ :attr NetworkACLRuleBeforePrototype before: (optional) The rule to insert this
+ rule immediately before. If omitted, this rule will be
+ inserted after all existing rules.
+ :attr str destination: The destination IP address or CIDR block. The CIDR block
+ `0.0.0.0/0` applies to all addresses.
+ :attr str direction: Whether the traffic to be matched is `inbound` or
+ `outbound`.
+ :attr str name: (optional) The user-defined name for this rule. Names must be
+ unique within the network ACL the rule resides in. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :attr str protocol: The protocol to enforce.
+ :attr str source: The source IP address or CIDR block. The CIDR block
+ `0.0.0.0/0` applies to all addresses.
"""
- def __init__(self) -> None:
+ def __init__(self,
+ action: str,
+ destination: str,
+ direction: str,
+ protocol: str,
+ source: str,
+ *,
+ before: 'NetworkACLRuleBeforePrototype' = None,
+ name: str = None) -> None:
"""
- Initialize a LoadBalancerPoolIdentity object.
+ Initialize a NetworkACLRulePrototype object.
+ :param str action: Whether to allow or deny matching traffic.
+ :param str destination: The destination IP address or CIDR block. The CIDR
+ block `0.0.0.0/0` applies to all addresses.
+ :param str direction: Whether the traffic to be matched is `inbound` or
+ `outbound`.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block. The CIDR block
+ `0.0.0.0/0` applies to all addresses.
+ :param NetworkACLRuleBeforePrototype before: (optional) The rule to insert
+ this rule immediately before. If omitted, this rule will be
+ inserted after all existing rules.
+ :param str name: (optional) The user-defined name for this rule. Names must
+ be unique within the network ACL the rule resides in. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerPoolIdentityById', 'LoadBalancerPoolIdentityByHref']))
+ ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll']))
raise Exception(msg)
-class LoadBalancerPoolIdentityByName():
+ @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(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll']))
+ raise Exception(msg)
+
+ @classmethod
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a NetworkACLRulePrototype object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ @classmethod
+ def _get_class_by_discriminator(cls, _dict: Dict) -> object:
+ mapping = {}
+ mapping['all'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll'
+ mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP'
+ mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP'
+ mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP'
+ 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)
+
+ class ActionEnum(str, Enum):
+ """
+ Whether to allow or deny matching traffic.
+ """
+ ALLOW = 'allow'
+ DENY = 'deny'
+
+
+ class DirectionEnum(str, Enum):
+ """
+ Whether the traffic to be matched is `inbound` or `outbound`.
+ """
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
+
+
+class NetworkACLRulePrototypeNetworkACLContext():
"""
- LoadBalancerPoolIdentityByName.
+ NetworkACLRulePrototypeNetworkACLContext.
- :attr str name: The user-defined name for this load balancer pool.
+ :attr str action: Whether to allow or deny matching traffic.
+ :attr str destination: The destination IP address or CIDR block. The CIDR block
+ `0.0.0.0/0` applies to all addresses.
+ :attr str direction: Whether the traffic to be matched is `inbound` or
+ `outbound`.
+ :attr str name: (optional) The user-defined name for this rule. Names must be
+ unique within the network ACL the rule resides in. If unspecified, the name will
+ be a hyphenated list of randomly-selected words.
+ :attr str protocol: The protocol to enforce.
+ :attr str source: The source IP address or CIDR block. The CIDR block
+ `0.0.0.0/0` applies to all addresses.
"""
def __init__(self,
- name: str) -> None:
+ action: str,
+ destination: str,
+ direction: str,
+ protocol: str,
+ source: str,
+ *,
+ name: str = None) -> None:
"""
- Initialize a LoadBalancerPoolIdentityByName object.
+ Initialize a NetworkACLRulePrototypeNetworkACLContext object.
- :param str name: The user-defined name for this load balancer pool.
+ :param str action: Whether to allow or deny matching traffic.
+ :param str destination: The destination IP address or CIDR block. The CIDR
+ block `0.0.0.0/0` applies to all addresses.
+ :param str direction: Whether the traffic to be matched is `inbound` or
+ `outbound`.
+ :param str protocol: The protocol to enforce.
+ :param str source: The source IP address or CIDR block. The CIDR block
+ `0.0.0.0/0` applies to all addresses.
+ :param str name: (optional) The user-defined name for this rule. Names must
+ be unique within the network ACL the rule resides in. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
"""
- self.name = name
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll']))
+ raise Exception(msg)
@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)
+ 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(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll']))
+ raise Exception(msg)
@classmethod
- def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolIdentityByName object from a json dictionary."""
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a NetworkACLRulePrototypeNetworkACLContext object from 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
+ @classmethod
+ def _get_class_by_discriminator(cls, _dict: Dict) -> object:
+ mapping = {}
+ mapping['all'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll'
+ mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP'
+ mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP'
+ mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP'
+ 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)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ class ActionEnum(str, Enum):
+ """
+ Whether to allow or deny matching traffic.
+ """
+ ALLOW = 'allow'
+ DENY = 'deny'
- 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__
+ class DirectionEnum(str, Enum):
+ """
+ Whether the traffic to be matched is `inbound` or `outbound`.
+ """
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
- def __ne__(self, other: 'LoadBalancerPoolIdentityByName') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class LoadBalancerPoolMember():
+class NetworkACLRuleReference():
"""
- LoadBalancerPoolMember.
+ NetworkACLRuleReference.
- :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 number of the application running in the server member.
- :attr str provisioning_status: The provisioning status of this member.
- :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.
- :attr int weight: (optional) Weight of the server member. Applicable only if the
- pool algorithm is
- `weighted_round_robin`.
+ :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 user-defined name for this network ACL rule.
"""
def __init__(self,
- created_at: datetime,
- health: str,
href: str,
id: str,
- port: int,
- provisioning_status: str,
- target: 'LoadBalancerPoolMemberTarget',
+ name: str,
*,
- weight: int = None) -> None:
+ deleted: 'NetworkACLRuleReferenceDeleted' = None) -> None:
"""
- Initialize a LoadBalancerPoolMember object.
+ Initialize a NetworkACLRuleReference 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 number of the application running in the server
- member.
- :param str provisioning_status: The provisioning status of this member.
- :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.
- :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 network ACL rule.
+ :param str id: The unique identifier for this network ACL rule.
+ :param str name: The user-defined name for this network ACL rule.
+ :param NetworkACLRuleReferenceDeleted 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
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMember':
- """Initialize a LoadBalancerPoolMember object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkACLRuleReference':
+ """Initialize a NetworkACLRuleReference 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'] = NetworkACLRuleReferenceDeleted.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 NetworkACLRuleReference 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')
- 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')
+ raise ValueError('Required property \'id\' not present in NetworkACLRuleReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
else:
- raise ValueError('Required property \'target\' not present in LoadBalancerPoolMember JSON')
- if 'weight' in _dict:
- args['weight'] = _dict.get('weight')
+ raise ValueError('Required property \'name\' not present in NetworkACLRuleReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMember 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, '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:
+ _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
- else:
- _dict['target'] = self.target.to_dict()
- if hasattr(self, 'weight') and self.weight is not None:
- _dict['weight'] = self.weight
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -35203,161 +43548,56 @@ 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 NetworkACLRuleReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMember') -> 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: 'LoadBalancerPoolMember') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleReference') -> 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):
- """
- The provisioning status of this member.
- """
- ACTIVE = 'active'
- CREATE_PENDING = 'create_pending'
- DELETE_PENDING = 'delete_pending'
- FAILED = 'failed'
- MAINTENANCE_PENDING = 'maintenance_pending'
- UPDATE_PENDING = 'update_pending'
-
-
-class LoadBalancerPoolMemberCollection():
+class NetworkACLRuleReferenceDeleted():
"""
- 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']) -> None:
+ more_info: str) -> None:
"""
- Initialize a LoadBalancerPoolMemberCollection object.
+ Initialize a NetworkACLRuleReferenceDeleted 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) -> 'NetworkACLRuleReferenceDeleted':
+ """Initialize a NetworkACLRuleReferenceDeleted object from a json dictionary."""
args = {}
- if 'members' in _dict:
- args['members'] = [LoadBalancerPoolMember.from_dict(x) for x 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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, 'members') and self.members is not None:
- _dict['members'] = [x.to_dict() for x in self.members]
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolMemberCollection object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'LoadBalancerPoolMemberCollection') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class LoadBalancerPoolMemberPatch():
- """
- LoadBalancerPoolMemberPatch.
-
- :attr int port: (optional) The port number of the application running in the
- server member.
- :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.
- :attr int weight: (optional) Weight of the server member. Applicable only if the
- pool algorithm is
- `weighted_round_robin`.
- """
-
- def __init__(self,
- *,
- port: int = None,
- target: 'LoadBalancerPoolMemberTargetPrototype' = None,
- weight: int = None) -> None:
- """
- Initialize a LoadBalancerPoolMemberPatch object.
-
- :param int port: (optional) The port number of the application running in
- the server member.
- :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.
- :param int weight: (optional) Weight of the server member. Applicable only
- if the pool algorithm is
- `weighted_round_robin`.
- """
- self.port = port
- self.target = target
- self.weight = weight
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberPatch':
- """Initialize a LoadBalancerPoolMemberPatch 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')
+ raise ValueError('Required property \'more_info\' not present in NetworkACLRuleReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberPatch 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, '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, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -35365,86 +43605,187 @@ 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 NetworkACLRuleReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberPatch') -> 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: 'LoadBalancerPoolMemberPatch') -> bool:
+ def __ne__(self, other: 'NetworkACLRuleReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolMemberPrototype():
+class NetworkInterface():
"""
- LoadBalancerPoolMemberPrototype.
+ NetworkInterface.
- :attr int port: The port number of the application running in the server member.
- :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.
- :attr int weight: (optional) Weight of the server member. Applicable only if the
- pool algorithm is
- `weighted_round_robin`.
+ :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: (optional) The floating IPs
+ associated with this network interface.
+ :attr str href: The URL for this network interface.
+ :attr str id: The unique identifier for this network interface.
+ :attr str name: The user-defined name for this network interface.
+ :attr int port_speed: The network interface port speed in Mbps.
+ :attr str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :attr 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,
- port: int,
- target: 'LoadBalancerPoolMemberTargetPrototype',
+ allow_ip_spoofing: bool,
+ created_at: datetime,
+ href: str,
+ id: str,
+ name: str,
+ port_speed: int,
+ primary_ipv4_address: str,
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
+ status: str,
+ subnet: 'SubnetReference',
+ type: str,
*,
- weight: int = None) -> None:
+ floating_ips: List['FloatingIPReference'] = None) -> None:
"""
- Initialize a LoadBalancerPoolMemberPrototype object.
+ Initialize a NetworkInterface object.
- :param int port: The port number of the application running in the server
- member.
- :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.
- :param int weight: (optional) Weight of the server member. Applicable only
- if the pool algorithm is
- `weighted_round_robin`.
+ :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 str href: The URL for this network interface.
+ :param str id: The unique identifier for this network interface.
+ :param str name: The user-defined name for this network interface.
+ :param int port_speed: The network interface port speed in Mbps.
+ :param str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :param 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 List[FloatingIPReference] floating_ips: (optional) The floating IPs
+ associated with this network interface.
"""
- self.port = port
- self.target = target
- self.weight = weight
+ 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_ipv4_address = primary_ipv4_address
+ 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) -> 'LoadBalancerPoolMemberPrototype':
- """Initialize a LoadBalancerPoolMemberPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterface':
+ """Initialize a NetworkInterface object from a json dictionary."""
args = {}
- if 'port' in _dict:
- args['port'] = _dict.get('port')
+ if 'allow_ip_spoofing' in _dict:
+ args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
else:
- raise ValueError('Required property \'port\' not present in LoadBalancerPoolMemberPrototype JSON')
- if 'target' in _dict:
- args['target'] = _dict.get('target')
+ 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 \'target\' not present in LoadBalancerPoolMemberPrototype JSON')
- if 'weight' in _dict:
- args['weight'] = _dict.get('weight')
+ raise ValueError('Required property \'created_at\' not present in NetworkInterface JSON')
+ if 'floating_ips' in _dict:
+ args['floating_ips'] = [FloatingIPReference.from_dict(x) for x in _dict.get('floating_ips')]
+ 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_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ else:
+ raise ValueError('Required property \'primary_ipv4_address\' 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(x) for x 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberPrototype 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, '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, 'created_at') and self.created_at is not None:
+ _dict['created_at'] = datetime_to_string(self.created_at)
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips]
+ if hasattr(self, 'href') 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_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ _dict['security_groups'] = [x.to_dict() for x in self.security_groups]
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -35452,68 +43793,128 @@ 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 NetworkInterface object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberPrototype') -> 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: 'LoadBalancerPoolMemberPrototype') -> bool:
+ def __ne__(self, other: 'NetworkInterface') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolMemberReference():
+ 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():
"""
- LoadBalancerPoolMemberReference.
+ NetworkInterfaceBareMetalServerContextReference.
- :attr LoadBalancerPoolMemberReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted and provides
+ :attr NetworkInterfaceBareMetalServerContextReferenceDeleted 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 href: The URL for this network interface.
+ :attr str id: The unique identifier for this network interface.
+ :attr str name: The user-defined name for this network interface.
+ :attr str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :attr str resource_type: The resource type.
+ :attr SubnetReference subnet: The associated subnet.
"""
def __init__(self,
href: str,
id: str,
+ name: str,
+ primary_ipv4_address: str,
+ resource_type: str,
+ subnet: 'SubnetReference',
*,
- deleted: 'LoadBalancerPoolMemberReferenceDeleted' = None) -> None:
+ deleted: 'NetworkInterfaceBareMetalServerContextReferenceDeleted' = None) -> None:
"""
- Initialize a LoadBalancerPoolMemberReference object.
+ Initialize a NetworkInterfaceBareMetalServerContextReference 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
+ :param str href: The URL for this network interface.
+ :param str id: The unique identifier for this network interface.
+ :param str name: The user-defined name for this network interface.
+ :param str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :param str resource_type: The resource type.
+ :param 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.deleted = deleted
self.href = href
self.id = id
+ self.name = name
+ self.primary_ipv4_address = primary_ipv4_address
+ self.resource_type = resource_type
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolMemberReference':
- """Initialize a LoadBalancerPoolMemberReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceBareMetalServerContextReference':
+ """Initialize a NetworkInterfaceBareMetalServerContextReference object from a json dictionary."""
args = {}
if 'deleted' in _dict:
- args['deleted'] = LoadBalancerPoolMemberReferenceDeleted.from_dict(_dict.get('deleted'))
+ args['deleted'] = NetworkInterfaceBareMetalServerContextReferenceDeleted.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')
+ raise ValueError('Required property \'href\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
if 'id' in _dict:
args['id'] = _dict.get('id')
else:
- raise ValueError('Required property \'id\' not present in LoadBalancerPoolMemberReference JSON')
+ raise ValueError('Required property \'id\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkInterfaceBareMetalServerContextReference JSON')
+ if 'primary_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ else:
+ raise ValueError('Required property \'primary_ipv4_address\' 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 LoadBalancerPoolMemberReference object from a json dictionary."""
+ """Initialize a NetworkInterfaceBareMetalServerContextReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -35525,6 +43926,14 @@ 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
+ if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -35532,20 +43941,27 @@ 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 NetworkInterfaceBareMetalServerContextReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberReference') -> 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: 'LoadBalancerPoolMemberReference') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceBareMetalServerContextReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolMemberReferenceDeleted():
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ NETWORK_INTERFACE = 'network_interface'
+
+
+class NetworkInterfaceBareMetalServerContextReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -35556,25 +43972,25 @@ class LoadBalancerPoolMemberReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a LoadBalancerPoolMemberReferenceDeleted object.
+ Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted 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) -> '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 LoadBalancerPoolMemberReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkInterfaceBareMetalServerContextReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolMemberReferenceDeleted object from a json dictionary."""
+ """Initialize a NetworkInterfaceBareMetalServerContextReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -35589,151 +44005,104 @@ 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 NetworkInterfaceBareMetalServerContextReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolMemberReferenceDeleted') -> 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: 'LoadBalancerPoolMemberReferenceDeleted') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceBareMetalServerContextReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolMemberTarget():
- """
- The pool member target. Load balancers in the `network` family support virtual server
- instances. Load balancers in the `application` family support IP addresses.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a LoadBalancerPoolMemberTarget object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerPoolMemberTargetInstanceReference', 'LoadBalancerPoolMemberTargetIP']))
- raise Exception(msg)
-
-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.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a LoadBalancerPoolMemberTargetPrototype object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['LoadBalancerPoolMemberTargetPrototypeInstanceIdentity', 'LoadBalancerPoolMemberTargetPrototypeIP']))
- raise Exception(msg)
-
-class LoadBalancerPoolPatch():
+class NetworkInterfaceCollection():
"""
- LoadBalancerPoolPatch.
+ NetworkInterfaceCollection.
- :attr str algorithm: (optional) The load balancing algorithm.
- :attr LoadBalancerPoolHealthMonitorPatch health_monitor: (optional) The health
- monitor of this pool.
- :attr str name: (optional) The user-defined name for this load balancer pool.
- :attr str protocol: (optional) The protocol used for this load balancer pool.
- The enumerated values for this property are expected to expand in the future.
- When processing this property, check for and log unknown values. Optionally halt
- processing and surface the error, or bypass the pool on which the unexpected
- property value was encountered.
- :attr str 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 NetworkInterfaceCollectionFirst first: A link to the first page of
+ resources.
+ :attr int limit: The maximum number of resources that can be returned by the
+ request.
+ :attr List[NetworkInterface] network_interfaces: Collection of network
+ interfaces.
+ :attr NetworkInterfaceCollectionNext next: (optional) A link to the next page of
+ resources. This property is present for all pages
+ except the last page.
+ :attr int total_count: The total number of resources across all pages.
"""
def __init__(self,
+ first: 'NetworkInterfaceCollectionFirst',
+ limit: int,
+ network_interfaces: List['NetworkInterface'],
+ total_count: int,
*,
- algorithm: str = None,
- health_monitor: 'LoadBalancerPoolHealthMonitorPatch' = None,
- name: str = None,
- protocol: str = None,
- proxy_protocol: str = None,
- session_persistence: 'LoadBalancerPoolSessionPersistencePatch' = None) -> None:
+ next: 'NetworkInterfaceCollectionNext' = None) -> None:
"""
- Initialize a LoadBalancerPoolPatch object.
+ Initialize a NetworkInterfaceCollection 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 user-defined name for this load balancer
- pool.
- :param str protocol: (optional) The protocol used for this load balancer
- pool.
- The enumerated values for this property are expected to expand in the
- future. When processing this property, check for and log unknown values.
- Optionally halt processing and surface the error, or bypass the pool on
- which the unexpected property value was encountered.
- :param str 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 NetworkInterfaceCollectionFirst first: A link to the first page of
+ resources.
+ :param int limit: The maximum number of resources that can be returned by
+ the request.
+ :param List[NetworkInterface] network_interfaces: Collection of network
+ interfaces.
+ :param int total_count: The total number of resources across all pages.
+ :param NetworkInterfaceCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
+ except the last page.
"""
- self.algorithm = algorithm
- self.health_monitor = health_monitor
- self.name = name
- self.protocol = protocol
- self.proxy_protocol = proxy_protocol
- self.session_persistence = session_persistence
+ 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) -> 'LoadBalancerPoolPatch':
- """Initialize a LoadBalancerPoolPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceCollection':
+ """Initialize a NetworkInterfaceCollection 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')
- 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'))
+ if 'first' in _dict:
+ args['first'] = NetworkInterfaceCollectionFirst.from_dict(_dict.get('first'))
+ else:
+ raise ValueError('Required property \'first\' not present in NetworkInterfaceCollection JSON')
+ if 'limit' in _dict:
+ args['limit'] = _dict.get('limit')
+ else:
+ raise ValueError('Required property \'limit\' not present in NetworkInterfaceCollection JSON')
+ if 'network_interfaces' in _dict:
+ args['network_interfaces'] = [NetworkInterface.from_dict(x) for x in _dict.get('network_interfaces')]
+ else:
+ raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceCollection JSON')
+ if 'next' in _dict:
+ args['next'] = NetworkInterfaceCollectionNext.from_dict(_dict.get('next'))
+ if 'total_count' in _dict:
+ args['total_count'] = _dict.get('total_count')
+ else:
+ raise ValueError('Required property \'total_count\' not present in NetworkInterfaceCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolPatch object from a json dictionary."""
+ """Initialize a NetworkInterfaceCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'algorithm') and self.algorithm is not None:
- _dict['algorithm'] = self.algorithm
- if hasattr(self, 'health_monitor') and self.health_monitor is not None:
- _dict['health_monitor'] = self.health_monitor.to_dict()
- if 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:
- _dict['session_persistence'] = self.session_persistence.to_dict()
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -35741,174 +44110,55 @@ 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 NetworkInterfaceCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolPatch') -> bool:
+ def __eq__(self, other: 'NetworkInterfaceCollection') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolPatch') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceCollection') -> 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.
- 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'
-
-
- 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 NetworkInterfaceCollectionFirst():
"""
- LoadBalancerPoolPrototype.
+ A link to the first page of resources.
- :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 user-defined name for this load balancer pool. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr str protocol: The protocol used for this load balancer pool. Load
- balancers in the `network` family support `tcp`. Load balancers in the
- `application` family support `tcp`, `http`, and
- `https`.
- :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 str href: The URL for a page of resources.
"""
- def __init__(self,
- algorithm: str,
- health_monitor: 'LoadBalancerPoolHealthMonitorPrototype',
- protocol: str,
- *,
- members: List['LoadBalancerPoolMemberPrototype'] = None,
- name: str = None,
- proxy_protocol: str = None,
- session_persistence: 'LoadBalancerPoolSessionPersistencePrototype' = None) -> None:
+ def __init__(self,
+ href: str) -> None:
"""
- Initialize a LoadBalancerPoolPrototype object.
+ Initialize a NetworkInterfaceCollectionFirst 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`. 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 user-defined name for this load balancer
- pool. 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 str href: The URL for a page of resources.
"""
- 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.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolPrototype':
- """Initialize a LoadBalancerPoolPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceCollectionFirst':
+ """Initialize a NetworkInterfaceCollectionFirst object from a json dictionary."""
args = {}
- if 'algorithm' in _dict:
- args['algorithm'] = _dict.get('algorithm')
- 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'))
- else:
- raise ValueError('Required property \'health_monitor\' not present in LoadBalancerPoolPrototype JSON')
- if 'members' in _dict:
- args['members'] = [LoadBalancerPoolMemberPrototype.from_dict(x) for x in _dict.get('members')]
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'protocol' in _dict:
- args['protocol'] = _dict.get('protocol')
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
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 \'href\' not present in NetworkInterfaceCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolPrototype object from a json dictionary."""
+ """Initialize a NetworkInterfaceCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'algorithm') and self.algorithm is not None:
- _dict['algorithm'] = self.algorithm
- if hasattr(self, 'health_monitor') and self.health_monitor is not None:
- _dict['health_monitor'] = self.health_monitor.to_dict()
- if hasattr(self, 'members') and self.members is not None:
- _dict['members'] = [x.to_dict() for x in self.members]
- 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:
- _dict['session_persistence'] = self.session_persistence.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -35916,111 +44166,160 @@ 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 NetworkInterfaceCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolPrototype') -> bool:
+ def __eq__(self, other: 'NetworkInterfaceCollectionFirst') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolPrototype') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceCollectionFirst') -> 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 NetworkInterfaceCollectionNext():
+ """
+ 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.
+ """
- class ProtocolEnum(str, Enum):
+ def __init__(self,
+ href: str) -> None:
"""
- The protocol used for this load balancer pool. Load balancers in the `network`
- family support `tcp`. Load balancers in the `application` family support `tcp`,
- `http`, and
- `https`.
+ Initialize a NetworkInterfaceCollectionNext object.
+
+ :param str href: The URL for a page of resources.
"""
- HTTP = 'http'
- HTTPS = 'https'
- TCP = 'tcp'
+ self.href = href
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceCollectionNext':
+ """Initialize a NetworkInterfaceCollectionNext object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in NetworkInterfaceCollectionNext JSON')
+ return cls(**args)
- 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'
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a NetworkInterfaceCollectionNext object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ return _dict
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
-class LoadBalancerPoolReference():
+ def __str__(self) -> str:
+ """Return a `str` version of this NetworkInterfaceCollectionNext object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'NetworkInterfaceCollectionNext') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'NetworkInterfaceCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class NetworkInterfaceInstanceContextReference():
"""
- LoadBalancerPoolReference.
+ NetworkInterfaceInstanceContextReference.
- :attr LoadBalancerPoolReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted and provides
+ :attr NetworkInterfaceInstanceContextReferenceDeleted 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 user-defined name for this load balancer pool.
+ :attr str href: The URL for this network interface.
+ :attr str id: The unique identifier for this network interface.
+ :attr str name: The user-defined name for this network interface.
+ :attr str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :attr str resource_type: The resource type.
+ :attr SubnetReference subnet: The associated subnet.
"""
def __init__(self,
href: str,
id: str,
name: str,
+ primary_ipv4_address: str,
+ resource_type: str,
+ subnet: 'SubnetReference',
*,
- deleted: 'LoadBalancerPoolReferenceDeleted' = None) -> None:
+ deleted: 'NetworkInterfaceInstanceContextReferenceDeleted' = None) -> None:
"""
- Initialize a LoadBalancerPoolReference object.
+ Initialize a NetworkInterfaceInstanceContextReference object.
- :param str href: The pool's canonical URL.
- :param str id: The unique identifier for this load balancer pool.
- :param str name: The user-defined name for this load balancer pool.
- :param LoadBalancerPoolReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted and
- provides
+ :param str href: The URL for this network interface.
+ :param str id: The unique identifier for this network interface.
+ :param str name: The user-defined name for this network interface.
+ :param str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :param str resource_type: The resource type.
+ :param 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.deleted = deleted
self.href = href
self.id = id
self.name = name
+ self.primary_ipv4_address = primary_ipv4_address
+ self.resource_type = resource_type
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReference':
- """Initialize a LoadBalancerPoolReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReference':
+ """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary."""
args = {}
if 'deleted' in _dict:
- args['deleted'] = LoadBalancerPoolReferenceDeleted.from_dict(_dict.get('deleted'))
+ 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 LoadBalancerPoolReference 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 LoadBalancerPoolReference JSON')
+ raise ValueError('Required property \'id\' not present in NetworkInterfaceInstanceContextReference 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 \'name\' not present in NetworkInterfaceInstanceContextReference JSON')
+ if 'primary_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ else:
+ raise ValueError('Required property \'primary_ipv4_address\' not present in NetworkInterfaceInstanceContextReference JSON')
+ if 'resource_type' in _dict:
+ args['resource_type'] = _dict.get('resource_type')
+ else:
+ 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 LoadBalancerPoolReference object from a json dictionary."""
+ """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -36034,6 +44333,12 @@ def to_dict(self) -> Dict:
_dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -36041,20 +44346,27 @@ 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 NetworkInterfaceInstanceContextReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolReference') -> 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: 'LoadBalancerPoolReference') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceInstanceContextReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolReferenceDeleted():
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ NETWORK_INTERFACE = 'network_interface'
+
+
+class NetworkInterfaceInstanceContextReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -36065,25 +44377,25 @@ class LoadBalancerPoolReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a LoadBalancerPoolReferenceDeleted object.
+ Initialize a NetworkInterfaceInstanceContextReferenceDeleted object.
:param str more_info: Link to documentation about deleted resources.
"""
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolReferenceDeleted':
- """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReferenceDeleted':
+ """Initialize a NetworkInterfaceInstanceContextReferenceDeleted 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 LoadBalancerPoolReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkInterfaceInstanceContextReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolReferenceDeleted object from a json dictionary."""
+ """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -36098,70 +44410,69 @@ 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 NetworkInterfaceInstanceContextReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolReferenceDeleted') -> 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: 'LoadBalancerPoolReferenceDeleted') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerPoolSessionPersistence():
+class NetworkInterfacePatch():
"""
- LoadBalancerPoolSessionPersistence.
+ NetworkInterfacePatch.
- :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 bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
+ allowed on this interface. If false, source IP spoofing is prevented on this
+ interface. If true, source IP spoofing is allowed on this interface.
+ :attr str name: (optional) The user-defined name for network interface. Names
+ must be unique within the instance the network interface resides in.
"""
def __init__(self,
- type: str,
*,
- cookie_name: str = None) -> None:
+ allow_ip_spoofing: bool = None,
+ name: str = None) -> None:
"""
- Initialize a LoadBalancerPoolSessionPersistence object.
+ Initialize a NetworkInterfacePatch 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 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 user-defined name for network interface.
+ Names must be unique within the instance the network interface resides in.
"""
- self.cookie_name = cookie_name
- self.type = type
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistence':
- """Initialize a LoadBalancerPoolSessionPersistence object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePatch':
+ """Initialize a NetworkInterfacePatch 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')
- else:
- raise ValueError('Required property \'type\' not present in LoadBalancerPoolSessionPersistence JSON')
+ 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 LoadBalancerPoolSessionPersistence 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, '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, '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):
@@ -36169,80 +44480,116 @@ 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 NetworkInterfacePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolSessionPersistence') -> 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: 'LoadBalancerPoolSessionPersistence') -> bool:
+ def __ne__(self, other: 'NetworkInterfacePatch') -> 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 LoadBalancerPoolSessionPersistencePatch():
+class NetworkInterfacePrototype():
"""
- The session persistence configuration. Specify `null` to remove any existing session
- persistence configuration.
+ NetworkInterfacePrototype.
- :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.
+ :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
+ allowed on this interface. If false, source IP spoofing is prevented on this
+ interface. If true, source IP spoofing is allowed on this interface.
+ :attr str name: (optional) The user-defined name for network interface. Names
+ must be unique within the instance the network interface resides in. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :attr str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's subnet. If
+ unspecified, an available address on the subnet will be automatically selected.
+ :attr 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.
"""
def __init__(self,
+ subnet: 'SubnetIdentity',
*,
- cookie_name: str = None,
- type: str = None) -> None:
+ allow_ip_spoofing: bool = None,
+ name: str = None,
+ primary_ipv4_address: str = None,
+ security_groups: List['SecurityGroupIdentity'] = None) -> None:
"""
- Initialize a LoadBalancerPoolSessionPersistencePatch object.
+ Initialize a NetworkInterfacePrototype 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.
+ :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 user-defined name for network interface.
+ Names must be unique within the instance the network interface resides in.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's
+ subnet. If unspecified, an available address on the subnet will be
+ automatically selected.
+ :param List[SecurityGroupIdentity] security_groups: (optional) The security
+ groups to use for this network interface. If unspecified, the VPC's default
+ security group is used.
"""
- self.cookie_name = cookie_name
- self.type = type
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.name = name
+ self.primary_ipv4_address = primary_ipv4_address
+ self.security_groups = security_groups
+ self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePatch':
- """Initialize a LoadBalancerPoolSessionPersistencePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePrototype':
+ """Initialize a NetworkInterfacePrototype 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 '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_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ 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 NetworkInterfacePrototype JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolSessionPersistencePatch 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, '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, '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_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for x in self.security_groups:
+ if isinstance(x, dict):
+ security_groups_list.append(x)
+ else:
+ security_groups_list.append(x.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -36250,80 +44597,111 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this LoadBalancerPoolSessionPersistencePatch object."""
+ """Return a `str` version of this NetworkInterfacePrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolSessionPersistencePatch') -> 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: 'LoadBalancerPoolSessionPersistencePatch') -> bool:
+ def __ne__(self, other: 'NetworkInterfacePrototype') -> 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 LoadBalancerPoolSessionPersistencePrototype():
+class NetworkInterfaceReference():
"""
- LoadBalancerPoolSessionPersistencePrototype.
+ NetworkInterfaceReference.
- :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 NetworkInterfaceReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ some supplementary information.
+ :attr str href: The URL for this network interface.
+ :attr str id: The unique identifier for this network interface.
+ :attr str name: The user-defined name for this network interface.
+ :attr str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :attr str resource_type: The resource type.
"""
def __init__(self,
- type: str,
+ href: str,
+ id: str,
+ name: str,
+ primary_ipv4_address: str,
+ resource_type: str,
*,
- cookie_name: str = None) -> None:
+ deleted: 'NetworkInterfaceReferenceDeleted' = None) -> None:
"""
- Initialize a LoadBalancerPoolSessionPersistencePrototype object.
+ Initialize a NetworkInterfaceReference 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 str href: The URL for this network interface.
+ :param str id: The unique identifier for this network interface.
+ :param str name: The user-defined name for this network interface.
+ :param str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :param str resource_type: The resource type.
+ :param NetworkInterfaceReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted and
+ provides
+ some supplementary information.
"""
- self.cookie_name = cookie_name
- self.type = type
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
+ self.primary_ipv4_address = primary_ipv4_address
+ self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerPoolSessionPersistencePrototype':
- """Initialize a LoadBalancerPoolSessionPersistencePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReference':
+ """Initialize a NetworkInterfaceReference 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 '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 LoadBalancerPoolSessionPersistencePrototype JSON')
+ raise ValueError('Required property \'href\' not present in NetworkInterfaceReference JSON')
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
+ else:
+ raise ValueError('Required property \'id\' not present in NetworkInterfaceReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ else:
+ raise ValueError('Required property \'name\' not present in NetworkInterfaceReference JSON')
+ if 'primary_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ else:
+ raise ValueError('Required property \'primary_ipv4_address\' not present in NetworkInterfaceReference JSON')
+ if 'resource_type' in _dict:
+ args['resource_type'] = _dict.get('resource_type')
+ else:
+ raise ValueError('Required property \'resource_type\' not present in NetworkInterfaceReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerPoolSessionPersistencePrototype object from a json dictionary."""
+ """Initialize a NetworkInterfaceReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -36331,125 +44709,63 @@ 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 NetworkInterfaceReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerPoolSessionPersistencePrototype') -> bool:
+ def __eq__(self, other: 'NetworkInterfaceReference') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'LoadBalancerPoolSessionPersistencePrototype') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceReference') -> 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 session persistence type. The `http_cookie` and `app_cookie` types are
- applicable only to the `http` and `https` protocols.
+ The resource type.
"""
- APP_COOKIE = 'app_cookie'
- HTTP_COOKIE = 'http_cookie'
- SOURCE_IP = 'source_ip'
+ NETWORK_INTERFACE = 'network_interface'
-class LoadBalancerProfile():
+class NetworkInterfaceReferenceDeleted():
"""
- LoadBalancerProfile.
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :attr str family: The product family this load balancer profile belongs to.
- :attr str href: The URL for this load balancer profile.
- :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 str more_info: Link to documentation about deleted resources.
"""
def __init__(self,
- family: str,
- href: str,
- logging_supported: 'LoadBalancerProfileLoggingSupported',
- name: str,
- route_mode_supported: 'LoadBalancerProfileRouteModeSupported',
- security_groups_supported: 'LoadBalancerProfileSecurityGroupsSupported') -> None:
+ more_info: str) -> None:
"""
- Initialize a LoadBalancerProfile object.
+ Initialize a NetworkInterfaceReferenceDeleted object.
- :param str family: The product family this load balancer profile belongs
- to.
- :param str href: The URL for this load balancer profile.
- :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 str more_info: Link to documentation about deleted resources.
"""
- self.family = family
- self.href = href
- self.logging_supported = logging_supported
- self.name = name
- self.route_mode_supported = route_mode_supported
- self.security_groups_supported = security_groups_supported
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfile':
- """Initialize a LoadBalancerProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReferenceDeleted':
+ """Initialize a NetworkInterfaceReferenceDeleted 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 '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')
+ if 'more_info' in _dict:
+ args['more_info'] = _dict.get('more_info')
else:
- raise ValueError('Required property \'security_groups_supported\' not present in LoadBalancerProfile JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfile 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, '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, 'logging_supported') and self.logging_supported is not None:
- _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, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -36457,103 +44773,56 @@ 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 NetworkInterfaceReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfile') -> 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: 'LoadBalancerProfile') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerProfileCollection():
+class NetworkInterfaceReferenceTargetContextDeleted():
"""
- LoadBalancerProfileCollection.
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :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 more_info: Link to documentation about deleted resources.
"""
def __init__(self,
- first: 'LoadBalancerProfileCollectionFirst',
- limit: int,
- profiles: List['LoadBalancerProfile'],
- total_count: int,
- *,
- next: 'LoadBalancerProfileCollectionNext' = None) -> None:
+ more_info: str) -> None:
"""
- Initialize a LoadBalancerProfileCollection object.
+ Initialize a NetworkInterfaceReferenceTargetContextDeleted 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 more_info: Link to documentation about deleted resources.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.profiles = profiles
- self.total_count = total_count
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollection':
- """Initialize a LoadBalancerProfileCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReferenceTargetContextDeleted':
+ """Initialize a NetworkInterfaceReferenceTargetContextDeleted 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(x) for x 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')
+ if 'more_info' in _dict:
+ args['more_info'] = _dict.get('more_info')
else:
- raise ValueError('Required property \'total_count\' not present in LoadBalancerProfileCollection JSON')
+ raise ValueError('Required property \'more_info\' not present in NetworkInterfaceReferenceTargetContextDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileCollection object from a json dictionary."""
+ """Initialize a NetworkInterfaceReferenceTargetContextDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'profiles') and self.profiles is not None:
- _dict['profiles'] = [x.to_dict() for x in self.profiles]
- 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):
@@ -36561,55 +44830,57 @@ 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 NetworkInterfaceReferenceTargetContextDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileCollection') -> 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: 'LoadBalancerProfileCollection') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceReferenceTargetContextDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerProfileCollectionFirst():
+class NetworkInterfaceUnpaginatedCollection():
"""
- A link to the first page of resources.
+ NetworkInterfaceUnpaginatedCollection.
- :attr str href: The URL for a page of resources.
+ :attr List[NetworkInterface] network_interfaces: Collection of network
+ interfaces.
"""
def __init__(self,
- href: str) -> None:
+ network_interfaces: List['NetworkInterface']) -> None:
"""
- Initialize a LoadBalancerProfileCollectionFirst object.
+ Initialize a NetworkInterfaceUnpaginatedCollection object.
- :param str href: The URL for a page of resources.
+ :param List[NetworkInterface] network_interfaces: Collection of network
+ interfaces.
"""
- self.href = href
+ self.network_interfaces = network_interfaces
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionFirst':
- """Initialize a LoadBalancerProfileCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceUnpaginatedCollection':
+ """Initialize a NetworkInterfaceUnpaginatedCollection object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if 'network_interfaces' in _dict:
+ args['network_interfaces'] = [NetworkInterface.from_dict(x) for x in _dict.get('network_interfaces')]
else:
- raise ValueError('Required property \'href\' not present in LoadBalancerProfileCollectionFirst JSON')
+ raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceUnpaginatedCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileCollectionFirst object from a json dictionary."""
+ """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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'network_interfaces') and self.network_interfaces is not None:
+ _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
return _dict
def _to_dict(self):
@@ -36617,56 +44888,131 @@ 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 NetworkInterfaceUnpaginatedCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileCollectionFirst') -> bool:
+ 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__
- def __ne__(self, other: 'LoadBalancerProfileCollectionFirst') -> bool:
+ def __ne__(self, other: 'NetworkInterfaceUnpaginatedCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerProfileCollectionNext():
+class OperatingSystem():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ OperatingSystem.
- :attr str href: The URL for a page of resources.
+ :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 name of the software family this operating system belongs
+ to.
+ :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,
- href: str) -> None:
+ architecture: str,
+ dedicated_host_only: bool,
+ display_name: str,
+ family: str,
+ href: str,
+ name: str,
+ vendor: str,
+ version: str) -> None:
"""
- Initialize a LoadBalancerProfileCollectionNext object.
+ Initialize a OperatingSystem object.
- :param str href: The URL for a page of resources.
+ :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 name of the software family this operating system
+ belongs to.
+ :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
+ self.name = name
+ self.vendor = vendor
+ self.version = version
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileCollectionNext':
- """Initialize a LoadBalancerProfileCollectionNext object from a json dictionary."""
+ 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 LoadBalancerProfileCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in OperatingSystem JSON')
+ 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileCollectionNext 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, '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
return _dict
def _to_dict(self):
@@ -36674,82 +45020,93 @@ 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 OperatingSystem object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileCollectionNext') -> 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: 'LoadBalancerProfileCollectionNext') -> bool:
+ def __ne__(self, other: 'OperatingSystem') -> 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:
- """
- 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 LoadBalancerProfileLoggingSupported():
+class OperatingSystemCollection():
"""
- Indicates which logging type(s) are supported for a load balancer with this profile.
+ OperatingSystemCollection.
- :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 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.
"""
def __init__(self,
- type: str,
- value: List[str]) -> None:
+ first: 'OperatingSystemCollectionFirst',
+ limit: int,
+ operating_systems: List['OperatingSystem'],
+ *,
+ next: 'OperatingSystemCollectionNext' = None) -> None:
"""
- Initialize a LoadBalancerProfileLoggingSupported object.
+ Initialize a OperatingSystemCollection 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 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 OperatingSystemCollectionNext 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.operating_systems = operating_systems
@classmethod
- def from_dict(cls, _dict: Dict) -> 'LoadBalancerProfileLoggingSupported':
- """Initialize a LoadBalancerProfileLoggingSupported object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollection':
+ """Initialize a OperatingSystemCollection object from a json dictionary."""
args = {}
- if 'type' in _dict:
- args['type'] = _dict.get('type')
+ if 'first' in _dict:
+ args['first'] = OperatingSystemCollectionFirst.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 OperatingSystemCollection 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 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(x) for x in _dict.get('operating_systems')]
+ else:
+ raise ValueError('Required property \'operating_systems\' not present in OperatingSystemCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileLoggingSupported 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, '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:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'operating_systems') and self.operating_systems is not None:
+ _dict['operating_systems'] = [x.to_dict() for x in self.operating_systems]
return _dict
def _to_dict(self):
@@ -36757,83 +45114,55 @@ 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 OperatingSystemCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileLoggingSupported') -> 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: 'LoadBalancerProfileLoggingSupported') -> bool:
+ def __ne__(self, other: 'OperatingSystemCollection') -> 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 OperatingSystemCollectionFirst():
"""
- 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.
-
- :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.
+ href: str) -> None:
+ """
+ Initialize a OperatingSystemCollectionFirst object.
+
+ :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) -> 'OperatingSystemCollectionFirst':
+ """Initialize a OperatingSystemCollectionFirst 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 OperatingSystemCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerProfileReference 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, '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):
@@ -36841,86 +45170,56 @@ 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 OperatingSystemCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerProfileReference') -> 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: 'LoadBalancerProfileReference') -> bool:
+ def __ne__(self, other: 'OperatingSystemCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerProfileRouteModeSupported():
- """
- LoadBalancerProfileRouteModeSupported.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a LoadBalancerProfileRouteModeSupported object.
-
- """
- 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 LoadBalancerReferenceDeleted():
+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) -> None:
+ href: str) -> None:
"""
- Initialize a LoadBalancerReferenceDeleted 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) -> 'LoadBalancerReferenceDeleted':
- """Initialize a LoadBalancerReferenceDeleted 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 LoadBalancerReferenceDeleted JSON')
+ raise ValueError('Required property \'href\' not present in OperatingSystemCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerReferenceDeleted 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):
@@ -36928,91 +45227,80 @@ 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 OperatingSystemCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerReferenceDeleted') -> 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: 'LoadBalancerReferenceDeleted') -> bool:
+ def __ne__(self, other: 'OperatingSystemCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class LoadBalancerStatistics():
+class OperatingSystemIdentity():
"""
- LoadBalancerStatistics.
+ Identifies an operating system 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) -> 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 OperatingSystemReference():
+ """
+ OperatingSystemReference.
+
+ :attr str href: The URL for this operating system.
+ :attr str name: The globally unique name for this operating system.
"""
def __init__(self,
- active_connections: int,
- connection_rate: float,
- data_processed_this_month: int,
- throughput: float) -> None:
+ href: str,
+ name: str) -> None:
"""
- Initialize a LoadBalancerStatistics object.
+ Initialize a OperatingSystemReference 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.
+ :param str href: The URL for this operating system.
+ :param str name: The globally unique name for this operating system.
"""
- self.active_connections = active_connections
- self.connection_rate = connection_rate
- self.data_processed_this_month = data_processed_this_month
- self.throughput = throughput
+ self.href = href
+ 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) -> 'OperatingSystemReference':
+ """Initialize a OperatingSystemReference 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')
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'data_processed_this_month\' not present in LoadBalancerStatistics JSON')
- if 'throughput' in _dict:
- args['throughput'] = _dict.get('throughput')
+ raise ValueError('Required property \'href\' not present in OperatingSystemReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
else:
- raise ValueError('Required property \'throughput\' not present in LoadBalancerStatistics JSON')
+ raise ValueError('Required property \'name\' not present in OperatingSystemReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a LoadBalancerStatistics object from a json dictionary."""
+ """Initialize a OperatingSystemReference object from 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, '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):
@@ -37020,35 +45308,40 @@ 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 OperatingSystemReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'LoadBalancerStatistics') -> bool:
+ def __eq__(self, other: 'OperatingSystemReference') -> bool:
"""Return `true` when 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: 'OperatingSystemReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACL():
+class PlacementGroup():
"""
- NetworkACL.
+ PlacementGroup.
- :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 user-defined name for this network ACL.
- :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 is a part of.
+ :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 user-defined name for this placement group.
+ :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,
@@ -37056,83 +45349,87 @@ def __init__(self,
crn: str,
href: str,
id: str,
+ lifecycle_state: str,
name: str,
resource_group: 'ResourceGroupReference',
- rules: List['NetworkACLRuleItem'],
- subnets: List['SubnetReference'],
- vpc: 'VPCReference') -> None:
+ resource_type: str,
+ strategy: str) -> None:
"""
- Initialize a NetworkACL object.
+ Initialize a PlacementGroup object.
- :param datetime created_at: The date and time that the network ACL was
+ :param datetime created_at: The date and time that the placement group 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 user-defined name for this network ACL.
+ :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 user-defined name for this placement group.
: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 is a part of.
+ 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.rules = rules
- self.subnets = subnets
- self.vpc = vpc
+ self.resource_type = resource_type
+ self.strategy = strategy
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACL':
- """Initialize a NetworkACL object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroup':
+ """Initialize a PlacementGroup 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')
+ 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 NetworkACL JSON')
+ 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 NetworkACL JSON')
+ 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 NetworkACL JSON')
+ 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 NetworkACL JSON')
+ 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 NetworkACL JSON')
- if 'rules' in _dict:
- args['rules'] = [NetworkACLRuleItem.from_dict(x) for x in _dict.get('rules')]
- else:
- raise ValueError('Required property \'rules\' not present in NetworkACL JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
+ 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 \'subnets\' not present in NetworkACL JSON')
- if 'vpc' in _dict:
- args['vpc'] = VPCReference.from_dict(_dict.get('vpc'))
+ 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 \'vpc\' not present in NetworkACL JSON')
+ raise ValueError('Required property \'strategy\' not present in PlacementGroup JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACL object from a json dictionary."""
+ """Initialize a PlacementGroup object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -37146,16 +45443,16 @@ def to_dict(self) -> Dict:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'lifecycle_state') and self.lifecycle_state is not None:
+ _dict['lifecycle_state'] = self.lifecycle_state
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
if hasattr(self, 'resource_group') and self.resource_group is not None:
_dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- _dict['rules'] = [x.to_dict() for x in self.rules]
- if hasattr(self, 'subnets') and self.subnets is not None:
- _dict['subnets'] = [x.to_dict() for x in self.subnets]
- if hasattr(self, 'vpc') and self.vpc is not None:
- _dict['vpc'] = self.vpc.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):
@@ -37163,86 +45460,122 @@ 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 PlacementGroup object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACL') -> 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: 'NetworkACL') -> bool:
+ def __ne__(self, other: 'PlacementGroup') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLCollection():
+ class LifecycleStateEnum(str, Enum):
+ """
+ The lifecycle state of the placement group.
+ """
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+ STABLE = 'stable'
+ SUSPENDED = 'suspended'
+ UPDATING = 'updating'
+ WAITING = 'waiting'
+
+
+ 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'
+
+
+class PlacementGroupCollection():
"""
- NetworkACLCollection.
+ PlacementGroupCollection.
- :attr NetworkACLCollectionFirst first: A link to the first page of resources.
+ :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 List[NetworkACL] network_acls: Collection of network ACLs.
- :attr NetworkACLCollectionNext next: (optional) A link to the next page of
+ :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,
- first: 'NetworkACLCollectionFirst',
+ first: 'PlacementGroupCollectionFirst',
limit: int,
- network_acls: List['NetworkACL'],
+ placement_groups: List['PlacementGroup'],
total_count: int,
*,
- next: 'NetworkACLCollectionNext' = None) -> None:
+ next: 'PlacementGroupCollectionNext' = None) -> None:
"""
- Initialize a NetworkACLCollection object.
+ Initialize a PlacementGroupCollection object.
- :param NetworkACLCollectionFirst first: A link to the first page of
+ :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[NetworkACL] network_acls: Collection of network ACLs.
+ :param List[PlacementGroup] placement_groups: Collection of placement
+ groups.
:param int total_count: The total number of resources across all pages.
- :param NetworkACLCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
+ :param PlacementGroupCollectionNext next: (optional) A link to the next
+ page of resources. This property is present for all pages
except the last page.
"""
self.first = first
self.limit = limit
- self.network_acls = network_acls
self.next = next
+ self.placement_groups = placement_groups
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLCollection':
- """Initialize a NetworkACLCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollection':
+ """Initialize a PlacementGroupCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = NetworkACLCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = PlacementGroupCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in NetworkACLCollection 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 NetworkACLCollection JSON')
- if 'network_acls' in _dict:
- args['network_acls'] = [NetworkACL.from_dict(x) for x in _dict.get('network_acls')]
- else:
- raise ValueError('Required property \'network_acls\' not present in NetworkACLCollection JSON')
+ raise ValueError('Required property \'limit\' not present in PlacementGroupCollection JSON')
if 'next' in _dict:
- args['next'] = NetworkACLCollectionNext.from_dict(_dict.get('next'))
+ args['next'] = PlacementGroupCollectionNext.from_dict(_dict.get('next'))
+ if 'placement_groups' in _dict:
+ args['placement_groups'] = [PlacementGroup.from_dict(x) for x in _dict.get('placement_groups')]
+ 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 NetworkACLCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in PlacementGroupCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLCollection object from a json dictionary."""
+ """Initialize a PlacementGroupCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -37252,10 +45585,10 @@ 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_acls') and self.network_acls is not None:
- _dict['network_acls'] = [x.to_dict() for x in self.network_acls]
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
+ if hasattr(self, 'placement_groups') and self.placement_groups is not None:
+ _dict['placement_groups'] = [x.to_dict() for x in self.placement_groups]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -37265,20 +45598,20 @@ 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 PlacementGroupCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLCollection') -> 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: 'NetworkACLCollection') -> bool:
+ def __ne__(self, other: 'PlacementGroupCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLCollectionFirst():
+class PlacementGroupCollectionFirst():
"""
A link to the first page of resources.
@@ -37288,82 +45621,25 @@ class NetworkACLCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a NetworkACLCollectionFirst object.
-
- :param str href: The URL for a page of resources.
- """
- self.href = href
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionFirst':
- """Initialize a NetworkACLCollectionFirst object from a json dictionary."""
- args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in NetworkACLCollectionFirst JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a NetworkACLCollectionFirst object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this NetworkACLCollectionFirst object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'NetworkACLCollectionFirst') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'NetworkACLCollectionFirst') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class NetworkACLCollectionNext():
- """
- A link to the next page of resources. This property is present for all pages except
- the last page.
-
- :attr str href: The URL for a page of resources.
- """
-
- def __init__(self,
- href: str) -> None:
- """
- Initialize a NetworkACLCollectionNext object.
+ Initialize a PlacementGroupCollectionFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLCollectionNext':
- """Initialize a NetworkACLCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollectionFirst':
+ """Initialize a PlacementGroupCollectionFirst 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')
+ raise ValueError('Required property \'href\' not present in PlacementGroupCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLCollectionNext object from a json dictionary."""
+ """Initialize a PlacementGroupCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -37378,71 +45654,56 @@ 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 PlacementGroupCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLCollectionNext') -> 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: 'NetworkACLCollectionNext') -> bool:
+ def __ne__(self, other: 'PlacementGroupCollectionFirst') -> 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.
-
- """
-
- def __init__(self) -> 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():
+class PlacementGroupCollectionNext():
"""
- NetworkACLPatch.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :attr str name: (optional) The user-defined name for this network ACL. Names
- must be unique within the VPC the network ACL resides in.
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- *,
- name: str = None) -> None:
+ href: str) -> None:
"""
- Initialize a NetworkACLPatch object.
+ Initialize a PlacementGroupCollectionNext object.
- :param str name: (optional) The user-defined name for this network ACL.
- Names must be unique within the VPC the network ACL resides in.
+ :param str href: The URL for a page of resources.
"""
- self.name = name
+ self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLPatch':
- """Initialize a NetworkACLPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroupCollectionNext':
+ """Initialize a PlacementGroupCollectionNext 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 PlacementGroupCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLPatch 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, '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):
@@ -37450,130 +45711,52 @@ 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 PlacementGroupCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLPatch') -> 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: 'NetworkACLPatch') -> bool:
+ def __ne__(self, other: 'PlacementGroupCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLPrototype():
- """
- NetworkACLPrototype.
-
- :attr str name: (optional) The user-defined name for this network ACL. Names
- must be unique within the VPC the network ACL resides in. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :attr ResourceGroupIdentity resource_group: (optional) The resource group to
- use. If unspecified, the account's [default resource
- group](https://cloud.ibm.com/apidocs/resource-manager#introduction) is used.
- :attr VPCIdentity vpc: The VPC this network ACL is to be a part of.
- """
-
- 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 is to be a part of.
- :param str name: (optional) The user-defined name for this network ACL.
- Names must be unique within the VPC the network ACL resides in. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :param 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 PlacementGroupPatch():
"""
- NetworkACLReference.
+ PlacementGroupPatch.
- :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 user-defined name for this network ACL.
+ :attr str name: (optional) The user-defined name for this placement group.
"""
def __init__(self,
- crn: str,
- href: str,
- id: str,
- name: str,
*,
- deleted: 'NetworkACLReferenceDeleted' = None) -> None:
+ name: str = None) -> None:
"""
- Initialize a NetworkACLReference object.
+ Initialize a PlacementGroupPatch 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 user-defined name for this network ACL.
- :param NetworkACLReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted and provides
- some supplementary information.
+ :param str name: (optional) The user-defined name for this placement group.
"""
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLReference':
- """Initialize a NetworkACLReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroupPatch':
+ """Initialize a PlacementGroupPatch 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'] = NetworkACLReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- 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 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 NetworkACLReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
return _dict
@@ -37583,20 +45766,20 @@ 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 PlacementGroupPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLReference') -> 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: 'NetworkACLReference') -> bool:
+ def __ne__(self, other: 'PlacementGroupPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLReferenceDeleted():
+class PlacementGroupReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -37607,25 +45790,25 @@ class NetworkACLReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a NetworkACLReferenceDeleted object.
+ Initialize a PlacementGroupReferenceDeleted object.
:param str more_info: Link to documentation about deleted resources.
"""
self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkACLReferenceDeleted':
- """Initialize a NetworkACLReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PlacementGroupReferenceDeleted':
+ """Initialize a PlacementGroupReferenceDeleted 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 NetworkACLReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in PlacementGroupReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLReferenceDeleted object from a json dictionary."""
+ """Initialize a PlacementGroupReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -37640,240 +45823,265 @@ 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 PlacementGroupReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLReferenceDeleted') -> 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: 'NetworkACLReferenceDeleted') -> bool:
+ def __ne__(self, other: 'PlacementGroupReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLRule():
+class PublicGateway():
"""
- NetworkACLRule.
+ PublicGateway.
- :attr str action: Whether to allow or deny matching traffic.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0`
- applies to all addresses.
- :attr str direction: Whether the traffic to be matched is `inbound` or
- `outbound`.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The user-defined name for this rule. Names must be unique within
- the network ACL the rule resides in. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str protocol: The protocol to enforce.
- :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to
- all addresses.
+ :attr 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 user-defined name for this public gateway.
+ :attr ResourceGroupReference resource_group: The resource group for this public
+ gateway.
+ :attr str resource_type: The resource type.
+ :attr str status: The status of the volume.
+ :attr VPCReference vpc: The VPC this public gateway serves.
+ :attr ZoneReference zone: The zone this public gateway resides in.
"""
def __init__(self,
- action: str,
created_at: datetime,
- destination: str,
- direction: str,
+ crn: str,
+ floating_ip: 'PublicGatewayFloatingIp',
href: str,
id: str,
- ip_version: str,
name: str,
- protocol: str,
- source: str,
- *,
- before: 'NetworkACLRuleReference' = None) -> None:
+ resource_group: 'ResourceGroupReference',
+ resource_type: str,
+ status: str,
+ vpc: 'VPCReference',
+ zone: 'ZoneReference') -> None:
"""
- Initialize a NetworkACLRule object.
+ Initialize a PublicGateway object.
- :param str action: Whether to allow or deny matching traffic.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination CIDR block. The CIDR block
- `0.0.0.0/0` applies to all addresses.
- :param str direction: Whether the traffic to be matched is `inbound` or
- `outbound`.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The user-defined name for this rule. Names must be unique
- within the network ACL the rule resides in. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :param str protocol: The protocol to enforce.
- :param str source: The source CIDR block. The CIDR block `0.0.0.0/0`
- applies to all addresses.
- :param NetworkACLRuleReference before: (optional) The rule that this rule
- is immediately before. If absent, this is the last rule.
+ :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 user-defined name for this public gateway.
+ :param ResourceGroupReference resource_group: The resource group for this
+ public gateway.
+ :param str resource_type: The resource type.
+ :param str status: The status of the volume.
+ :param VPCReference vpc: The VPC this public gateway serves.
+ :param ZoneReference zone: The zone this public gateway resides in.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRuleNetworkACLRuleProtocolTCPUDP', 'NetworkACLRuleNetworkACLRuleProtocolICMP', 'NetworkACLRuleNetworkACLRuleProtocolAll']))
- raise Exception(msg)
+ 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) -> '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) -> '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 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: Dict):
- """Initialize a NetworkACLRule object from a json dictionary."""
+ def _from_dict(cls, _dict):
+ """Initialize a PublicGateway 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, '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:
+ _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:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ _dict['vpc'] = self.vpc.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ _dict['zone'] = self.zone.to_dict()
+ return _dict
- class ActionEnum(str, Enum):
- """
- Whether to allow or deny matching traffic.
- """
- ALLOW = 'allow'
- DENY = 'deny'
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+ def __str__(self) -> str:
+ """Return a `str` version of this PublicGateway object."""
+ return json.dumps(self.to_dict(), indent=2)
- class DirectionEnum(str, Enum):
- """
- Whether the traffic to be matched is `inbound` or `outbound`.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
+ 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: 'PublicGateway') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
- class IpVersionEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The IP version for this rule.
+ The resource type.
"""
- IPV4 = 'ipv4'
- IPV6 = 'ipv6'
-
-
-class NetworkACLRuleBeforePatch():
- """
- The rule to move this rule immediately before. Specify `null` to move this rule after
- all existing rules.
-
- """
+ PUBLIC_GATEWAY = 'public_gateway'
- def __init__(self) -> None:
- """
- Initialize a NetworkACLRuleBeforePatch object.
+ class StatusEnum(str, Enum):
"""
- 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 omitted, this rule will be
- inserted after all existing rules.
-
- """
-
- def __init__(self) -> None:
+ The status of the volume.
"""
- Initialize a NetworkACLRuleBeforePrototype object.
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById', 'NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityByHref']))
- raise Exception(msg)
-class NetworkACLRuleCollection():
+class PublicGatewayCollection():
"""
- NetworkACLRuleCollection.
+ PublicGatewayCollection.
- :attr NetworkACLRuleCollectionFirst first: A link to the first page of
- resources.
+ :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 NetworkACLRuleCollectionNext next: (optional) A link to the next page of
+ :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[NetworkACLRuleItem] rules: Ordered collection of network ACL rules.
+ :attr List[PublicGateway] public_gateways: Collection of public gateways.
:attr int total_count: The total number of resources across all pages.
"""
def __init__(self,
- first: 'NetworkACLRuleCollectionFirst',
+ first: 'PublicGatewayCollectionFirst',
limit: int,
- rules: List['NetworkACLRuleItem'],
+ public_gateways: List['PublicGateway'],
total_count: int,
*,
- next: 'NetworkACLRuleCollectionNext' = None) -> None:
+ next: 'PublicGatewayCollectionNext' = None) -> None:
"""
- Initialize a NetworkACLRuleCollection object.
+ Initialize a PublicGatewayCollection object.
- :param NetworkACLRuleCollectionFirst first: A link to the first page of
+ :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[NetworkACLRuleItem] rules: Ordered collection of network ACL
- rules.
+ :param List[PublicGateway] public_gateways: Collection of public gateways.
: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 PublicGatewayCollectionNext 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.rules = rules
+ self.public_gateways = public_gateways
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) -> 'PublicGatewayCollection':
+ """Initialize a PublicGatewayCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = NetworkACLRuleCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = PublicGatewayCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in NetworkACLRuleCollection JSON')
+ raise ValueError('Required property \'first\' not present in PublicGatewayCollection 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 PublicGatewayCollection JSON')
if 'next' in _dict:
- args['next'] = NetworkACLRuleCollectionNext.from_dict(_dict.get('next'))
- if 'rules' in _dict:
- args['rules'] = [NetworkACLRuleItem.from_dict(x) for x in _dict.get('rules')]
+ args['next'] = PublicGatewayCollectionNext.from_dict(_dict.get('next'))
+ if 'public_gateways' in _dict:
+ args['public_gateways'] = [PublicGateway.from_dict(x) for x in _dict.get('public_gateways')]
else:
- raise ValueError('Required property \'rules\' not present in NetworkACLRuleCollection JSON')
+ 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 NetworkACLRuleCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in PublicGatewayCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleCollection object from a json dictionary."""
+ """Initialize a PublicGatewayCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -37885,8 +46093,8 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- _dict['rules'] = [x.to_dict() for x in self.rules]
+ if hasattr(self, 'public_gateways') and self.public_gateways is not None:
+ _dict['public_gateways'] = [x.to_dict() for x in self.public_gateways]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -37896,20 +46104,20 @@ 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 PublicGatewayCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleCollection') -> 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: 'NetworkACLRuleCollection') -> bool:
+ def __ne__(self, other: 'PublicGatewayCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLRuleCollectionFirst():
+class PublicGatewayCollectionFirst():
"""
A link to the first page of resources.
@@ -37919,25 +46127,25 @@ class NetworkACLRuleCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a NetworkACLRuleCollectionFirst object.
+ Initialize a PublicGatewayCollectionFirst 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) -> 'PublicGatewayCollectionFirst':
+ """Initialize a PublicGatewayCollectionFirst 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 PublicGatewayCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleCollectionFirst object from a json dictionary."""
+ """Initialize a PublicGatewayCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -37952,20 +46160,20 @@ 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 PublicGatewayCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleCollectionFirst') -> 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: 'NetworkACLRuleCollectionFirst') -> bool:
+ def __ne__(self, other: 'PublicGatewayCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLRuleCollectionNext():
+class PublicGatewayCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -37976,25 +46184,25 @@ class NetworkACLRuleCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a NetworkACLRuleCollectionNext object.
+ Initialize a PublicGatewayCollectionNext 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) -> '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 NetworkACLRuleCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in PublicGatewayCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleCollectionNext object from a json dictionary."""
+ """Initialize a PublicGatewayCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -38009,288 +46217,123 @@ 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 PublicGatewayCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleCollectionNext') -> bool:
+ def __eq__(self, other: 'PublicGatewayCollectionNext') -> bool:
"""Return `true` when self and other are equal, false otherwise."""
if not isinstance(other, self.__class__):
return False
return self.__dict__ == other.__dict__
- def __ne__(self, other: 'NetworkACLRuleCollectionNext') -> bool:
+ def __ne__(self, other: 'PublicGatewayCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLRuleItem():
+class PublicGatewayFloatingIPPrototype():
"""
- NetworkACLRuleItem.
+ PublicGatewayFloatingIPPrototype.
- :attr str action: Whether to allow or deny matching traffic.
- :attr NetworkACLRuleReference before: (optional) The rule that this rule is
- immediately before. In a rule collection, this always
- refers to the next item in the collection. If absent, this is the last rule.
- :attr datetime created_at: The date and time that the rule was created.
- :attr str destination: The destination CIDR block. The CIDR block `0.0.0.0/0`
- applies to all addresses.
- :attr str direction: Whether the traffic to be matched is `inbound` or
- `outbound`.
- :attr str href: The URL for this network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str ip_version: The IP version for this rule.
- :attr str name: The user-defined name for this rule. Names must be unique within
- the network ACL the rule resides in. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr str protocol: The protocol to enforce.
- :attr str source: The source CIDR block. The CIDR block `0.0.0.0/0` applies to
- all 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:
+ def __init__(self) -> None:
"""
- Initialize a NetworkACLRuleItem object.
+ Initialize a PublicGatewayFloatingIPPrototype object.
- :param str action: Whether to allow or deny matching traffic.
- :param datetime created_at: The date and time that the rule was created.
- :param str destination: The destination CIDR block. The CIDR block
- `0.0.0.0/0` applies to all addresses.
- :param str direction: Whether the traffic to be matched is `inbound` or
- `outbound`.
- :param str href: The URL for this network ACL rule.
- :param str id: The unique identifier for this network ACL rule.
- :param str ip_version: The IP version for this rule.
- :param str name: The user-defined name for this rule. Names must be unique
- within the network ACL the rule resides in. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :param str protocol: The protocol to enforce.
- :param str source: The source CIDR block. The CIDR block `0.0.0.0/0`
- applies to all addresses.
- :param 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.
"""
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) -> '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']))
+ ", ".join(['PublicGatewayFloatingIPPrototypeFloatingIPIdentity', 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext']))
raise Exception(msg)
- @classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a NetworkACLRuleItem 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):
- """
- Whether to allow or deny matching traffic.
- """
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- Whether the traffic to be matched is `inbound` or `outbound`.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
- """
- The IP version for this rule.
- """
- IPV4 = 'ipv4'
- IPV6 = 'ipv6'
-
-
-class NetworkACLRulePatch():
+class PublicGatewayFloatingIp():
"""
- NetworkACLRulePatch.
+ The floating IP bound to this public gateway.
- :attr str action: (optional) Whether to allow or deny matching traffic.
- :attr NetworkACLRuleBeforePatch before: (optional) The rule to move this rule
- immediately before. Specify `null` to move this rule after
- all existing rules.
- :attr int code: (optional) The ICMP traffic code to allow.
- :attr str destination: (optional) The destination IP address or CIDR block. The
- CIDR block `0.0.0.0/0` applies to all addresses.
- :attr int destination_port_max: (optional) The inclusive upper bound of TCP/UDP
- destination port range.
- :attr int destination_port_min: (optional) The inclusive lower bound of TCP/UDP
- destination port range.
- :attr str direction: (optional) Whether the traffic to be matched is `inbound`
- or `outbound`.
- :attr str name: (optional) The user-defined name for this rule. Names must be
- unique within the network ACL the rule resides in.
- :attr str source: (optional) The source IP address or CIDR block. The CIDR
- block `0.0.0.0/0` applies to all addresses.
- :attr int source_port_max: (optional) The inclusive upper bound of TCP/UDP
- source port range.
- :attr int source_port_min: (optional) The inclusive lower bound of TCP/UDP
- source port range.
- :attr int type: (optional) The ICMP traffic type to allow.
+ :attr 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 unique user-defined name for this floating IP.
"""
def __init__(self,
+ address: str,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
*,
- 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,
- source: str = None,
- source_port_max: int = None,
- source_port_min: int = None,
- type: int = None) -> None:
+ deleted: 'FloatingIPReferenceDeleted' = None) -> None:
"""
- Initialize a NetworkACLRulePatch object.
+ Initialize a PublicGatewayFloatingIp object.
- :param str action: (optional) Whether to allow or deny matching traffic.
- :param NetworkACLRuleBeforePatch before: (optional) The rule to move this
- rule immediately before. Specify `null` to move this rule after
- all existing rules.
- :param int code: (optional) The ICMP traffic code to allow.
- :param str destination: (optional) The destination IP address or CIDR
- block. The CIDR block `0.0.0.0/0` applies to all addresses.
- :param int destination_port_max: (optional) The inclusive upper bound of
- TCP/UDP destination port range.
- :param int destination_port_min: (optional) The inclusive lower bound of
- TCP/UDP destination port range.
- :param str direction: (optional) Whether the traffic to be matched is
- `inbound` or `outbound`.
- :param str name: (optional) The user-defined name for this rule. Names must
- be unique within the network ACL the rule resides in.
- :param str source: (optional) The source IP address or CIDR block. The
- CIDR block `0.0.0.0/0` applies to all addresses.
- :param int source_port_max: (optional) The inclusive upper bound of TCP/UDP
- source port range.
- :param int source_port_min: (optional) The inclusive lower bound of TCP/UDP
- source port range.
- :param int type: (optional) The ICMP traffic type to allow.
+ :param 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 unique user-defined name for this floating IP.
+ :param FloatingIPReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ some supplementary information.
"""
- 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.address = address
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
self.name = name
- 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) -> 'NetworkACLRulePatch':
- """Initialize a NetworkACLRulePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayFloatingIp':
+ """Initialize a PublicGatewayFloatingIp 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 '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 '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')
+ else:
+ raise ValueError('Required property \'name\' not present in PublicGatewayFloatingIp JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRulePatch 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, '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, '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, '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:
+ _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, '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):
@@ -38298,293 +46341,170 @@ 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 PublicGatewayFloatingIp object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRulePatch') -> 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: 'NetworkACLRulePatch') -> bool:
+ def __ne__(self, other: 'PublicGatewayFloatingIp') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
- """
- Whether to allow or deny matching traffic.
- """
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- Whether the traffic to be matched is `inbound` or `outbound`.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
-class NetworkACLRulePrototype():
+class PublicGatewayIdentity():
"""
- NetworkACLRulePrototype.
+ Identifies a public gateway by a unique property.
- :attr str action: Whether to allow or deny matching traffic.
- :attr NetworkACLRuleBeforePrototype before: (optional) The rule to insert this
- rule immediately before. If omitted, this rule will be
- inserted after all existing rules.
- :attr str destination: The destination IP address or CIDR block. The CIDR block
- `0.0.0.0/0` applies to all addresses.
- :attr str direction: Whether the traffic to be matched is `inbound` or
- `outbound`.
- :attr str name: (optional) The user-defined name for this rule. Names must be
- unique within the network ACL the rule resides in. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :attr str protocol: The protocol to enforce.
- :attr str source: The source IP address or CIDR block. The CIDR block
- `0.0.0.0/0` applies to all addresses.
"""
- def __init__(self,
- action: str,
- destination: str,
- direction: str,
- protocol: str,
- source: str,
- *,
- before: 'NetworkACLRuleBeforePrototype' = None,
- name: str = None) -> None:
+ def __init__(self) -> None:
"""
- Initialize a NetworkACLRulePrototype object.
+ Initialize a PublicGatewayIdentity object.
- :param str action: Whether to allow or deny matching traffic.
- :param str destination: The destination IP address or CIDR block. The CIDR
- block `0.0.0.0/0` applies to all addresses.
- :param str direction: Whether the traffic to be matched is `inbound` or
- `outbound`.
- :param str protocol: The protocol to enforce.
- :param str source: The source IP address or CIDR block. The CIDR block
- `0.0.0.0/0` applies to all addresses.
- :param NetworkACLRuleBeforePrototype before: (optional) The rule to insert
- this rule immediately before. If omitted, this rule will be
- inserted after all existing rules.
- :param str name: (optional) The user-defined name for this rule. Names must
- be unique within the network ACL the rule resides in. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll']))
- raise Exception(msg)
-
- @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(['NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll']))
+ ", ".join(['PublicGatewayIdentityPublicGatewayIdentityById', 'PublicGatewayIdentityPublicGatewayIdentityByCRN', 'PublicGatewayIdentityPublicGatewayIdentityByHref']))
raise Exception(msg)
- @classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a NetworkACLRulePrototype object from a json dictionary."""
- return cls.from_dict(_dict)
-
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['all'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolAll'
- mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolICMP'
- mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP'
- mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLRuleProtocolTCPUDP'
- 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)
-
- class ActionEnum(str, Enum):
- """
- Whether to allow or deny matching traffic.
- """
- ALLOW = 'allow'
- DENY = 'deny'
-
-
- class DirectionEnum(str, Enum):
- """
- Whether the traffic to be matched is `inbound` or `outbound`.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
-class NetworkACLRulePrototypeNetworkACLContext():
+class PublicGatewayPatch():
"""
- NetworkACLRulePrototypeNetworkACLContext.
+ PublicGatewayPatch.
- :attr str action: Whether to allow or deny matching traffic.
- :attr str destination: The destination IP address or CIDR block. The CIDR block
- `0.0.0.0/0` applies to all addresses.
- :attr str direction: Whether the traffic to be matched is `inbound` or
- `outbound`.
- :attr str name: (optional) The user-defined name for this rule. Names must be
- unique within the network ACL the rule resides in. If unspecified, the name will
- be a hyphenated list of randomly-selected words.
- :attr str protocol: The protocol to enforce.
- :attr str source: The source IP address or CIDR block. The CIDR block
- `0.0.0.0/0` applies to all addresses.
+ :attr str name: (optional) The user-defined name for this public gateway. Names
+ must be unique within the VPC the public gateway resides in.
"""
def __init__(self,
- action: str,
- destination: str,
- direction: str,
- protocol: str,
- source: str,
*,
name: str = None) -> None:
"""
- Initialize a NetworkACLRulePrototypeNetworkACLContext object.
-
- :param str action: Whether to allow or deny matching traffic.
- :param str destination: The destination IP address or CIDR block. The CIDR
- block `0.0.0.0/0` applies to all addresses.
- :param str direction: Whether the traffic to be matched is `inbound` or
- `outbound`.
- :param str protocol: The protocol to enforce.
- :param str source: The source IP address or CIDR block. The CIDR block
- `0.0.0.0/0` applies to all addresses.
- :param str name: (optional) The user-defined name for this rule. Names must
- be unique within the network ACL the rule resides in. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll']))
- raise Exception(msg)
-
- @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(['NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP', 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll']))
- raise Exception(msg)
-
- @classmethod
- def _from_dict(cls, _dict: Dict):
- """Initialize a NetworkACLRulePrototypeNetworkACLContext object from a json dictionary."""
- return cls.from_dict(_dict)
-
- @classmethod
- def _get_class_by_discriminator(cls, _dict: Dict) -> object:
- mapping = {}
- mapping['all'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolAll'
- mapping['icmp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolICMP'
- mapping['tcp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP'
- mapping['udp'] = 'NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP'
- 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):
- """
- Whether to allow or deny matching traffic.
+ Initialize a PublicGatewayPatch object.
+
+ :param str name: (optional) The user-defined name for this public gateway.
+ Names must be unique within the VPC the public gateway resides in.
"""
- ALLOW = 'allow'
- DENY = 'deny'
+ self.name = name
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayPatch':
+ """Initialize a PublicGatewayPatch object from a json dictionary."""
+ args = {}
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ return cls(**args)
- class DirectionEnum(str, Enum):
- """
- Whether the traffic to be matched is `inbound` or `outbound`.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ return _dict
-class NetworkACLRuleReference():
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this PublicGatewayPatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'PublicGatewayPatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class PublicGatewayReference():
"""
- NetworkACLRuleReference.
+ PublicGatewayReference.
- :attr NetworkACLRuleReferenceDeleted deleted: (optional) If present, this
+ :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 network ACL rule.
- :attr str id: The unique identifier for this network ACL rule.
- :attr str name: The user-defined name for this network ACL rule.
+ :attr str href: The URL for this public gateway.
+ :attr str id: The unique identifier for this public gateway.
+ :attr str name: The user-defined name for this public gateway.
+ :attr str resource_type: The resource type.
"""
def __init__(self,
+ crn: str,
href: str,
id: str,
name: str,
+ resource_type: str,
*,
- deleted: 'NetworkACLRuleReferenceDeleted' = None) -> None:
+ deleted: 'PublicGatewayReferenceDeleted' = None) -> None:
"""
- Initialize a NetworkACLRuleReference object.
+ Initialize a PublicGatewayReference 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 user-defined name for this network ACL rule.
- :param NetworkACLRuleReferenceDeleted deleted: (optional) If present, this
+ :param str crn: The CRN for this public gateway.
+ :param str href: The URL for this public gateway.
+ :param str id: The unique identifier for this public gateway.
+ :param str name: The user-defined name for this public gateway.
+ :param str 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.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) -> 'NetworkACLRuleReference':
- """Initialize a NetworkACLRuleReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayReference':
+ """Initialize a PublicGatewayReference 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'] = NetworkACLRuleReferenceDeleted.from_dict(_dict.get('deleted'))
+ 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 NetworkACLRuleReference 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 NetworkACLRuleReference 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 NetworkACLRuleReference JSON')
+ 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleReference 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, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
_dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
@@ -38593,6 +46513,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):
@@ -38600,20 +46522,27 @@ 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 PublicGatewayReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleReference') -> 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: 'NetworkACLRuleReference') -> bool:
+ def __ne__(self, other: 'PublicGatewayReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkACLRuleReferenceDeleted():
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ PUBLIC_GATEWAY = 'public_gateway'
+
+
+class PublicGatewayReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -38624,25 +46553,25 @@ class NetworkACLRuleReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a NetworkACLRuleReferenceDeleted object.
+ Initialize a PublicGatewayReferenceDeleted 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) -> '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 NetworkACLRuleReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in PublicGatewayReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkACLRuleReferenceDeleted object from a json dictionary."""
+ """Initialize a PublicGatewayReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -38657,187 +46586,372 @@ 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 PublicGatewayReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkACLRuleReferenceDeleted') -> 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: 'NetworkACLRuleReferenceDeleted') -> bool:
+ def __ne__(self, other: 'PublicGatewayReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterface():
+class Region():
"""
- NetworkInterface.
+ Region.
- :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: (optional) The floating IPs
- associated with this network interface.
- :attr str href: The URL for this network interface.
- :attr str id: The unique identifier for this network interface.
- :attr str name: The user-defined name for this network interface.
- :attr int port_speed: The network interface port speed in Mbps.
- :attr str primary_ipv4_address: The primary IPv4 address.
+ :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 Region 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.
+ """
+ self.endpoint = endpoint
+ self.href = href
+ self.name = name
+ self.status = status
+
+ @classmethod
+ 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 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 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):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this Region object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: '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 RegionCollection():
+ """
+ RegionCollection.
+
+ :attr List[Region] regions: Collection of regions.
+ """
+
+ def __init__(self,
+ regions: List['Region']) -> None:
+ """
+ Initialize a RegionCollection object.
+
+ :param List[Region] regions: Collection of regions.
+ """
+ self.regions = regions
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'RegionCollection':
+ """Initialize a RegionCollection object from a json dictionary."""
+ args = {}
+ if 'regions' in _dict:
+ args['regions'] = [Region.from_dict(x) for x in _dict.get('regions')]
+ else:
+ raise ValueError('Required property \'regions\' not present in RegionCollection JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'regions') and self.regions is not None:
+ _dict['regions'] = [x.to_dict() for x in self.regions]
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this RegionCollection object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'RegionCollection') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class RegionReference():
+ """
+ RegionReference.
+
+ :attr str href: The URL for this region.
+ :attr str name: The globally unique name for this region.
+ """
+
+ def __init__(self,
+ href: str,
+ name: str) -> None:
+ """
+ Initialize a RegionReference object.
+
+ :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) -> '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 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
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this RegionReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'RegionReference') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class ReservedIP():
+ """
+ ReservedIP.
+
+ :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 name: The user-defined or system-provided name for this reserved IP.
+ :attr str owner: The owner of a reserved IP, defining whether it is managed by
+ the user or the provider.
:attr str resource_type: The resource type.
- :attr List[SecurityGroupReference] security_groups: Collection of security
- groups.
- :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.
+ :attr ReservedIPTarget target: (optional) The target of this reserved IP.
"""
def __init__(self,
- allow_ip_spoofing: bool,
+ address: str,
+ auto_delete: bool,
created_at: datetime,
href: str,
id: str,
name: str,
- port_speed: int,
- primary_ipv4_address: str,
+ owner: str,
resource_type: str,
- security_groups: List['SecurityGroupReference'],
- status: str,
- subnet: 'SubnetReference',
- type: str,
*,
- floating_ips: List['FloatingIPReference'] = None) -> None:
+ target: 'ReservedIPTarget' = None) -> None:
"""
- Initialize a NetworkInterface object.
+ Initialize a ReservedIP 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 str href: The URL for this network interface.
- :param str id: The unique identifier for this network interface.
- :param str name: The user-defined name for this network interface.
- :param int port_speed: The network interface port speed in Mbps.
- :param str primary_ipv4_address: The primary IPv4 address.
+ :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 name: The user-defined or system-provided name for this reserved
+ IP.
+ :param str owner: The owner of a reserved IP, defining whether it is
+ managed by the user or the provider.
:param str resource_type: The resource type.
- :param List[SecurityGroupReference] security_groups: Collection of security
- groups.
- :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 List[FloatingIPReference] floating_ips: (optional) The floating IPs
- associated with this network interface.
+ :param ReservedIPTarget target: (optional) The target of this reserved IP.
"""
- self.allow_ip_spoofing = allow_ip_spoofing
+ self.address = address
+ self.auto_delete = auto_delete
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_ipv4_address = primary_ipv4_address
+ self.owner = owner
self.resource_type = resource_type
- self.security_groups = security_groups
- self.status = status
- self.subnet = subnet
- self.type = type
+ self.target = target
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterface':
- """Initialize a NetworkInterface object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIP':
+ """Initialize a ReservedIP object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
+ if 'address' in _dict:
+ args['address'] = _dict.get('address')
else:
- raise ValueError('Required property \'allow_ip_spoofing\' not present in NetworkInterface JSON')
+ 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 NetworkInterface JSON')
- if 'floating_ips' in _dict:
- args['floating_ips'] = [FloatingIPReference.from_dict(x) for x in _dict.get('floating_ips')]
+ 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 NetworkInterface 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 NetworkInterface JSON')
+ raise ValueError('Required property \'id\' not present in ReservedIP 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_ipv4_address' in _dict:
- args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ raise ValueError('Required property \'name\' not present in ReservedIP JSON')
+ if 'owner' in _dict:
+ args['owner'] = _dict.get('owner')
else:
- raise ValueError('Required property \'primary_ipv4_address\' not present in NetworkInterface JSON')
+ 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 NetworkInterface JSON')
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroupReference.from_dict(x) for x in _dict.get('security_groups')]
- else:
- raise ValueError('Required property \'security_groups\' not present in 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 \'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 NetworkInterface 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, 'allow_ip_spoofing') and self.allow_ip_spoofing is not None:
- _dict['allow_ip_spoofing'] = self.allow_ip_spoofing
+ 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, 'floating_ips') and self.floating_ips is not None:
- _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips]
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
if hasattr(self, '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_ipv4_address') and self.primary_ipv4_address is not None:
- _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ 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, 'security_groups') and self.security_groups is not None:
- _dict['security_groups'] = [x.to_dict() for x in self.security_groups]
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'subnet') and self.subnet is not None:
- _dict['subnet'] = self.subnet.to_dict()
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.type
+ if hasattr(self, '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):
@@ -38845,114 +46959,103 @@ 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 ReservedIP object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterface') -> 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: 'NetworkInterface') -> bool:
+ def __ne__(self, other: 'ReservedIP') -> 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):
+ class OwnerEnum(str, Enum):
"""
- The status of the network interface.
+ The owner of a reserved IP, defining whether it is managed by the user or the
+ provider.
"""
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
+ PROVIDER = 'provider'
+ USER = 'user'
- class TypeEnum(str, Enum):
+ class ResourceTypeEnum(str, Enum):
"""
- The type of this network interface as it relates to an instance.
+ The resource type.
"""
- PRIMARY = 'primary'
- SECONDARY = 'secondary'
+ SUBNET_RESERVED_IP = 'subnet_reserved_ip'
-class NetworkInterfaceCollection():
+class ReservedIPCollection():
"""
- NetworkInterfaceCollection.
+ ReservedIPCollection.
- :attr NetworkInterfaceCollectionFirst first: A link to the first page of
- 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 List[NetworkInterface] network_interfaces: Collection of network
- interfaces.
- :attr NetworkInterfaceCollectionNext next: (optional) A link to the next page of
+ :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,
- first: 'NetworkInterfaceCollectionFirst',
+ first: 'ReservedIPCollectionFirst',
limit: int,
- network_interfaces: List['NetworkInterface'],
+ reserved_ips: List['ReservedIP'],
total_count: int,
*,
- next: 'NetworkInterfaceCollectionNext' = None) -> None:
+ next: 'ReservedIPCollectionNext' = None) -> None:
"""
- Initialize a NetworkInterfaceCollection object.
+ Initialize a ReservedIPCollection object.
- :param NetworkInterfaceCollectionFirst first: A link to the first page of
+ :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[NetworkInterface] network_interfaces: Collection of network
- interfaces.
+ :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 NetworkInterfaceCollectionNext next: (optional) A link to the next
- page of resources. This property is present for 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.first = first
self.limit = limit
- self.network_interfaces = network_interfaces
self.next = next
+ self.reserved_ips = reserved_ips
self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceCollection':
- """Initialize a NetworkInterfaceCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollection':
+ """Initialize a ReservedIPCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = NetworkInterfaceCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = ReservedIPCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in NetworkInterfaceCollection 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 NetworkInterfaceCollection JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterface.from_dict(x) for x in _dict.get('network_interfaces')]
- else:
- raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceCollection JSON')
+ raise ValueError('Required property \'limit\' not present in ReservedIPCollection JSON')
if 'next' in _dict:
- args['next'] = NetworkInterfaceCollectionNext.from_dict(_dict.get('next'))
+ args['next'] = ReservedIPCollectionNext.from_dict(_dict.get('next'))
+ if 'reserved_ips' in _dict:
+ args['reserved_ips'] = [ReservedIP.from_dict(x) for x in _dict.get('reserved_ips')]
+ 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 NetworkInterfaceCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in ReservedIPCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceCollection object from a json dictionary."""
+ """Initialize a ReservedIPCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -38962,10 +47065,10 @@ 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:
- _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
+ if hasattr(self, 'reserved_ips') and self.reserved_ips is not None:
+ _dict['reserved_ips'] = [x.to_dict() for x in self.reserved_ips]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -38975,55 +47078,104 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceCollection object."""
+ """Return a `str` version of this ReservedIPCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceCollection') -> 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: 'NetworkInterfaceCollection') -> bool:
+ def __ne__(self, other: 'ReservedIPCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfaceCollectionFirst():
+class ReservedIPCollectionEndpointGatewayContext():
"""
- A link to the first page of resources.
+ ReservedIPCollectionEndpointGatewayContext.
- :attr str href: The URL for a 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.
"""
def __init__(self,
- href: str) -> None:
+ first: 'ReservedIPCollectionEndpointGatewayContextFirst',
+ ips: List['ReservedIP'],
+ limit: int,
+ total_count: int,
+ *,
+ next: 'ReservedIPCollectionEndpointGatewayContextNext' = None) -> None:
"""
- Initialize a NetworkInterfaceCollectionFirst object.
+ Initialize a ReservedIPCollectionEndpointGatewayContext object.
- :param str href: The URL for a 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 int total_count: The total number of resources across all pages.
+ :param ReservedIPCollectionEndpointGatewayContextNext next: (optional) A
+ link to the next page of resources. This property is present for all pages
+ except the last page.
"""
- self.href = href
+ self.first = first
+ self.ips = ips
+ self.limit = limit
+ self.next = next
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceCollectionFirst':
- """Initialize a NetworkInterfaceCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContext':
+ """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if 'first' in _dict:
+ args['first'] = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'href\' not present in NetworkInterfaceCollectionFirst JSON')
+ raise ValueError('Required property \'first\' not present in ReservedIPCollectionEndpointGatewayContext JSON')
+ if 'ips' in _dict:
+ args['ips'] = [ReservedIP.from_dict(x) for x in _dict.get('ips')]
+ 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')
+ else:
+ raise ValueError('Required property \'total_count\' not present in ReservedIPCollectionEndpointGatewayContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceCollectionFirst object from a json dictionary."""
+ """Initialize a ReservedIPCollectionEndpointGatewayContext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'ips') and self.ips is not None:
+ _dict['ips'] = [x.to_dict() for x in self.ips]
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -39031,23 +47183,22 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceCollectionFirst object."""
+ """Return a `str` version of this ReservedIPCollectionEndpointGatewayContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceCollectionFirst') -> 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: 'NetworkInterfaceCollectionFirst') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfaceCollectionNext():
+class ReservedIPCollectionEndpointGatewayContextFirst():
"""
- 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.
"""
@@ -39055,25 +47206,25 @@ class NetworkInterfaceCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a NetworkInterfaceCollectionNext 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) -> 'NetworkInterfaceCollectionNext':
- """Initialize a NetworkInterfaceCollectionNext 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 NetworkInterfaceCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceCollectionNext object from a json dictionary."""
+ """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -39088,122 +47239,56 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceCollectionNext object."""
+ """Return a `str` version of this ReservedIPCollectionEndpointGatewayContextFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceCollectionNext') -> 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: 'NetworkInterfaceCollectionNext') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContextFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfaceInstanceContextReference():
+class ReservedIPCollectionEndpointGatewayContextNext():
"""
- NetworkInterfaceInstanceContextReference.
+ A link to the next page of resources. This property is present for all pages except
+ the last page.
- :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 user-defined name for this network interface.
- :attr str primary_ipv4_address: The primary IPv4 address.
- If the address has not yet been selected, the value will be `0.0.0.0`.
- :attr str resource_type: The resource type.
- :attr SubnetReference subnet: The associated subnet.
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- href: str,
- id: str,
- name: str,
- primary_ipv4_address: str,
- resource_type: str,
- subnet: 'SubnetReference',
- *,
- deleted: 'NetworkInterfaceInstanceContextReferenceDeleted' = None) -> None:
+ href: str) -> None:
"""
- Initialize a NetworkInterfaceInstanceContextReference object.
+ Initialize a ReservedIPCollectionEndpointGatewayContextNext object.
- :param str href: The URL for this network interface.
- :param str id: The unique identifier for this network interface.
- :param str name: The user-defined name for this network interface.
- :param str primary_ipv4_address: The primary IPv4 address.
- If the address has not yet been selected, the value will be `0.0.0.0`.
- :param str resource_type: The resource type.
- :param 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 str href: The URL for a page of resources.
"""
- self.deleted = deleted
self.href = href
- self.id = id
- self.name = name
- self.primary_ipv4_address = primary_ipv4_address
- self.resource_type = resource_type
- self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceInstanceContextReference':
- """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextNext':
+ """Initialize a ReservedIPCollectionEndpointGatewayContextNext 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')
- else:
- raise ValueError('Required property \'name\' not present in NetworkInterfaceInstanceContextReference JSON')
- if 'primary_ipv4_address' in _dict:
- args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
- else:
- raise ValueError('Required property \'primary_ipv4_address\' not present in NetworkInterfaceInstanceContextReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
- else:
- 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')
+ raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceInstanceContextReference object from a json dictionary."""
+ """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None:
- _dict['primary_ipv4_address'] = self.primary_ipv4_address
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
- if hasattr(self, 'subnet') and self.subnet is not None:
- _dict['subnet'] = self.subnet.to_dict()
return _dict
def _to_dict(self):
@@ -39211,63 +47296,55 @@ 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 ReservedIPCollectionEndpointGatewayContextNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceInstanceContextReference') -> 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: 'NetworkInterfaceInstanceContextReference') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionEndpointGatewayContextNext') -> 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 ReservedIPCollectionFirst():
"""
- 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) -> None:
+ href: str) -> None:
"""
- Initialize a NetworkInterfaceInstanceContextReferenceDeleted object.
+ Initialize a ReservedIPCollectionFirst 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) -> 'ReservedIPCollectionFirst':
+ """Initialize a ReservedIPCollectionFirst 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 ReservedIPCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceInstanceContextReferenceDeleted object from a json dictionary."""
+ """Initialize a ReservedIPCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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):
@@ -39275,69 +47352,56 @@ 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 ReservedIPCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool:
+ 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: 'NetworkInterfaceInstanceContextReferenceDeleted') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfacePatch():
+class ReservedIPCollectionNext():
"""
- 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 user-defined name for network interface. Names
- must be unique within the instance the network interface resides in.
+ :attr str href: The URL for a page of resources.
"""
def __init__(self,
- *,
- allow_ip_spoofing: bool = None,
- name: str = None) -> None:
+ href: str) -> None:
"""
- Initialize a NetworkInterfacePatch object.
+ Initialize a ReservedIPCollectionNext 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 user-defined name for network interface.
- Names must be unique within the instance the network interface resides in.
+ :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) -> 'ReservedIPCollectionNext':
+ """Initialize a ReservedIPCollectionNext 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 ReservedIPCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfacePatch object from a json dictionary."""
+ """Initialize a ReservedIPCollectionNext object from 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):
@@ -39345,114 +47409,72 @@ 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 ReservedIPCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfacePatch') -> bool:
+ 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: 'NetworkInterfacePatch') -> bool:
+ def __ne__(self, other: 'ReservedIPCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfacePrototype():
+class ReservedIPPatch():
"""
- NetworkInterfacePrototype.
+ ReservedIPPatch.
- :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
- allowed on this interface. If false, source IP spoofing is prevented on this
- interface. If true, source IP spoofing is allowed on this interface.
- :attr str name: (optional) The user-defined name for network interface. Names
- must be unique within the instance the network interface resides in. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- :attr str primary_ipv4_address: (optional) The primary IPv4 address. If
- specified, it must be an available address on the network interface's subnet. If
- unspecified, an available address on the subnet will be automatically selected.
- :attr List[SecurityGroupIdentity] security_groups: (optional) Collection of
- security groups.
- :attr SubnetIdentity subnet: The associated subnet.
+ :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 user-defined name for this reserved IP. Names
+ must be unique within the subnet the reserved IP resides in. Names beginning
+ with `ibm-` are reserved for provider-owned resources.
"""
def __init__(self,
- subnet: 'SubnetIdentity',
*,
- allow_ip_spoofing: bool = None,
- name: str = None,
- primary_ipv4_address: str = None,
- security_groups: List['SecurityGroupIdentity'] = None) -> None:
+ auto_delete: bool = None,
+ name: str = None) -> None:
"""
- Initialize a NetworkInterfacePrototype object.
+ Initialize a ReservedIPPatch 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 user-defined name for network interface.
- Names must be unique within the instance the network interface resides in.
- If unspecified, the name will be a hyphenated list of randomly-selected
- words.
- :param str primary_ipv4_address: (optional) The primary IPv4 address. If
- specified, it must be an available address on the network interface's
- subnet. If unspecified, an available address on the subnet will be
- automatically selected.
- :param List[SecurityGroupIdentity] security_groups: (optional) Collection
- of security groups.
+ :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 user-defined name for this reserved IP.
+ Names must be unique within the subnet the reserved IP resides in. Names
+ beginning with `ibm-` are reserved for provider-owned resources.
"""
- self.allow_ip_spoofing = allow_ip_spoofing
+ self.auto_delete = auto_delete
self.name = name
- self.primary_ipv4_address = primary_ipv4_address
- self.security_groups = security_groups
- self.subnet = subnet
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfacePrototype':
- """Initialize a NetworkInterfacePrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ReservedIPPatch':
+ """Initialize a ReservedIPPatch object from a json dictionary."""
args = {}
- if 'allow_ip_spoofing' in _dict:
- args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
+ if 'auto_delete' in _dict:
+ args['auto_delete'] = _dict.get('auto_delete')
if 'name' in _dict:
args['name'] = _dict.get('name')
- if 'primary_ipv4_address' in _dict:
- args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
- if '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 NetworkInterfacePrototype JSON')
return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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_ipv4_address') and self.primary_ipv4_address is not None:
- _dict['primary_ipv4_address'] = self.primary_ipv4_address
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- security_groups_list = []
- for x in self.security_groups:
- if isinstance(x, dict):
- security_groups_list.append(x)
- else:
- security_groups_list.append(x.to_dict())
- _dict['security_groups'] = security_groups_list
- if hasattr(self, 'subnet') and self.subnet is not None:
- if isinstance(self.subnet, dict):
- _dict['subnet'] = self.subnet
- else:
- _dict['subnet'] = self.subnet.to_dict()
+
+ @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):
@@ -39460,99 +47482,110 @@ 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 ReservedIPPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfacePrototype') -> bool:
+ 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: 'NetworkInterfacePrototype') -> bool:
+ def __ne__(self, other: 'ReservedIPPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfaceReference():
+class ReservedIPReference():
"""
- NetworkInterfaceReference.
+ ReservedIPReference.
- :attr NetworkInterfaceReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted and provides
- some supplementary information.
- :attr str href: The URL for this network interface.
- :attr str id: The unique identifier for this network interface.
- :attr str name: The user-defined name for this network interface.
- :attr str primary_ipv4_address: The primary IPv4 address.
+ :attr str address: The IP address.
If the address has not yet been selected, the value will be `0.0.0.0`.
+ This property may add support for IPv6 addresses in the future. When processing
+ a value in this property, verify that the address is in an expected format. If
+ it is not, log an error. Optionally halt processing and surface the error, or
+ bypass the resource on which the unexpected IP address format was encountered.
+ :attr ReservedIPReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted and provides
+ some supplementary information.
+ :attr str href: The URL for this reserved IP.
+ :attr str id: The unique identifier for this reserved IP.
+ :attr str name: The user-defined or system-provided name for this reserved IP.
:attr str resource_type: The resource type.
"""
def __init__(self,
+ address: str,
href: str,
id: str,
name: str,
- primary_ipv4_address: str,
resource_type: str,
*,
- deleted: 'NetworkInterfaceReferenceDeleted' = None) -> None:
+ deleted: 'ReservedIPReferenceDeleted' = None) -> None:
"""
- Initialize a NetworkInterfaceReference object.
+ Initialize a ReservedIPReference object.
- :param str href: The URL for this network interface.
- :param str id: The unique identifier for this network interface.
- :param str name: The user-defined name for this network interface.
- :param str primary_ipv4_address: The primary IPv4 address.
+ :param str address: The IP address.
If the address has not yet been selected, the value will be `0.0.0.0`.
+ This property may add support for IPv6 addresses in the future. When
+ processing a value in this property, verify that the address is in an
+ expected format. If it is not, log an error. Optionally halt processing and
+ surface the error, or bypass the resource on which the unexpected IP
+ address format was encountered.
+ :param str href: The URL for this reserved IP.
+ :param str id: The unique identifier for this reserved IP.
+ :param str name: The user-defined or system-provided name for this reserved
+ IP.
:param str resource_type: The resource type.
- :param NetworkInterfaceReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted and
- provides
+ :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.primary_ipv4_address = primary_ipv4_address
self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceReference':
- """Initialize a NetworkInterfaceReference object from a json dictionary."""
+ 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'] = NetworkInterfaceReferenceDeleted.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 NetworkInterfaceReference 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 NetworkInterfaceReference 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 NetworkInterfaceReference JSON')
- if 'primary_ipv4_address' in _dict:
- args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
- else:
- raise ValueError('Required property \'primary_ipv4_address\' not present in NetworkInterfaceReference JSON')
+ 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 NetworkInterfaceReference JSON')
+ raise ValueError('Required property \'resource_type\' not present in ReservedIPReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceReference 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:
_dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
@@ -39561,8 +47594,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, 'primary_ipv4_address') and self.primary_ipv4_address is not None:
- _dict['primary_ipv4_address'] = self.primary_ipv4_address
if hasattr(self, 'resource_type') and self.resource_type is not None:
_dict['resource_type'] = self.resource_type
return _dict
@@ -39572,16 +47603,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceReference object."""
+ """Return a `str` version of this ReservedIPReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceReference') -> 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: 'NetworkInterfaceReference') -> bool:
+ def __ne__(self, other: 'ReservedIPReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -39589,10 +47620,10 @@ class ResourceTypeEnum(str, Enum):
"""
The resource type.
"""
- NETWORK_INTERFACE = 'network_interface'
+ SUBNET_RESERVED_IP = 'subnet_reserved_ip'
-class NetworkInterfaceReferenceDeleted():
+class ReservedIPReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -39603,25 +47634,25 @@ class NetworkInterfaceReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a NetworkInterfaceReferenceDeleted 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) -> 'NetworkInterfaceReferenceDeleted':
- """Initialize a NetworkInterfaceReferenceDeleted 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 NetworkInterfaceReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in ReservedIPReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceReferenceDeleted object from a json dictionary."""
+ """Initialize a ReservedIPReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -39636,114 +47667,122 @@ 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 ReservedIPReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceReferenceDeleted') -> 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: 'NetworkInterfaceReferenceDeleted') -> bool:
+ def __ne__(self, other: 'ReservedIPReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class NetworkInterfaceReferenceTargetContextDeleted():
+class ReservedIPTarget():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ The target of this reserved IP.
- :attr str more_info: Link to documentation about deleted resources.
"""
- def __init__(self,
- more_info: str) -> None:
+ def __init__(self) -> None:
"""
- Initialize a NetworkInterfaceReferenceTargetContextDeleted object.
+ Initialize a ReservedIPTarget 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(['ReservedIPTargetEndpointGatewayReference']))
+ raise Exception(msg)
- @classmethod
- 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 NetworkInterfaceReferenceTargetContextDeleted JSON')
- return cls(**args)
+class ReservedIPTargetPrototype():
+ """
+ The target this reserved IP is to be bound to. The target must be an endpoint gateway
+ not already bound to a reserved IP in the subnet's zone.
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceReferenceTargetContextDeleted object from 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 ReservedIPTargetPrototype 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(['ReservedIPTargetPrototypeEndpointGatewayIdentity']))
+ raise Exception(msg)
- def __str__(self) -> str:
- """Return a `str` version of this NetworkInterfaceReferenceTargetContextDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
+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 __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: 'NetworkInterfaceReferenceTargetContextDeleted') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ def __init__(self) -> None:
+ """
+ Initialize a ResourceGroupIdentity object.
-class NetworkInterfaceUnpaginatedCollection():
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['ResourceGroupIdentityById']))
+ raise Exception(msg)
+
+class ResourceGroupReference():
"""
- NetworkInterfaceUnpaginatedCollection.
+ ResourceGroupReference.
- :attr List[NetworkInterface] network_interfaces: Collection of network
- interfaces.
+ :attr str href: The URL for this resource group.
+ :attr str id: The unique identifier for this resource group.
+ :attr str name: The user-defined name for this resource group.
"""
def __init__(self,
- network_interfaces: List['NetworkInterface']) -> None:
+ href: str,
+ id: str,
+ name: str) -> None:
"""
- Initialize a NetworkInterfaceUnpaginatedCollection object.
+ Initialize a ResourceGroupReference object.
- :param List[NetworkInterface] network_interfaces: Collection of network
- interfaces.
+ :param str href: The URL for this resource group.
+ :param str id: The unique identifier for this resource group.
+ :param str name: The user-defined name for this resource group.
"""
- self.network_interfaces = network_interfaces
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'NetworkInterfaceUnpaginatedCollection':
- """Initialize a NetworkInterfaceUnpaginatedCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference':
+ """Initialize a ResourceGroupReference object from a json dictionary."""
args = {}
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterface.from_dict(x) for x in _dict.get('network_interfaces')]
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'network_interfaces\' not present in NetworkInterfaceUnpaginatedCollection 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 ResourceGroupReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ else:
+ raise ValueError('Required property \'name\' not present in ResourceGroupReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a NetworkInterfaceUnpaginatedCollection 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, 'network_interfaces') and self.network_interfaces is not None:
- _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
+ if hasattr(self, 'href') 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):
@@ -39751,131 +47790,158 @@ 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 ResourceGroupReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'NetworkInterfaceUnpaginatedCollection') -> 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: 'NetworkInterfaceUnpaginatedCollection') -> bool:
+ def __ne__(self, other: 'ResourceGroupReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class OperatingSystem():
+class Route():
"""
- OperatingSystem.
+ Route.
- :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 name of the software family this operating system belongs
- to.
- :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.
+ :attr str action: The action to perform with a packet matching the route:
+ - `delegate`: delegate to the system's built-in routes
+ - `delegate_vpc`: delegate to the system's built-in routes, ignoring
+ Internet-bound
+ routes
+ - `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 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 user-defined name for this route.
+ :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 ZoneReference zone: The zone the route applies to. (Traffic from subnets
+ in this zone will be
+ subject to this route.).
"""
def __init__(self,
- architecture: str,
- dedicated_host_only: bool,
- display_name: str,
- family: str,
+ action: str,
+ created_at: datetime,
+ destination: str,
href: str,
+ id: str,
+ lifecycle_state: str,
name: str,
- vendor: str,
- version: str) -> None:
+ next_hop: 'RouteNextHop',
+ zone: 'ZoneReference') -> None:
"""
- Initialize a OperatingSystem object.
+ Initialize a Route 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 name of the software family this operating system
- belongs to.
- :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.
+ :param str action: The action to perform with a packet matching the route:
+ - `delegate`: delegate to the system's built-in routes
+ - `delegate_vpc`: delegate to the system's built-in routes, ignoring
+ Internet-bound
+ routes
+ - `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 user-defined name for this route.
+ :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 ZoneReference zone: The zone the route applies to. (Traffic from
+ subnets in this zone will be
+ subject to this route.).
"""
- self.architecture = architecture
- self.dedicated_host_only = dedicated_host_only
- self.display_name = display_name
- self.family = family
+ self.action = action
+ self.created_at = created_at
+ self.destination = destination
self.href = href
+ self.id = id
+ self.lifecycle_state = lifecycle_state
self.name = name
- self.vendor = vendor
- self.version = version
+ self.next_hop = next_hop
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'OperatingSystem':
- """Initialize a OperatingSystem object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Route':
+ """Initialize a Route 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')
+ if 'action' in _dict:
+ args['action'] = _dict.get('action')
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')
+ 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 \'display_name\' not present in OperatingSystem JSON')
- if 'family' in _dict:
- args['family'] = _dict.get('family')
+ raise ValueError('Required property \'created_at\' not present in Route JSON')
+ if 'destination' in _dict:
+ args['destination'] = _dict.get('destination')
else:
- raise ValueError('Required property \'family\' not present in OperatingSystem JSON')
+ 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 OperatingSystem 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 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 OperatingSystem JSON')
- if 'vendor' in _dict:
- args['vendor'] = _dict.get('vendor')
+ 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 \'vendor\' not present in OperatingSystem JSON')
- if 'version' in _dict:
- args['version'] = _dict.get('version')
+ raise ValueError('Required property \'next_hop\' not present in Route JSON')
+ if 'zone' in _dict:
+ args['zone'] = ZoneReference.from_dict(_dict.get('zone'))
else:
- raise ValueError('Required property \'version\' not present in OperatingSystem JSON')
+ raise ValueError('Required property \'zone\' not present in Route JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystem 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, '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, '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, 'href') 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, '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, 'zone') and self.zone is not None:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -39883,80 +47949,114 @@ 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 Route object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystem') -> 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: 'OperatingSystem') -> bool:
+ def __ne__(self, other: 'Route') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class OperatingSystemCollection():
+ class ActionEnum(str, Enum):
+ """
+ The action to perform with a packet matching the route:
+ - `delegate`: delegate to the system's built-in routes
+ - `delegate_vpc`: delegate to the system's built-in routes, ignoring
+ Internet-bound
+ routes
+ - `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 RouteCollection():
"""
- OperatingSystemCollection.
+ RouteCollection.
- :attr OperatingSystemCollectionFirst first: A link to the first page of
- resources.
+ :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 OperatingSystemCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
+ :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[OperatingSystem] operating_systems: Collection of operating systems.
+ :attr List[Route] routes: Collection of routes.
+ :attr int total_count: The total number of resources across all pages.
"""
def __init__(self,
- first: 'OperatingSystemCollectionFirst',
+ first: 'RouteCollectionFirst',
limit: int,
- operating_systems: List['OperatingSystem'],
+ routes: List['Route'],
+ total_count: int,
*,
- next: 'OperatingSystemCollectionNext' = None) -> None:
+ next: 'RouteCollectionNext' = None) -> None:
"""
- Initialize a OperatingSystemCollection object.
+ Initialize a RouteCollection object.
- :param OperatingSystemCollectionFirst first: A link to the first page of
- resources.
+ :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[OperatingSystem] operating_systems: Collection of operating
- systems.
- :param OperatingSystemCollectionNext next: (optional) A link to the next
- page of resources. This property is present for all pages
+ :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.first = first
self.limit = limit
self.next = next
- self.operating_systems = operating_systems
+ self.routes = routes
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollection':
- """Initialize a OperatingSystemCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteCollection':
+ """Initialize a RouteCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = OperatingSystemCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = RouteCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in OperatingSystemCollection JSON')
+ raise ValueError('Required property \'first\' not present in RouteCollection JSON')
if 'limit' in _dict:
args['limit'] = _dict.get('limit')
else:
- raise ValueError('Required property \'limit\' not present in OperatingSystemCollection JSON')
+ raise ValueError('Required property \'limit\' not present in RouteCollection JSON')
if 'next' in _dict:
- args['next'] = OperatingSystemCollectionNext.from_dict(_dict.get('next'))
- if 'operating_systems' in _dict:
- args['operating_systems'] = [OperatingSystem.from_dict(x) for x in _dict.get('operating_systems')]
+ args['next'] = RouteCollectionNext.from_dict(_dict.get('next'))
+ if 'routes' in _dict:
+ args['routes'] = [Route.from_dict(x) for x in _dict.get('routes')]
else:
- raise ValueError('Required property \'operating_systems\' not present in OperatingSystemCollection JSON')
+ 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 \'total_count\' not present in RouteCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystemCollection object from a json dictionary."""
+ """Initialize a RouteCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -39968,8 +48068,10 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'operating_systems') and self.operating_systems is not None:
- _dict['operating_systems'] = [x.to_dict() for x in self.operating_systems]
+ if hasattr(self, 'routes') and self.routes is not None:
+ _dict['routes'] = [x.to_dict() for x in self.routes]
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -39977,20 +48079,20 @@ 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 RouteCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystemCollection') -> 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: 'OperatingSystemCollection') -> bool:
+ def __ne__(self, other: 'RouteCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class OperatingSystemCollectionFirst():
+class RouteCollectionFirst():
"""
A link to the first page of resources.
@@ -40000,25 +48102,25 @@ class OperatingSystemCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a OperatingSystemCollectionFirst object.
+ Initialize a RouteCollectionFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollectionFirst':
- """Initialize a OperatingSystemCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteCollectionFirst':
+ """Initialize a RouteCollectionFirst object from a json dictionary."""
args = {}
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 RouteCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystemCollectionFirst object from a json dictionary."""
+ """Initialize a RouteCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -40033,20 +48135,20 @@ 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 RouteCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystemCollectionFirst') -> 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: 'OperatingSystemCollectionFirst') -> bool:
+ def __ne__(self, other: 'RouteCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class OperatingSystemCollectionNext():
+class RouteCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -40057,25 +48159,25 @@ class OperatingSystemCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a OperatingSystemCollectionNext object.
+ Initialize a RouteCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'OperatingSystemCollectionNext':
- """Initialize a OperatingSystemCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'RouteCollectionNext':
+ """Initialize a RouteCollectionNext object from a json dictionary."""
args = {}
if 'href' in _dict:
args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'href\' not present in OperatingSystemCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in RouteCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystemCollectionNext object from a json dictionary."""
+ """Initialize a RouteCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -40090,78 +48192,318 @@ 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 RouteCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystemCollectionNext') -> 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: 'OperatingSystemCollectionNext') -> bool:
+ def __ne__(self, other: 'RouteCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class OperatingSystemIdentity():
+class RouteNextHop():
"""
- Identifies an operating system by a unique property.
+ RouteNextHop.
"""
def __init__(self) -> None:
"""
- Initialize a OperatingSystemIdentity object.
+ Initialize a RouteNextHop object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['OperatingSystemIdentityByName', 'OperatingSystemIdentityByHref']))
+ ", ".join(['RouteNextHopIP', 'RouteNextHopVPNGatewayConnectionReference']))
raise Exception(msg)
-class OperatingSystemReference():
+class RouteNextHopPrototype():
"""
- OperatingSystemReference.
+ The next hop packets will be routed to.
- :attr str href: The URL for this operating system.
- :attr str name: The globally unique name for this operating system.
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a RouteNextHopPrototype object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['RouteNextHopPrototypeRouteNextHopIP', 'RouteNextHopPrototypeVPNGatewayConnectionIdentity']))
+ raise Exception(msg)
+
+class RoutePatch():
+ """
+ RoutePatch.
+
+ :attr str name: (optional) The user-defined name for this route. Names must be
+ unique within the VPC routing table the route resides in.
+ """
+
+ def __init__(self,
+ *,
+ name: str = None) -> None:
+ """
+ Initialize a RoutePatch object.
+
+ :param str name: (optional) The user-defined name for this route. Names
+ must be unique within the VPC routing table the route resides in.
+ """
+ self.name = name
+
+ @classmethod
+ 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')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 RoutePatch object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'RoutePatch') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class RoutePrototype():
+ """
+ RoutePrototype.
+
+ :attr str action: (optional) The action to perform with a packet matching the
+ route:
+ - `delegate`: delegate to the system's built-in routes
+ - `delegate_vpc`: delegate to the system's built-in routes, ignoring
+ Internet-bound
+ routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ :attr str destination: The destination of the route. At most two routes per
+ `zone` in a table can have the same destination, and only if both routes have an
+ `action` of `deliver` and the
+ `next_hop` is an IP address.
+ :attr str name: (optional) The user-defined name for this route. If unspecified,
+ the name will be a hyphenated list of randomly-selected words. Names must be
+ unique within the VPC routing table the route resides in.
+ :attr RouteNextHopPrototype 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`.
+ :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,
+ destination: str,
+ zone: 'ZoneIdentity',
+ *,
+ action: str = None,
+ name: str = None,
+ next_hop: 'RouteNextHopPrototype' = None) -> None:
+ """
+ Initialize a RoutePrototype object.
+
+ :param str destination: The destination of the route. At most two routes
+ per `zone` in a table can have the same destination, and only if both
+ routes have an `action` of `deliver` and the
+ `next_hop` is an IP address.
+ :param ZoneIdentity zone: The zone to apply the route to. (Traffic from
+ subnets in this zone will be
+ subject to this route.).
+ :param str action: (optional) The action to perform with a packet matching
+ the route:
+ - `delegate`: delegate to the system's built-in routes
+ - `delegate_vpc`: delegate to the system's built-in routes, ignoring
+ Internet-bound
+ routes
+ - `deliver`: deliver the packet to the specified `next_hop`
+ - `drop`: drop the packet.
+ :param str name: (optional) The user-defined name for this route. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ Names must be unique within the VPC routing table the route resides in.
+ :param RouteNextHopPrototype 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`.
+ """
+ self.action = action
+ self.destination = destination
+ self.name = name
+ self.next_hop = next_hop
+ self.zone = zone
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'RoutePrototype':
+ """Initialize a RoutePrototype object from a json dictionary."""
+ args = {}
+ if 'action' in _dict:
+ args['action'] = _dict.get('action')
+ if 'destination' in _dict:
+ args['destination'] = _dict.get('destination')
+ 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 'zone' in _dict:
+ args['zone'] = _dict.get('zone')
+ else:
+ raise ValueError('Required property \'zone\' not present in RoutePrototype JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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['next_hop'] = self.next_hop.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 RoutePrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: '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 the system's built-in routes
+ - `delegate_vpc`: delegate to the system's built-in 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 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 user-defined name for this route.
"""
def __init__(self,
href: str,
- name: str) -> None:
+ id: str,
+ name: str,
+ *,
+ deleted: 'RouteReferenceDeleted' = None) -> None:
"""
- Initialize a OperatingSystemReference object.
+ Initialize a RouteReference object.
- :param str href: The URL for this operating system.
- :param str name: The globally unique name for this operating system.
+ :param str href: The URL for this route.
+ :param str id: The unique identifier for this route.
+ :param str name: The user-defined name for this route.
+ :param 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) -> 'OperatingSystemReference':
- """Initialize a OperatingSystemReference 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 OperatingSystemReference 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 OperatingSystemReference JSON')
+ raise ValueError('Required property \'name\' not present in RouteReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a OperatingSystemReference 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:
+ _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
@@ -40171,128 +48513,243 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this OperatingSystemReference object."""
+ """Return a `str` version of this RouteReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'OperatingSystemReference') -> 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: 'OperatingSystemReference') -> bool:
+ def __ne__(self, other: 'RouteReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PlacementGroup():
+class RouteReferenceDeleted():
"""
- PlacementGroup.
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :attr datetime created_at: The date and time that the placement group was
+ :attr str more_info: Link to documentation about deleted resources.
+ """
+
+ def __init__(self,
+ more_info: str) -> None:
+ """
+ Initialize a RouteReferenceDeleted object.
+
+ :param str more_info: Link to documentation about deleted resources.
+ """
+ self.more_info = more_info
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'RouteReferenceDeleted':
+ """Initialize a RouteReferenceDeleted 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 RouteReferenceDeleted JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 RouteReferenceDeleted object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'RouteReferenceDeleted') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class RoutingTable():
+ """
+ RoutingTable.
+
+ :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 user-defined name for this placement group.
- :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 user-defined name for this routing table.
: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 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.
+ :attr bool route_transit_gateway_ingress: Indicates whether this routing table
+ is used to route traffic that originates from from [Transit
+ Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address within the VPC's address prefix ranges. Therefore,
+ if an incoming packet matches a route with a `next_hop` of an internet-bound IP
+ address or a VPN gateway connection, the packet will be dropped.
+ :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used
+ to route traffic that originates from subnets in other zones in this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop` unless the
+ `next_hop` is an IP address within the VPC's address prefix ranges. Therefore,
+ if an incoming packet matches a route with a `next_hop` of an internet-bound IP
+ address or a VPN gateway connection, the packet will be dropped.
+ :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,
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) -> None:
+ route_direct_link_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 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 user-defined name for this placement group.
- :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 user-defined name for this routing table.
: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 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.
+ :param bool route_transit_gateway_ingress: Indicates whether this routing
+ table is used to route traffic that originates from from [Transit
+ Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address within the VPC's address prefix
+ ranges. Therefore, if an incoming packet matches a route with a `next_hop`
+ of an internet-bound IP address or a VPN gateway connection, the packet
+ will be dropped.
+ :param bool route_vpc_zone_ingress: Indicates whether this routing table is
+ used to route traffic that originates from subnets in other zones in this
+ VPC.
+ Incoming traffic will be routed according to the routing table with one
+ exception: routes with an `action` of `deliver` are treated as `drop`
+ unless the `next_hop` is an IP address within the VPC's address prefix
+ ranges. Therefore, if an incoming packet matches a route with a `next_hop`
+ of an internet-bound IP address or a VPN gateway connection, the packet
+ will be dropped.
+ :param List[RouteReference] routes: The routes for this routing table.
+ :param List[SubnetReference] subnets: The subnets to which this routing
+ table is attached.
"""
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_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 '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_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(x) for x in _dict.get('routes')]
+ else:
+ raise ValueError('Required property \'routes\' not present in RoutingTable JSON')
+ if 'subnets' in _dict:
+ args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
+ 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:
@@ -40300,22 +48757,28 @@ 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, '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:
- _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_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:
+ _dict['routes'] = [x.to_dict() for x in self.routes]
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ _dict['subnets'] = [x.to_dict() for x in self.subnets]
return _dict
def _to_dict(self):
@@ -40323,22 +48786,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'
FAILED = 'failed'
@@ -40353,92 +48816,76 @@ 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) -> 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(x) for x in _dict.get('placement_groups')]
+ args['next'] = RoutingTableCollectionNext.from_dict(_dict.get('next'))
+ if 'routing_tables' in _dict:
+ args['routing_tables'] = [RoutingTable.from_dict(x) for x in _dict.get('routing_tables')]
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:
@@ -40450,8 +48897,8 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'placement_groups') and self.placement_groups is not None:
- _dict['placement_groups'] = [x.to_dict() for x in self.placement_groups]
+ if hasattr(self, 'routing_tables') and self.routing_tables is not None:
+ _dict['routing_tables'] = [x.to_dict() for x in self.routing_tables]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -40461,20 +48908,20 @@ 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.
@@ -40484,25 +48931,25 @@ class PlacementGroupCollectionFirst():
def __init__(self,
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:
@@ -40517,20 +48964,20 @@ 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.
@@ -40541,25 +48988,25 @@ class PlacementGroupCollectionNext():
def __init__(self,
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:
@@ -40574,47 +49021,155 @@ 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 user-defined name for this placement group.
+ """
+
+ 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 str name: (optional) The user-defined name for this routing table. Names
+ must be unique within the VPC the routing table resides in.
+ :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 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.
+ :attr bool route_transit_gateway_ingress: (optional) Indicates whether this
+ routing table is used to route traffic that originates from
+ [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
+ 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 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.
+ 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 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.
"""
def __init__(self,
*,
- name: str = None) -> None:
+ name: str = None,
+ route_direct_link_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 user-defined name for this placement group.
+ :param str name: (optional) The user-defined name for this routing table.
+ Names must be unique within the VPC the routing table resides in.
+ :param 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 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.
+ :param bool route_transit_gateway_ingress: (optional) Indicates whether
+ this routing table is used to route traffic that originates from
+ [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this
+ VPC. Updating to
+ `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 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.
+ 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 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.
"""
self.name = name
+ self.route_direct_link_ingress = route_direct_link_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 '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_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 PlacementGroupPatch object from a json dictionary."""
+ """Initialize a RoutingTablePatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -40622,6 +49177,12 @@ def to_dict(self) -> Dict:
_dict = {}
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_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):
@@ -40629,20 +49190,126 @@ 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 RoutingTablePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PlacementGroupPatch') -> bool:
+ 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: 'PlacementGroupPatch') -> bool:
+ def __ne__(self, other: 'RoutingTablePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PlacementGroupReferenceDeleted():
+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 user-defined name for this routing table.
+ :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 user-defined name for this routing table.
+ :param str resource_type: The resource type.
+ :param RoutingTableReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ 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 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:
+ _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 RoutingTableReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: '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 RoutingTableReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -40653,25 +49320,25 @@ class PlacementGroupReferenceDeleted():
def __init__(self,
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:
@@ -40686,134 +49353,132 @@ 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 user-defined name for this public gateway.
- :attr ResourceGroupReference resource_group: The resource group for this public
- gateway.
- :attr str resource_type: The resource type.
- :attr str status: The status of the volume.
- :attr VPCReference vpc: The VPC this public gateway serves.
- :attr 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 user-defined name for this security group. Names must be
+ unique within the VPC the security group resides in.
+ :attr List[NetworkInterfaceReference] network_interfaces: The network interfaces
+ for this security group.
+ :attr ResourceGroupReference resource_group: The resource group for this
+ security group.
+ :attr List[SecurityGroupRule] rules: The rules for this security group. If no
+ rules exist, all traffic will be denied.
+ :attr List[SecurityGroupTargetReference] targets: The targets for this security
+ group.
+ :attr VPCReference vpc: The VPC this security group is a part of.
"""
def __init__(self,
created_at: datetime,
crn: str,
- floating_ip: 'PublicGatewayFloatingIp',
href: str,
id: str,
name: str,
+ network_interfaces: List['NetworkInterfaceReference'],
resource_group: 'ResourceGroupReference',
- resource_type: str,
- status: str,
- vpc: 'VPCReference',
- zone: 'ZoneReference') -> None:
+ rules: List['SecurityGroupRule'],
+ targets: List['SecurityGroupTargetReference'],
+ vpc: 'VPCReference') -> None:
"""
- Initialize a PublicGateway object.
-
- :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 user-defined name for this public gateway.
+ Initialize a SecurityGroup 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 user-defined name for this security group. Names must
+ be unique within the VPC the security group resides in.
+ :param List[NetworkInterfaceReference] network_interfaces: The network
+ interfaces for this security group.
:param ResourceGroupReference resource_group: The resource group for this
- public gateway.
- :param str resource_type: The resource type.
- :param str status: The status of the volume.
- :param VPCReference vpc: The VPC this public gateway serves.
- :param 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 is a part of.
"""
self.created_at = created_at
self.crn = crn
- self.floating_ip = floating_ip
self.href = href
self.id = id
self.name = name
+ self.network_interfaces = network_interfaces
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 'network_interfaces' in _dict:
+ args['network_interfaces'] = [NetworkInterfaceReference.from_dict(x) for x in _dict.get('network_interfaces')]
+ else:
+ raise ValueError('Required property \'network_interfaces\' not present in SecurityGroup JSON')
if 'resource_group' in _dict:
args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
else:
- 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(x) for x 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:
@@ -40823,24 +49488,28 @@ 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:
- _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, 'network_interfaces') and self.network_interfaces is not None:
+ _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
if hasattr(self, 'resource_group') and self.resource_group is not None:
_dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, '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:
+ _dict['rules'] = [x.to_dict() for x in self.rules]
+ if hasattr(self, 'targets') and self.targets is not None:
+ targets_list = []
+ for x in self.targets:
+ if isinstance(x, dict):
+ targets_list.append(x)
+ else:
+ targets_list.append(x.to_dict())
+ _dict['targets'] = targets_list
if hasattr(self, 'vpc') and self.vpc is not None:
_dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -40848,103 +49517,86 @@ 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 the volume.
- """
- 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) -> 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(x) for x in _dict.get('public_gateways')]
+ args['next'] = SecurityGroupCollectionNext.from_dict(_dict.get('next'))
+ if 'security_groups' in _dict:
+ args['security_groups'] = [SecurityGroup.from_dict(x) for x in _dict.get('security_groups')]
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:
@@ -40956,8 +49608,8 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'public_gateways') and self.public_gateways is not None:
- _dict['public_gateways'] = [x.to_dict() for x in self.public_gateways]
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ _dict['security_groups'] = [x.to_dict() for x in self.security_groups]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -40967,20 +49619,20 @@ 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.
@@ -40990,25 +49642,25 @@ class PublicGatewayCollectionFirst():
def __init__(self,
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:
@@ -41023,20 +49675,20 @@ 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.
@@ -41047,156 +49699,32 @@ class PublicGatewayCollectionNext():
def __init__(self,
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."""
- args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in PublicGatewayCollectionNext JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a PublicGatewayCollectionNext object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayCollectionNext object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'PublicGatewayCollectionNext') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'PublicGatewayCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class PublicGatewayFloatingIPPrototype():
- """
- PublicGatewayFloatingIPPrototype.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a PublicGatewayFloatingIPPrototype object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['PublicGatewayFloatingIPPrototypeFloatingIPIdentity', 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTargetContext']))
- raise Exception(msg)
-
-class PublicGatewayFloatingIp():
- """
- The floating IP bound to this public gateway.
-
- :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 unique user-defined name for this floating IP.
- """
-
- def __init__(self,
- address: str,
- crn: str,
- href: str,
- id: str,
- name: str,
- *,
- deleted: 'FloatingIPReferenceDeleted' = None) -> None:
- """
- Initialize a PublicGatewayFloatingIp 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 unique user-defined name for this floating IP.
- :param FloatingIPReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted and provides
- 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) -> 'PublicGatewayFloatingIp':
- """Initialize a PublicGatewayFloatingIp object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollectionNext':
+ """Initialize a SecurityGroupCollectionNext 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')
- else:
- raise ValueError('Required property \'name\' not present in PublicGatewayFloatingIp JSON')
+ raise ValueError('Required property \'href\' not present in SecurityGroupCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayFloatingIp object from a json dictionary."""
+ """Initialize a SecurityGroupCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
- if hasattr(self, '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:
- _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):
@@ -41204,56 +49732,56 @@ 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 SecurityGroupCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayFloatingIp') -> 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: 'PublicGatewayFloatingIp') -> bool:
+ def __ne__(self, other: 'SecurityGroupCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PublicGatewayIdentity():
+class SecurityGroupIdentity():
"""
- Identifies a public gateway by a unique property.
+ Identifies a security group by a unique property.
"""
def __init__(self) -> None:
"""
- Initialize a PublicGatewayIdentity object.
+ Initialize a SecurityGroupIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['PublicGatewayIdentityById', 'PublicGatewayIdentityByCRN', 'PublicGatewayIdentityByHref']))
+ ", ".join(['SecurityGroupIdentityById', 'SecurityGroupIdentityByCRN', 'SecurityGroupIdentityByHref']))
raise Exception(msg)
-class PublicGatewayPatch():
+class SecurityGroupPatch():
"""
- PublicGatewayPatch.
+ SecurityGroupPatch.
- :attr str name: (optional) The user-defined name for this public gateway. Names
- must be unique within the VPC the public gateway resides in.
+ :attr str name: (optional) The user-defined name for this security group. Names
+ must be unique within the VPC the security group resides in.
"""
def __init__(self,
*,
name: str = None) -> None:
"""
- Initialize a PublicGatewayPatch object.
+ Initialize a SecurityGroupPatch object.
- :param str name: (optional) The user-defined name for this public gateway.
- Names must be unique within the VPC the public gateway resides in.
+ :param str name: (optional) The user-defined name for this security group.
+ Names must be unique within the VPC the security group resides in.
"""
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayPatch':
- """Initialize a PublicGatewayPatch object from a json dictionary."""
+ 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')
@@ -41261,7 +49789,7 @@ def from_dict(cls, _dict: Dict) -> 'PublicGatewayPatch':
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayPatch object from a json dictionary."""
+ """Initialize a SecurityGroupPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -41276,31 +49804,31 @@ 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 SecurityGroupPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayPatch') -> bool:
+ 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: 'PublicGatewayPatch') -> bool:
+ def __ne__(self, other: 'SecurityGroupPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PublicGatewayReference():
+class SecurityGroupReference():
"""
- PublicGatewayReference.
+ SecurityGroupReference.
- :attr str crn: The CRN for this public gateway.
- :attr PublicGatewayReferenceDeleted deleted: (optional) If present, this
+ :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 public gateway.
- :attr str id: The unique identifier for this public gateway.
- :attr str name: The user-defined name for this public gateway.
- :attr str 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 user-defined name for this security group. Names must be
+ unique within the VPC the security group resides in.
"""
def __init__(self,
@@ -41308,18 +49836,17 @@ def __init__(self,
href: str,
id: str,
name: str,
- resource_type: str,
*,
- deleted: 'PublicGatewayReferenceDeleted' = None) -> None:
+ deleted: 'SecurityGroupReferenceDeleted' = None) -> None:
"""
- Initialize a PublicGatewayReference object.
+ Initialize a SecurityGroupReference 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 user-defined name for this public gateway.
- :param str resource_type: The resource type.
- :param PublicGatewayReferenceDeleted 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 user-defined name for this security group. Names must
+ be unique within the VPC the security group resides in.
+ :param SecurityGroupReferenceDeleted deleted: (optional) If present, this
property indicates the referenced resource has been deleted and provides
some supplementary information.
"""
@@ -41328,39 +49855,34 @@ def __init__(self,
self.href = href
self.id = id
self.name = name
- self.resource_type = resource_type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayReference':
- """Initialize a PublicGatewayReference object from a json dictionary."""
+ 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 PublicGatewayReference JSON')
+ raise ValueError('Required property \'crn\' not present in SecurityGroupReference JSON')
if 'deleted' in _dict:
- args['deleted'] = PublicGatewayReferenceDeleted.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 PublicGatewayReference JSON')
+ 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 PublicGatewayReference JSON')
+ 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 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')
+ raise ValueError('Required property \'name\' not present in SecurityGroupReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayReference object from a json dictionary."""
+ """Initialize a SecurityGroupReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -41376,8 +49898,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):
@@ -41385,27 +49905,20 @@ 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 SecurityGroupReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayReference') -> bool:
+ 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: 'PublicGatewayReference') -> bool:
+ def __ne__(self, other: 'SecurityGroupReference') -> 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 PublicGatewayReferenceDeleted():
+class SecurityGroupReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -41416,25 +49929,25 @@ class PublicGatewayReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a PublicGatewayReferenceDeleted object.
+ 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) -> 'PublicGatewayReferenceDeleted':
- """Initialize a PublicGatewayReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupReferenceDeleted':
+ """Initialize a SecurityGroupReferenceDeleted 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')
+ raise ValueError('Required property \'more_info\' not present in SecurityGroupReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayReferenceDeleted object from a json dictionary."""
+ """Initialize a SecurityGroupReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -41449,149 +49962,163 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayReferenceDeleted object."""
+ """Return a `str` version of this SecurityGroupReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayReferenceDeleted') -> 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: 'PublicGatewayReferenceDeleted') -> bool:
+ def __ne__(self, other: 'SecurityGroupReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class Region():
+class SecurityGroupRule():
"""
- Region.
+ SecurityGroupRule.
- :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 str direction: The direction of traffic to enforce, either `inbound` or
+ `outbound`.
+ :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
+ source,
+ for outbound rules).
"""
def __init__(self,
- endpoint: str,
+ direction: str,
href: str,
- name: str,
- status: str) -> None:
+ id: str,
+ ip_version: str,
+ protocol: str,
+ remote: 'SecurityGroupRuleRemote') -> None:
"""
- Initialize a Region object.
+ Initialize a SecurityGroupRule 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.
- """
- self.endpoint = endpoint
- self.href = href
- self.name = name
- self.status = status
+ :param str direction: The direction of traffic to enforce, either `inbound`
+ or `outbound`.
+ :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 source,
+ for outbound rules).
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupRuleSecurityGroupRuleProtocolAll', 'SecurityGroupRuleSecurityGroupRuleProtocolICMP', 'SecurityGroupRuleSecurityGroupRuleProtocolTCPUDP']))
+ raise Exception(msg)
@classmethod
- 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 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)
+ 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):
- """Initialize a Region object from a json dictionary."""
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a SecurityGroupRule object from 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):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this Region object."""
- return json.dumps(self.to_dict(), indent=2)
+ @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)
- 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__
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce, either `inbound` or `outbound`.
+ """
+ INBOUND = 'inbound'
+ OUTBOUND = 'outbound'
- 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):
+ class IpVersionEnum(str, Enum):
"""
- The availability status of this region.
+ 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.
"""
- AVAILABLE = 'available'
- UNAVAILABLE = 'unavailable'
+ IPV4 = 'ipv4'
-class RegionCollection():
+class SecurityGroupRuleCollection():
"""
- RegionCollection.
+ Collection of rules in a security group.
- :attr List[Region] regions: Collection of regions.
+ :attr List[SecurityGroupRule] rules: Array of rules.
"""
def __init__(self,
- regions: List['Region']) -> None:
+ rules: List['SecurityGroupRule']) -> None:
"""
- Initialize a RegionCollection object.
+ Initialize a SecurityGroupRuleCollection object.
- :param List[Region] regions: Collection of regions.
+ :param List[SecurityGroupRule] rules: Array of rules.
"""
- self.regions = regions
+ self.rules = rules
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RegionCollection':
- """Initialize a RegionCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleCollection':
+ """Initialize a SecurityGroupRuleCollection object from a json dictionary."""
args = {}
- if 'regions' in _dict:
- args['regions'] = [Region.from_dict(x) for x in _dict.get('regions')]
+ if 'rules' in _dict:
+ args['rules'] = [SecurityGroupRule.from_dict(x) for x in _dict.get('rules')]
else:
- raise ValueError('Required property \'regions\' not present in RegionCollection JSON')
+ raise ValueError('Required property \'rules\' not present in SecurityGroupRuleCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RegionCollection 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, 'regions') and self.regions is not None:
- _dict['regions'] = [x.to_dict() for x in self.regions]
+ if hasattr(self, 'rules') and self.rules is not None:
+ _dict['rules'] = [x.to_dict() for x in self.rules]
return _dict
def _to_dict(self):
@@ -41599,65 +50126,141 @@ 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 SecurityGroupRuleCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RegionCollection') -> 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: 'RegionCollection') -> bool:
+ def __ne__(self, other: 'SecurityGroupRuleCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RegionReference():
+class SecurityGroupRulePatch():
"""
- RegionReference.
+ SecurityGroupRulePatch.
- :attr str href: The URL for this region.
- :attr str name: The globally unique name for this region.
+ :attr int code: (optional) The ICMP traffic code to allow. Specify `null` to
+ remove an existing ICMP traffic code value.
+ :attr str direction: (optional) The direction of traffic to enforce, either
+ `inbound` or `outbound`.
+ :attr str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they are
+ used. Alternatively, if `remote` references a security group, then this rule
+ only applies to IP addresses (network interfaces) in that group matching this IP
+ version.
+ :attr int port_max: (optional) The inclusive upper bound of the protocol port
+ range. Specify `null` to clear an existing upper bound. If a lower bound has
+ been set, the upper bound must also be set, and must not be smaller.
+ :attr int port_min: (optional) The inclusive lower bound of the protocol port
+ range. Specify `null` to clear an existing lower bound. If an upper bound has
+ been set, the lower bound must also be set, and must not be larger.
+ :attr SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or
+ security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR block, or
+ a
+ security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source
+ (or to
+ any source, for outbound rules).
+ :attr int type: (optional) The ICMP traffic type to allow. Specify `null` to
+ remove an existing ICMP traffic type value.
"""
def __init__(self,
- href: str,
- name: str) -> 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 RegionReference object.
+ Initialize a SecurityGroupRulePatch object.
- :param str href: The URL for this region.
- :param str name: The globally unique name for this region.
+ :param int code: (optional) The ICMP traffic code to allow. Specify `null`
+ to remove an existing ICMP traffic code value.
+ :param str direction: (optional) The direction of traffic to enforce,
+ either `inbound` or `outbound`.
+ :param str ip_version: (optional) The IP version to enforce. The format of
+ `remote.address` or `remote.cidr_block` must match this property, if they
+ are used. Alternatively, if `remote` references a security group, then this
+ rule only applies to IP addresses (network interfaces) in that group
+ matching this IP version.
+ :param int port_max: (optional) The inclusive upper bound of the protocol
+ port range. Specify `null` to clear an existing upper bound. If a lower
+ bound has been set, the upper bound must also be set, and must not be
+ smaller.
+ :param int port_min: (optional) The inclusive lower bound of the protocol
+ port range. Specify `null` to clear an existing lower bound. If an upper
+ bound has been set, the lower bound must also be set, and must not be
+ larger.
+ :param SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or
+ security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR
+ block, or a
+ security group. A CIDR block of `0.0.0.0/0` will allow traffic from any
+ source (or to
+ any source, for outbound rules).
+ :param int type: (optional) The ICMP traffic type to allow. Specify `null`
+ to remove an existing ICMP traffic type value.
"""
- self.href = href
- self.name = name
+ 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) -> 'RegionReference':
- """Initialize a RegionReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePatch':
+ """Initialize a SecurityGroupRulePatch 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')
+ 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 RegionReference 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, '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, '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['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):
@@ -41665,260 +50268,264 @@ 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 SecurityGroupRulePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RegionReference') -> 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: 'RegionReference') -> bool:
+ def __ne__(self, other: 'SecurityGroupRulePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIP():
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce, either `inbound` or `outbound`.
+ """
+ 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():
"""
- ReservedIP.
+ SecurityGroupRulePrototype.
- :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 name: The user-defined or system-provided name for this reserved IP.
- :attr str owner: The owner of a reserved IP, defining whether it is managed by
- the user or the provider.
- :attr str resource_type: The resource type.
- :attr ReservedIPTarget target: (optional) The target of this reserved IP.
+ :attr str direction: The direction of traffic to enforce, either `inbound` or
+ `outbound`.
+ :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. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow
+ traffic
+ from any source (or to any source, for outbound rules).
"""
def __init__(self,
- address: str,
- auto_delete: bool,
- created_at: datetime,
- href: str,
- id: str,
- name: str,
- owner: str,
- resource_type: str,
+ direction: str,
+ protocol: str,
*,
- target: 'ReservedIPTarget' = None) -> None:
+ ip_version: str = None,
+ remote: 'SecurityGroupRuleRemotePrototype' = None) -> None:
"""
- Initialize a ReservedIP object.
+ Initialize a SecurityGroupRulePrototype 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
- created.
- :param str href: The URL for this reserved IP.
- :param str id: The unique identifier for this reserved IP.
- :param str name: The user-defined or system-provided name for this reserved
- IP.
- :param str owner: The owner of a reserved IP, defining whether it is
- managed by the user or the provider.
- :param str resource_type: The resource type.
- :param ReservedIPTarget target: (optional) The target of this reserved IP.
+ :param str direction: The direction of traffic to enforce, either `inbound`
+ or `outbound`.
+ :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. If omitted, a CIDR block of `0.0.0.0/0` will be used to
+ allow traffic
+ from any source (or to any source, for outbound rules).
"""
- self.address = address
- self.auto_delete = auto_delete
- self.created_at = created_at
- self.href = href
- self.id = id
- self.name = name
- self.owner = owner
- self.resource_type = resource_type
- self.target = target
+ 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) -> 'ReservedIP':
- """Initialize a ReservedIP 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')
- 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 ReservedIP JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in ReservedIP 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')
- 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)
+ 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):
- """Initialize a ReservedIP object from a json dictionary."""
+ def _from_dict(cls, _dict: Dict):
+ """Initialize a SecurityGroupRulePrototype object from 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, '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, '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
+ @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)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ class DirectionEnum(str, Enum):
+ """
+ The direction of traffic to enforce, either `inbound` or `outbound`.
+ """
+ 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 SecurityGroupRuleRemote():
+ """
+ The IP addresses or security groups from which this rule allows traffic (or to which,
+ for outbound rules). Can be specified as an IP address, a CIDR block, or a security
+ group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any source,
+ for outbound rules).
+
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a SecurityGroupRuleRemote object.
- def __str__(self) -> str:
- """Return a `str` version of this ReservedIP object."""
- return json.dumps(self.to_dict(), indent=2)
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupRuleRemoteIP', 'SecurityGroupRuleRemoteCIDR', 'SecurityGroupRuleRemoteSecurityGroupReference']))
+ raise Exception(msg)
- 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__
+class SecurityGroupRuleRemotePatch():
+ """
+ The IP addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR block, or a
+ security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to
+ any source, for outbound rules).
- def __ne__(self, other: 'ReservedIP') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ """
- class OwnerEnum(str, Enum):
+ def __init__(self) -> None:
"""
- The owner of a reserved IP, defining whether it is managed by the user or the
- provider.
+ Initialize a SecurityGroupRuleRemotePatch object.
+
"""
- PROVIDER = 'provider'
- USER = 'user'
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupRuleRemotePatchIP', 'SecurityGroupRuleRemotePatchCIDR', 'SecurityGroupRuleRemotePatchSecurityGroupIdentity']))
+ raise Exception(msg)
+
+class SecurityGroupRuleRemotePrototype():
+ """
+ The IP addresses or security groups from which this rule will allow traffic (or to
+ which, for outbound rules). Can be specified as an IP address, a CIDR block, or a
+ security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow traffic
+ from any source (or to any source, for outbound rules).
+ """
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
+ def __init__(self) -> None:
"""
- SUBNET_RESERVED_IP = 'subnet_reserved_ip'
+ 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 ReservedIPCollection():
+class SecurityGroupTargetCollection():
"""
- ReservedIPCollection.
+ SecurityGroupTargetCollection.
- :attr ReservedIPCollectionFirst first: A link to the first page of resources.
+ :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 ReservedIPCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
+ :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[ReservedIP] reserved_ips: Collection of reserved IPs in this subnet.
+ :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,
- first: 'ReservedIPCollectionFirst',
+ first: 'SecurityGroupTargetCollectionFirst',
limit: int,
- reserved_ips: List['ReservedIP'],
+ targets: List['SecurityGroupTargetReference'],
total_count: int,
*,
- next: 'ReservedIPCollectionNext' = None) -> None:
+ next: 'SecurityGroupTargetCollectionNext' = None) -> None:
"""
- Initialize a ReservedIPCollection object.
+ Initialize a SecurityGroupTargetCollection object.
- :param ReservedIPCollectionFirst first: A link to the first page of
- resources.
+ :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[ReservedIP] reserved_ips: Collection of reserved IPs in this
- subnet.
+ :param List[SecurityGroupTargetReference] targets: Collection of targets
+ for this security group.
:param int total_count: The total number of resources across all pages.
- :param ReservedIPCollectionNext next: (optional) A link to the next page of
- resources. This property is present for all pages
+ :param SecurityGroupTargetCollectionNext 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.targets = targets
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) -> 'SecurityGroupTargetCollection':
+ """Initialize a SecurityGroupTargetCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = ReservedIPCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = SecurityGroupTargetCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in ReservedIPCollection JSON')
+ raise ValueError('Required property \'first\' not present in SecurityGroupTargetCollection 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 SecurityGroupTargetCollection JSON')
if 'next' in _dict:
- args['next'] = ReservedIPCollectionNext.from_dict(_dict.get('next'))
- if 'reserved_ips' in _dict:
- args['reserved_ips'] = [ReservedIP.from_dict(x) for x in _dict.get('reserved_ips')]
+ args['next'] = SecurityGroupTargetCollectionNext.from_dict(_dict.get('next'))
+ if 'targets' in _dict:
+ args['targets'] = _dict.get('targets')
else:
- raise ValueError('Required property \'reserved_ips\' not present in ReservedIPCollection JSON')
+ 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 \'total_count\' not present in ReservedIPCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in SecurityGroupTargetCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollection object from a json dictionary."""
+ """Initialize a SecurityGroupTargetCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -41930,8 +50537,14 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'reserved_ips') and self.reserved_ips is not None:
- _dict['reserved_ips'] = [x.to_dict() for x in self.reserved_ips]
+ if hasattr(self, 'targets') and self.targets is not None:
+ targets_list = []
+ for x in self.targets:
+ if isinstance(x, dict):
+ targets_list.append(x)
+ else:
+ targets_list.append(x.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
@@ -41941,104 +50554,55 @@ 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 SecurityGroupTargetCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollection') -> 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: 'ReservedIPCollection') -> bool:
+ def __ne__(self, other: 'SecurityGroupTargetCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionEndpointGatewayContext():
+class SecurityGroupTargetCollectionFirst():
"""
- 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) -> None:
+ href: str) -> None:
"""
- Initialize a ReservedIPCollectionEndpointGatewayContext object.
+ Initialize a SecurityGroupTargetCollectionFirst 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) -> 'SecurityGroupTargetCollectionFirst':
+ """Initialize a SecurityGroupTargetCollectionFirst 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(x) for x 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 SecurityGroupTargetCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionEndpointGatewayContext 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'ips') and self.ips is not None:
- _dict['ips'] = [x.to_dict() for x in self.ips]
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
return _dict
def _to_dict(self):
@@ -42046,22 +50610,23 @@ 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 SecurityGroupTargetCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContext') -> 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: 'ReservedIPCollectionEndpointGatewayContext') -> bool:
+ def __ne__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionEndpointGatewayContextFirst():
+class SecurityGroupTargetCollectionNext():
"""
- 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.
"""
@@ -42069,25 +50634,25 @@ class ReservedIPCollectionEndpointGatewayContextFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a ReservedIPCollectionEndpointGatewayContextFirst object.
+ Initialize a SecurityGroupTargetCollectionNext 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) -> '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 ReservedIPCollectionEndpointGatewayContextFirst JSON')
+ raise ValueError('Required property \'href\' not present in SecurityGroupTargetCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionEndpointGatewayContextFirst object from a json dictionary."""
+ """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -42102,56 +50667,399 @@ 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 SecurityGroupTargetCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextFirst') -> 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: 'SecurityGroupTargetCollectionNext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class SecurityGroupTargetReference():
+ """
+ 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.
+
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a SecurityGroupTargetReference object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext', 'SecurityGroupTargetReferenceLoadBalancerReference', 'SecurityGroupTargetReferenceEndpointGatewayReference']))
+ raise Exception(msg)
+
+class Snapshot():
+ """
+ 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 datetime created_at: The date and time that this snapshot was created.
+ :attr str crn: The CRN for this snapshot.
+ :attr bool deletable: Indicates whether this snapshot can be deleted. This value
+ will always be `true`.
+ :attr str encryption: The type of encryption used on the source volume.
+ :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 user-defined name for this snapshot.
+ :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 int size: The size of this snapshot rounded up to the next gigabyte.
+ :attr ImageReference source_image: (optional) If present, the image from which
+ the data on this volume was most directly
+ provisioned.
+ :attr VolumeReference source_volume: The source volume this snapshot was created
+ from (may be
+ [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
+ """
+
+ def __init__(self,
+ bootable: bool,
+ 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,
+ size: int,
+ source_volume: 'VolumeReference',
+ *,
+ captured_at: datetime = None,
+ encryption_key: 'EncryptionKeyReference' = None,
+ operating_system: 'OperatingSystem' = None,
+ source_image: 'ImageReference' = None) -> None:
+ """
+ Initialize a Snapshot object.
+
+ :param bool bootable: Indicates if a boot volume attachment can be created
+ with a volume created from this snapshot.
+ :param datetime created_at: The date and time that this snapshot was
+ created.
+ :param str crn: The CRN for this snapshot.
+ :param bool deletable: Indicates whether this snapshot can be deleted. This
+ value will always be `true`.
+ :param str encryption: The type of encryption used on the source volume.
+ :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 user-defined name for this snapshot.
+ :param ResourceGroupReference resource_group: The resource group for this
+ snapshot.
+ :param str resource_type: The resource type.
+ :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 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 volume was most directly
+ provisioned.
+ """
+ self.bootable = bootable
+ self.captured_at = captured_at
+ self.created_at = created_at
+ 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.operating_system = operating_system
+ self.resource_group = resource_group
+ self.resource_type = resource_type
+ self.size = size
+ self.source_image = source_image
+ self.source_volume = source_volume
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'Snapshot':
+ """Initialize a Snapshot object from a json dictionary."""
+ args = {}
+ 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 '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'))
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ 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 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')
+ 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')
+ 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 '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_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')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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, '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:
+ _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, 'operating_system') and self.operating_system is not None:
+ _dict['operating_system'] = self.operating_system.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if 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, 'source_image') and self.source_image is not None:
+ _dict['source_image'] = self.source_image.to_dict()
+ if hasattr(self, 'source_volume') and self.source_volume is not None:
+ _dict['source_volume'] = self.source_volume.to_dict()
+ return _dict
+
+ def _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: 'ReservedIPCollectionEndpointGatewayContextFirst') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ 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 ReservedIPCollectionEndpointGatewayContextNext():
+class SnapshotCollection():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ SnapshotCollection.
- :attr str href: The URL for a page of resources.
+ :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,
- href: str) -> None:
+ first: 'SnapshotCollectionFirst',
+ limit: int,
+ snapshots: List['Snapshot'],
+ total_count: int,
+ *,
+ next: 'SnapshotCollectionNext' = None) -> None:
"""
- Initialize a ReservedIPCollectionEndpointGatewayContextNext object.
+ Initialize a SnapshotCollection object.
- :param str href: The URL for a page of resources.
+ :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.href = href
+ self.first = first
+ self.limit = limit
+ self.next = next
+ self.snapshots = snapshots
+ self.total_count = total_count
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionEndpointGatewayContextNext':
- """Initialize a ReservedIPCollectionEndpointGatewayContextNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotCollection':
+ """Initialize a SnapshotCollection object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
+ if 'first' in _dict:
+ args['first'] = SnapshotCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'href\' not present in ReservedIPCollectionEndpointGatewayContextNext JSON')
+ 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(x) for x 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 ReservedIPCollectionEndpointGatewayContextNext 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'first') and self.first is not None:
+ _dict['first'] = self.first.to_dict()
+ if hasattr(self, 'limit') and self.limit is not None:
+ _dict['limit'] = self.limit
+ if hasattr(self, 'next') and self.next is not None:
+ _dict['next'] = self.next.to_dict()
+ if hasattr(self, 'snapshots') and self.snapshots is not None:
+ _dict['snapshots'] = [x.to_dict() for x in self.snapshots]
+ if hasattr(self, 'total_count') and self.total_count is not None:
+ _dict['total_count'] = self.total_count
return _dict
def _to_dict(self):
@@ -42159,20 +51067,20 @@ 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 SnapshotCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionEndpointGatewayContextNext') -> 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: 'ReservedIPCollectionEndpointGatewayContextNext') -> bool:
+ def __ne__(self, other: 'SnapshotCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionFirst():
+class SnapshotCollectionFirst():
"""
A link to the first page of resources.
@@ -42182,25 +51090,25 @@ class ReservedIPCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a ReservedIPCollectionFirst object.
+ Initialize a SnapshotCollectionFirst object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionFirst':
- """Initialize a ReservedIPCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionFirst':
+ """Initialize a SnapshotCollectionFirst 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')
+ raise ValueError('Required property \'href\' not present in SnapshotCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionFirst object from a json dictionary."""
+ """Initialize a SnapshotCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -42215,20 +51123,20 @@ 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 SnapshotCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionFirst') -> 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: 'ReservedIPCollectionFirst') -> bool:
+ def __ne__(self, other: 'SnapshotCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPCollectionNext():
+class SnapshotCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -42239,25 +51147,25 @@ class ReservedIPCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a ReservedIPCollectionNext object.
+ Initialize a SnapshotCollectionNext object.
:param str href: The URL for a page of resources.
"""
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPCollectionNext':
- """Initialize a ReservedIPCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionNext':
+ """Initialize a SnapshotCollectionNext 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')
+ raise ValueError('Required property \'href\' not present in SnapshotCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPCollectionNext object from a json dictionary."""
+ """Initialize a SnapshotCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -42272,70 +51180,67 @@ 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 SnapshotCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPCollectionNext') -> 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: 'ReservedIPCollectionNext') -> bool:
+ def __ne__(self, other: 'SnapshotCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPPatch():
+class SnapshotIdentity():
"""
- ReservedIPPatch.
+ Identifies a snapshot by a unique property.
- :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 user-defined name for this reserved IP. Names
- must be unique within the subnet the reserved IP resides in. Names beginning
- with `ibm-` are reserved for provider-owned resources.
+ """
+
+ 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 SnapshotPatch():
+ """
+ SnapshotPatch.
+
+ :attr str name: (optional) The user-defined name for this snapshot.
"""
def __init__(self,
*,
- auto_delete: bool = None,
name: str = None) -> None:
"""
- Initialize a ReservedIPPatch object.
+ Initialize a SnapshotPatch 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 user-defined name for this reserved IP.
- Names must be unique within the subnet the reserved IP resides in. Names
- beginning with `ibm-` are reserved for provider-owned resources.
+ :param str name: (optional) The user-defined name for this snapshot.
"""
- self.auto_delete = auto_delete
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ReservedIPPatch':
- """Initialize a ReservedIPPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'SnapshotPatch':
+ """Initialize a SnapshotPatch 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."""
+ """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, '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
@@ -42345,66 +51250,54 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPPatch object."""
+ """Return a `str` version of this SnapshotPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPPatch') -> 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: 'ReservedIPPatch') -> bool:
+ def __ne__(self, other: 'SnapshotPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class ReservedIPReference():
+class SnapshotReference():
"""
- ReservedIPReference.
+ SnapshotReference.
- :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
+ :attr str crn: The CRN for 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 reserved IP.
- :attr str id: The unique identifier for this reserved IP.
- :attr str name: The user-defined or system-provided name for this reserved IP.
+ :attr str href: The URL for this snapshot.
+ :attr str id: The unique identifier for this snapshot.
+ :attr str name: The user-defined name for this snapshot.
:attr str resource_type: The resource type.
"""
def __init__(self,
- address: str,
+ crn: str,
href: str,
id: str,
name: str,
resource_type: str,
*,
- deleted: 'ReservedIPReferenceDeleted' = None) -> None:
+ deleted: 'SnapshotReferenceDeleted' = None) -> None:
"""
- Initialize a ReservedIPReference object.
+ Initialize a SnapshotReference object.
- :param str address: The IP address.
- If the address has not yet been selected, the value will be `0.0.0.0`.
- This property may add support for IPv6 addresses in the future. When
- processing a value in this property, verify that the address is in an
- expected format. If it is not, log an error. Optionally halt processing and
- surface the error, or bypass the resource on which the unexpected IP
- address format was encountered.
- :param str href: The URL for this reserved IP.
- :param str id: The unique identifier for this reserved IP.
- :param str name: The user-defined or system-provided name for this reserved
- IP.
+ :param str crn: The CRN for this snapshot.
+ :param str href: The URL for this snapshot.
+ :param str id: The unique identifier for this snapshot.
+ :param str name: The user-defined name for this snapshot.
:param str resource_type: The resource type.
- :param ReservedIPReferenceDeleted 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.
"""
- self.address = address
+ self.crn = crn
self.deleted = deleted
self.href = href
self.id = id
@@ -42412,43 +51305,43 @@ def __init__(self,
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) -> 'SnapshotReference':
+ """Initialize a SnapshotReference object from a json dictionary."""
args = {}
- if 'address' in _dict:
- args['address'] = _dict.get('address')
+ if 'crn' in _dict:
+ args['crn'] = _dict.get('crn')
else:
- raise ValueError('Required property \'address\' not present in ReservedIPReference JSON')
+ raise ValueError('Required property \'crn\' not present in SnapshotReference JSON')
if 'deleted' in _dict:
- args['deleted'] = ReservedIPReferenceDeleted.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 ReservedIPReference 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 ReservedIPReference JSON')
+ 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 ReservedIPReference JSON')
+ raise ValueError('Required property \'name\' not present in SnapshotReference 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 SnapshotReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPReference 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, '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:
_dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
@@ -42466,16 +51359,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 SnapshotReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ReservedIPReference') -> 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: 'ReservedIPReference') -> bool:
+ def __ne__(self, other: 'SnapshotReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -42483,10 +51376,10 @@ class ResourceTypeEnum(str, Enum):
"""
The resource type.
"""
- SUBNET_RESERVED_IP = 'subnet_reserved_ip'
+ SNAPSHOT = 'snapshot'
-class ReservedIPReferenceDeleted():
+class SnapshotReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -42497,25 +51390,25 @@ class ReservedIPReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a ReservedIPReferenceDeleted object.
+ Initialize a SnapshotReferenceDeleted 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) -> 'SnapshotReferenceDeleted':
+ """Initialize a SnapshotReferenceDeleted 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 SnapshotReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ReservedIPReferenceDeleted object from a json dictionary."""
+ """Initialize a SnapshotReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -42530,278 +51423,220 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this ReservedIPReferenceDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'ReservedIPReferenceDeleted') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class ReservedIPTarget():
- """
- The target of this reserved IP.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a ReservedIPTarget object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['ReservedIPTargetEndpointGatewayReference']))
- raise Exception(msg)
-
-class ReservedIPTargetPrototype():
- """
- The target this reserved IP is to be bound to.
-
- """
-
- 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 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 user-defined name for this resource group.
- """
-
- def __init__(self,
- href: str,
- id: str,
- name: str) -> 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 user-defined name for this resource group.
- """
- self.href = href
- self.id = id
- self.name = name
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'ResourceGroupReference':
- """Initialize a ResourceGroupReference 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 'name' in _dict:
- args['name'] = _dict.get('name')
- else:
- raise ValueError('Required property \'name\' not present in ResourceGroupReference JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, 'href') 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 ResourceGroupReference object."""
+ """Return a `str` version of this SnapshotReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ResourceGroupReference') -> 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: 'ResourceGroupReference') -> bool:
+ def __ne__(self, other: 'SnapshotReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class Route():
+class Subnet():
"""
- Route.
+ Subnet.
- :attr str action: The action to perform with a packet matching the route:
- - `delegate`: delegate to the system's built-in routes
- - `delegate_vpc`: delegate to the system's built-in routes, ignoring
- Internet-bound
- routes
- - `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 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 user-defined name for this route.
- :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 ZoneReference zone: The zone the route applies to. (Traffic from subnets
- in this zone will be
- subject to this route.).
+ :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 user-defined name for this subnet.
+ :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 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 is a part of.
+ :attr ZoneReference zone: The zone this subnet resides in.
"""
def __init__(self,
- action: str,
+ available_ipv4_address_count: int,
created_at: datetime,
- destination: str,
+ crn: str,
href: str,
id: str,
- lifecycle_state: str,
+ ip_version: str,
+ ipv4_cidr_block: str,
name: str,
- next_hop: 'RouteNextHop',
- zone: 'ZoneReference') -> None:
+ network_acl: 'NetworkACLReference',
+ resource_group: 'ResourceGroupReference',
+ routing_table: 'RoutingTableReference',
+ status: str,
+ total_ipv4_address_count: int,
+ vpc: 'VPCReference',
+ zone: 'ZoneReference',
+ *,
+ public_gateway: 'PublicGatewayReference' = None) -> None:
"""
- Initialize a Route object.
+ Initialize a Subnet object.
- :param str action: The action to perform with a packet matching the route:
- - `delegate`: delegate to the system's built-in routes
- - `delegate_vpc`: delegate to the system's built-in routes, ignoring
- Internet-bound
- routes
- - `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 user-defined name for this route.
- :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 ZoneReference zone: The zone the route applies to. (Traffic from
- subnets in this zone will be
- subject to this route.).
+ :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 user-defined name for this subnet.
+ :param NetworkACLReference network_acl: The network ACL for this subnet.
+ :param ResourceGroupReference resource_group: The resource group for this
+ subnet.
+ :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 is a part of.
+ :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.action = action
+ self.available_ipv4_address_count = available_ipv4_address_count
self.created_at = created_at
- self.destination = destination
+ self.crn = crn
self.href = href
self.id = id
- self.lifecycle_state = lifecycle_state
+ self.ip_version = ip_version
+ self.ipv4_cidr_block = ipv4_cidr_block
self.name = name
- self.next_hop = next_hop
+ self.network_acl = network_acl
+ self.public_gateway = public_gateway
+ self.resource_group = resource_group
+ 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) -> 'Route':
- """Initialize a Route object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Subnet':
+ """Initialize a Subnet object from a json dictionary."""
args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
+ if 'available_ipv4_address_count' in _dict:
+ args['available_ipv4_address_count'] = _dict.get('available_ipv4_address_count')
else:
- raise ValueError('Required property \'action\' not present in Route JSON')
+ 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 Route JSON')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
+ 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 \'destination\' not present in Route 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 Route 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 Route JSON')
- if 'lifecycle_state' in _dict:
- args['lifecycle_state'] = _dict.get('lifecycle_state')
+ 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 \'lifecycle_state\' not present in Route JSON')
+ 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 Route JSON')
- if 'next_hop' in _dict:
- args['next_hop'] = _dict.get('next_hop')
+ 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 \'next_hop\' not present in Route JSON')
+ 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')
+ 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 Route JSON')
+ raise ValueError('Required property \'zone\' not present in Subnet JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Route 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, 'action') and self.action is not None:
- _dict['action'] = self.action
+ 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, 'destination') and self.destination is not None:
- _dict['destination'] = self.destination
+ 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, '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, '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, 'network_acl') and self.network_acl is not None:
+ _dict['network_acl'] = self.network_acl.to_dict()
+ if hasattr(self, 'public_gateway') and self.public_gateway is not None:
+ _dict['public_gateway'] = self.public_gateway.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'routing_table') and self.routing_table is not None:
+ _dict['routing_table'] = self.routing_table.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'total_ipv4_address_count') and self.total_ipv4_address_count is not None:
+ _dict['total_ipv4_address_count'] = self.total_ipv4_address_count
+ if hasattr(self, 'vpc') and self.vpc is not None:
+ _dict['vpc'] = self.vpc.to_dict()
if hasattr(self, 'zone') and self.zone is not None:
_dict['zone'] = self.zone.to_dict()
return _dict
@@ -42811,114 +51646,102 @@ 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 Subnet object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Route') -> 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: 'Route') -> bool:
+ def __ne__(self, other: 'Subnet') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class ActionEnum(str, Enum):
+ class IpVersionEnum(str, Enum):
"""
- The action to perform with a packet matching the route:
- - `delegate`: delegate to the system's built-in routes
- - `delegate_vpc`: delegate to the system's built-in routes, ignoring
- Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
+ The IP version(s) supported by this subnet.
"""
- DELEGATE = 'delegate'
- DELEGATE_VPC = 'delegate_vpc'
- DELIVER = 'deliver'
- DROP = 'drop'
+ IPV4 = 'ipv4'
- class LifecycleStateEnum(str, Enum):
+ class StatusEnum(str, Enum):
"""
- The lifecycle state of the route.
+ The status of the subnet.
"""
+ AVAILABLE = 'available'
DELETING = 'deleting'
FAILED = 'failed'
PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
-class RouteCollection():
+class SubnetCollection():
"""
- RouteCollection.
+ SubnetCollection.
- :attr RouteCollectionFirst 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 RouteCollectionNext next: (optional) A link to the next page of resources.
- This property is present for all pages
+ :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[Route] routes: Collection of routes.
+ :attr List[Subnet] subnets: Collection of subnets.
:attr int total_count: The total number of resources across all pages.
"""
def __init__(self,
- first: 'RouteCollectionFirst',
+ first: 'SubnetCollectionFirst',
limit: int,
- routes: List['Route'],
+ subnets: List['Subnet'],
total_count: int,
*,
- next: 'RouteCollectionNext' = None) -> None:
+ next: 'SubnetCollectionNext' = None) -> None:
"""
- Initialize a RouteCollection object.
+ Initialize a SubnetCollection object.
- :param RouteCollectionFirst 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[Route] routes: Collection of routes.
+ :param List[Subnet] subnets: Collection of subnets.
:param int total_count: The total number of resources across all pages.
- :param RouteCollectionNext next: (optional) A link to the next page of
+ :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.routes = routes
+ self.subnets = subnets
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) -> 'SubnetCollection':
+ """Initialize a SubnetCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = RouteCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = SubnetCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in RouteCollection 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 RouteCollection JSON')
+ raise ValueError('Required property \'limit\' not present in SubnetCollection JSON')
if 'next' in _dict:
- args['next'] = RouteCollectionNext.from_dict(_dict.get('next'))
- if 'routes' in _dict:
- args['routes'] = [Route.from_dict(x) for x in _dict.get('routes')]
+ args['next'] = SubnetCollectionNext.from_dict(_dict.get('next'))
+ if 'subnets' in _dict:
+ args['subnets'] = [Subnet.from_dict(x) for x in _dict.get('subnets')]
else:
- raise ValueError('Required property \'routes\' not present in RouteCollection 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 RouteCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in SubnetCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollection object from a json dictionary."""
+ """Initialize a SubnetCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -42930,8 +51753,8 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'routes') and self.routes is not None:
- _dict['routes'] = [x.to_dict() for x in self.routes]
+ if hasattr(self, 'subnets') and self.subnets is not None:
+ _dict['subnets'] = [x.to_dict() for x in self.subnets]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
return _dict
@@ -42941,20 +51764,20 @@ 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 SubnetCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollection') -> 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: 'RouteCollection') -> bool:
+ def __ne__(self, other: 'SubnetCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RouteCollectionFirst():
+class SubnetCollectionFirst():
"""
A link to the first page of resources.
@@ -42964,25 +51787,25 @@ class RouteCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a RouteCollectionFirst 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) -> 'RouteCollectionFirst':
- """Initialize a RouteCollectionFirst 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 RouteCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in SubnetCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollectionFirst object from a json dictionary."""
+ """Initialize a SubnetCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -42997,20 +51820,20 @@ 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 SubnetCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollectionFirst') -> 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: 'RouteCollectionFirst') -> bool:
+ def __ne__(self, other: 'SubnetCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RouteCollectionNext():
+class SubnetCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -43021,25 +51844,25 @@ class RouteCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a RouteCollectionNext 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) -> 'RouteCollectionNext':
- """Initialize a RouteCollectionNext 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 RouteCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in SubnetCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteCollectionNext object from a json dictionary."""
+ """Initialize a SubnetCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -43054,79 +51877,92 @@ 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 SubnetCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteCollectionNext') -> 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: 'RouteCollectionNext') -> bool:
+ def __ne__(self, other: 'SubnetCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-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 RouteNextHopPrototype():
+class SubnetIdentity():
"""
- The next hop packets will be routed to.
+ Identifies a subnet by a unique property.
"""
def __init__(self) -> None:
"""
- Initialize a RouteNextHopPrototype object.
+ Initialize a SubnetIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RouteNextHopPrototypeRouteNextHopIP', 'RouteNextHopPrototypeVPNGatewayConnectionIdentity']))
+ ", ".join(['SubnetIdentityById', 'SubnetIdentityByCRN', 'SubnetIdentityByHref']))
raise Exception(msg)
-class RoutePatch():
+class SubnetPatch():
"""
- RoutePatch.
+ SubnetPatch.
- :attr str name: (optional) The user-defined name for this route. Names must be
- unique within the VPC routing table the route resides in.
+ :attr str name: (optional) The user-defined name for this subnet. Names must be
+ unique within the VPC the subnet resides in.
+ :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_transit_gateway_ingress`, and
+ `route_vpc_zone_ingress` must be `false`.
"""
def __init__(self,
*,
- name: str = None) -> None:
+ name: str = None,
+ network_acl: 'NetworkACLIdentity' = None,
+ public_gateway: 'SubnetPublicGatewayPatch' = None,
+ routing_table: 'RoutingTableIdentity' = None) -> None:
"""
- Initialize a RoutePatch object.
+ Initialize a SubnetPatch object.
- :param str name: (optional) The user-defined name for this route. Names
- must be unique within the VPC routing table the route resides in.
+ :param str name: (optional) The user-defined name for this subnet. Names
+ must be unique within the VPC the subnet resides in.
+ :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_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) -> 'RoutePatch':
- """Initialize a RoutePatch 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 RoutePatch object from a json dictionary."""
+ """Initialize a SubnetPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -43134,6 +51970,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):
@@ -43141,225 +51992,173 @@ 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 SubnetPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutePatch') -> 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: 'RoutePatch') -> bool:
+ def __ne__(self, other: 'SubnetPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RoutePrototype():
+class SubnetPrototype():
"""
- RoutePrototype.
+ SubnetPrototype.
- :attr str action: (optional) The action to perform with a packet matching the
- route:
- - `delegate`: delegate to the system's built-in routes
- - `delegate_vpc`: delegate to the system's built-in routes, ignoring
- Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- :attr str destination: The destination of the route. At most two routes per
- `zone` in a table can have the same destination, and only if both routes have an
- `action` of `deliver` and the
- `next_hop` is an IP address.
- :attr str name: (optional) The user-defined name for this route. If unspecified,
- the name will be a hyphenated list of randomly-selected words. Names must be
- unique within the VPC routing table the route resides in.
- :attr RouteNextHopPrototype 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`.
- :attr ZoneIdentity zone: The zone to apply the route to. (Traffic from subnets
- in this zone will be
- subject to this route.).
+ :attr str ip_version: (optional) The IP version(s) to support for this subnet.
+ :attr str name: (optional) The user-defined name for this subnet. Names must be
+ unique within the VPC the subnet resides in. If unspecified, the name will be a
+ hyphenated list of randomly-selected words.
+ :attr 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_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`.
+ :attr VPCIdentity vpc: The VPC the subnet is to be a part of.
"""
def __init__(self,
- destination: str,
- zone: 'ZoneIdentity',
+ vpc: 'VPCIdentity',
*,
- action: str = None,
+ ip_version: str = None,
name: str = None,
- next_hop: 'RouteNextHopPrototype' = None) -> None:
+ network_acl: 'NetworkACLIdentity' = None,
+ public_gateway: 'PublicGatewayIdentity' = None,
+ resource_group: 'ResourceGroupIdentity' = None,
+ routing_table: 'RoutingTableIdentity' = None) -> None:
"""
- Initialize a RoutePrototype object.
+ Initialize a SubnetPrototype object.
- :param str destination: The destination of the route. At most two routes
- per `zone` in a table can have the same destination, and only if both
- routes have an `action` of `deliver` and the
- `next_hop` is an IP address.
- :param ZoneIdentity zone: The zone to apply the route to. (Traffic from
- subnets in this zone will be
- subject to this route.).
- :param str action: (optional) The action to perform with a packet matching
- the route:
- - `delegate`: delegate to the system's built-in routes
- - `delegate_vpc`: delegate to the system's built-in routes, ignoring
- Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
- :param str name: (optional) The user-defined name for this route. If
- unspecified, the name will be a hyphenated list of randomly-selected words.
- Names must be unique within the VPC routing table the route resides in.
- :param RouteNextHopPrototype next_hop: (optional) If `action` is `deliver`,
- the next hop that packets will be delivered to. For
- other `action` values, it must be omitted or specified as `0.0.0.0`.
+ :param VPCIdentity vpc: The VPC the subnet is to be a part of.
+ :param str ip_version: (optional) The IP version(s) to support for this
+ subnet.
+ :param str name: (optional) The user-defined name for this subnet. Names
+ must be unique within the VPC the subnet resides in. If unspecified, the
+ name will be a hyphenated list of randomly-selected words.
+ :param 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_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be
+ `false`.
"""
- self.action = action
- self.destination = destination
- self.name = name
- self.next_hop = next_hop
- self.zone = zone
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutePrototype':
- """Initialize a RoutePrototype object from a json dictionary."""
- args = {}
- if 'action' in _dict:
- args['action'] = _dict.get('action')
- if 'destination' in _dict:
- args['destination'] = _dict.get('destination')
- 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 'zone' in _dict:
- args['zone'] = _dict.get('zone')
- else:
- raise ValueError('Required property \'zone\' not present in RoutePrototype JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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['next_hop'] = self.next_hop.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
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['SubnetPrototypeSubnetByTotalCount', 'SubnetPrototypeSubnetByCIDR']))
+ raise Exception(msg)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ class IpVersionEnum(str, Enum):
+ """
+ The IP version(s) to support for this subnet.
+ """
+ IPV4 = 'ipv4'
- def __str__(self) -> str:
- """Return a `str` version of this RoutePrototype object."""
- return json.dumps(self.to_dict(), indent=2)
- 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__
+class SubnetPublicGatewayPatch():
+ """
+ The public gateway to use for internet-bound traffic for this subnet.
- 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 the system's built-in routes
- - `delegate_vpc`: delegate to the system's built-in routes, ignoring
- Internet-bound
- routes
- - `deliver`: deliver the packet to the specified `next_hop`
- - `drop`: drop the packet.
+ def __init__(self) -> None:
"""
- DELEGATE = 'delegate'
- DELEGATE_VPC = 'delegate_vpc'
- DELIVER = 'deliver'
- DROP = 'drop'
+ 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 RouteReference():
+class SubnetReference():
"""
- RouteReference.
+ SubnetReference.
- :attr RouteReferenceDeleted deleted: (optional) If present, this property
+ :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 route.
- :attr str id: The unique identifier for this route.
- :attr str name: The user-defined name for this route.
+ :attr str href: The URL for this subnet.
+ :attr str id: The unique identifier for this subnet.
+ :attr str name: The user-defined name for this subnet.
"""
def __init__(self,
+ crn: str,
href: str,
id: str,
name: str,
*,
- deleted: 'RouteReferenceDeleted' = None) -> None:
+ deleted: 'SubnetReferenceDeleted' = None) -> None:
"""
- Initialize a RouteReference object.
+ Initialize a SubnetReference object.
- :param str href: The URL for this route.
- :param str id: The unique identifier for this route.
- :param str name: The user-defined name for this route.
- :param RouteReferenceDeleted deleted: (optional) If present, this property
+ :param str crn: The CRN for this subnet.
+ :param str href: The URL for this subnet.
+ :param str id: The unique identifier for this subnet.
+ :param str name: The user-defined name for this subnet.
+ :param SubnetReferenceDeleted 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) -> 'RouteReference':
- """Initialize a RouteReference 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 SubnetReference JSON')
if 'deleted' in _dict:
- args['deleted'] = RouteReferenceDeleted.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 RouteReference 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 RouteReference 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 RouteReference JSON')
+ raise ValueError('Required property \'name\' not present in SubnetReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteReference object from a json dictionary."""
+ """Initialize a SubnetReference object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
"""Return a json dictionary representing this model."""
_dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
_dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
@@ -43375,20 +52174,20 @@ 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 SubnetReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteReference') -> 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: 'RouteReference') -> bool:
+ def __ne__(self, other: 'SubnetReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RouteReferenceDeleted():
+class SubnetReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -43399,25 +52198,25 @@ class RouteReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a RouteReferenceDeleted 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) -> 'RouteReferenceDeleted':
- """Initialize a RouteReferenceDeleted 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 RouteReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in SubnetReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RouteReferenceDeleted object from a json dictionary."""
+ """Initialize a SubnetReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -43432,215 +52231,252 @@ 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 SubnetReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RouteReferenceDeleted') -> 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: 'RouteReferenceDeleted') -> bool:
+ def __ne__(self, other: 'SubnetReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RoutingTable():
+class VCPU():
"""
- RoutingTable.
+ The VCPU configuration.
- :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 user-defined name for this routing table.
- :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 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.
- :attr bool route_transit_gateway_ingress: Indicates whether this routing table
- is used to route traffic that originates from from [Transit
- Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address within the VPC's address prefix ranges. Therefore,
- if an incoming packet matches a route with a `next_hop` of an internet-bound IP
- address or a VPN gateway connection, the packet will be dropped.
- :attr bool route_vpc_zone_ingress: Indicates whether this routing table is used
- to route traffic that originates from subnets in other zones in this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop` unless the
- `next_hop` is an IP address within the VPC's address prefix ranges. Therefore,
- if an incoming packet matches a route with a `next_hop` of an internet-bound IP
- address or a VPN gateway connection, the packet will be dropped.
- :attr List[RouteReference] routes: The routes for this routing table.
- :attr List[SubnetReference] subnets: The subnets to which this routing table is
- attached.
+ :attr str architecture: The VCPU architecture.
+ :attr int count: The number of VCPUs assigned.
+ """
+
+ def __init__(self,
+ architecture: str,
+ count: int) -> None:
+ """
+ Initialize a VCPU object.
+
+ :param str architecture: The VCPU architecture.
+ :param int count: The number of VCPUs assigned.
+ """
+ self.architecture = architecture
+ self.count = count
+
+ @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')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this VCPU object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'VCPU') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class VPC():
+ """
+ VPC.
+
+ :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
+ to use for network interfaces created in this VPC.
+ :attr str href: The URL for this VPC.
+ :attr str id: The unique identifier for this VPC.
+ :attr str name: The unique user-defined name for this VPC.
+ :attr ResourceGroupReference resource_group: The resource group for this VPC.
+ :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,
- is_default: bool,
- lifecycle_state: str,
name: str,
- resource_type: str,
- route_direct_link_ingress: bool,
- route_transit_gateway_ingress: bool,
- route_vpc_zone_ingress: bool,
- routes: List['RouteReference'],
- subnets: List['SubnetReference']) -> None:
+ resource_group: 'ResourceGroupReference',
+ status: str,
+ *,
+ cse_source_ips: List['VPCCSESourceIP'] = None) -> None:
"""
- Initialize a RoutingTable object.
+ Initialize a VPC object.
- :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 user-defined name for this routing table.
- :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 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.
- :param bool route_transit_gateway_ingress: Indicates whether this routing
- table is used to route traffic that originates from from [Transit
- Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address within the VPC's address prefix
- ranges. Therefore, if an incoming packet matches a route with a `next_hop`
- of an internet-bound IP address or a VPN gateway connection, the packet
- will be dropped.
- :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
+ :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 to use for network interfaces created in this VPC.
+ :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The unique user-defined name for this VPC.
+ :param ResourceGroupReference resource_group: The resource group for this
VPC.
- Incoming traffic will be routed according to the routing table with one
- exception: routes with an `action` of `deliver` are treated as `drop`
- unless the `next_hop` is an IP address within the VPC's address prefix
- ranges. Therefore, if an incoming packet matches a route with a `next_hop`
- of an internet-bound IP address or a VPN gateway connection, the packet
- will be dropped.
- :param List[RouteReference] routes: The routes for this routing table.
- :param List[SubnetReference] subnets: The subnets to which this routing
- table is attached.
+ :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.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.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_transit_gateway_ingress = route_transit_gateway_ingress
- self.route_vpc_zone_ingress = route_vpc_zone_ingress
- self.routes = routes
- self.subnets = subnets
+ self.resource_group = resource_group
+ self.status = status
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutingTable':
- """Initialize a RoutingTable object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPC':
+ """Initialize a VPC object from a json dictionary."""
args = {}
+ 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 RoutingTable JSON')
+ 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(x) for x 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 RoutingTable JSON')
+ 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 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 VPC JSON')
if 'name' in _dict:
args['name'] = _dict.get('name')
else:
- 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 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_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(x) for x in _dict.get('routes')]
+ 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 \'routes\' not present in RoutingTable JSON')
- if 'subnets' in _dict:
- args['subnets'] = [SubnetReference.from_dict(x) for x in _dict.get('subnets')]
+ raise ValueError('Required property \'resource_group\' not present in VPC JSON')
+ if 'status' in _dict:
+ args['status'] = _dict.get('status')
else:
- raise ValueError('Required property \'subnets\' not present in RoutingTable JSON')
+ raise ValueError('Required property \'status\' not present in VPC JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTable 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, '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:
+ _dict['cse_source_ips'] = [x.to_dict() for x in self.cse_source_ips]
+ if hasattr(self, 'default_network_acl') and self.default_network_acl is not None:
+ _dict['default_network_acl'] = self.default_network_acl.to_dict()
+ if hasattr(self, 'default_routing_table') and self.default_routing_table is not None:
+ _dict['default_routing_table'] = self.default_routing_table.to_dict()
+ if hasattr(self, 'default_security_group') and self.default_security_group is not None:
+ _dict['default_security_group'] = self.default_security_group.to_dict()
if hasattr(self, 'href') 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_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:
- _dict['routes'] = [x.to_dict() for x in self.routes]
- if hasattr(self, 'subnets') and self.subnets is not None:
- _dict['subnets'] = [x.to_dict() for x in self.subnets]
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
return _dict
def _to_dict(self):
@@ -43648,106 +52484,163 @@ 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 VPC object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTable') -> 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: 'RoutingTable') -> bool:
+ def __ne__(self, other: 'VPC') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class LifecycleStateEnum(str, Enum):
+ class StatusEnum(str, Enum):
"""
- The lifecycle state of the routing table.
+ The status of this VPC.
"""
+ AVAILABLE = 'available'
DELETING = 'deleting'
FAILED = 'failed'
PENDING = 'pending'
- STABLE = 'stable'
- SUSPENDED = 'suspended'
- UPDATING = 'updating'
- WAITING = 'waiting'
- class ResourceTypeEnum(str, Enum):
+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:
"""
- The resource type.
+ 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.
"""
- ROUTING_TABLE = 'routing_table'
+ 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)
-class RoutingTableCollection():
+ @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:
+ _dict['ip'] = self.ip.to_dict()
+ if hasattr(self, 'zone') and self.zone is not None:
+ _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__
+
+ def __ne__(self, other: 'VPCCSESourceIP') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class VPCCollection():
"""
- RoutingTableCollection.
+ VPCCollection.
- :attr RoutingTableCollectionFirst 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 RoutingTableCollectionNext 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[RoutingTable] routing_tables: Collection of routing tables.
:attr int total_count: The total number of resources across all pages.
+ :attr List[VPC] vpcs: Collection of VPCs.
"""
def __init__(self,
- first: 'RoutingTableCollectionFirst',
+ first: 'VPCCollectionFirst',
limit: int,
- routing_tables: List['RoutingTable'],
total_count: int,
+ vpcs: List['VPC'],
*,
- next: 'RoutingTableCollectionNext' = None) -> None:
+ next: 'VPCCollectionNext' = None) -> None:
"""
- Initialize a RoutingTableCollection object.
+ Initialize a VPCCollection object.
- :param RoutingTableCollectionFirst 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[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
+ :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.routing_tables = routing_tables
self.total_count = total_count
+ self.vpcs = vpcs
@classmethod
- def from_dict(cls, _dict: Dict) -> 'RoutingTableCollection':
- """Initialize a RoutingTableCollection 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'] = RoutingTableCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = VPCCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in RoutingTableCollection 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 RoutingTableCollection JSON')
+ raise ValueError('Required property \'limit\' not present in VPCCollection JSON')
if 'next' in _dict:
- args['next'] = RoutingTableCollectionNext.from_dict(_dict.get('next'))
- if 'routing_tables' in _dict:
- args['routing_tables'] = [RoutingTable.from_dict(x) for x in _dict.get('routing_tables')]
- else:
- raise ValueError('Required property \'routing_tables\' not present in RoutingTableCollection 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 RoutingTableCollection JSON')
+ raise ValueError('Required property \'total_count\' not present in VPCCollection JSON')
+ if 'vpcs' in _dict:
+ args['vpcs'] = [VPC.from_dict(x) for x in _dict.get('vpcs')]
+ else:
+ raise ValueError('Required property \'vpcs\' not present in VPCCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableCollection object from a json dictionary."""
+ """Initialize a VPCCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -43759,10 +52652,10 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'routing_tables') and self.routing_tables is not None:
- _dict['routing_tables'] = [x.to_dict() for x in self.routing_tables]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
+ if hasattr(self, 'vpcs') and self.vpcs is not None:
+ _dict['vpcs'] = [x.to_dict() for x in self.vpcs]
return _dict
def _to_dict(self):
@@ -43770,20 +52663,20 @@ 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 VPCCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableCollection') -> 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: 'RoutingTableCollection') -> bool:
+ def __ne__(self, other: 'VPCCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RoutingTableCollectionFirst():
+class VPCCollectionFirst():
"""
A link to the first page of resources.
@@ -43793,25 +52686,25 @@ class RoutingTableCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a RoutingTableCollectionFirst 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) -> 'RoutingTableCollectionFirst':
- """Initialize a RoutingTableCollectionFirst 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 RoutingTableCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in VPCCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableCollectionFirst object from a json dictionary."""
+ """Initialize a VPCCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -43826,20 +52719,20 @@ 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 VPCCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableCollectionFirst') -> 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: 'RoutingTableCollectionFirst') -> bool:
+ def __ne__(self, other: 'VPCCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RoutingTableCollectionNext():
+class VPCCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -43850,25 +52743,25 @@ class RoutingTableCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a RoutingTableCollectionNext 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) -> 'RoutingTableCollectionNext':
- """Initialize a RoutingTableCollectionNext 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 RoutingTableCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in VPCCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableCollectionNext object from a json dictionary."""
+ """Initialize a VPCCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -43883,155 +52776,62 @@ 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 VPCCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableCollectionNext') -> 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: 'RoutingTableCollectionNext') -> bool:
+ def __ne__(self, other: 'VPCCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RoutingTableIdentity():
+class VPCIdentity():
"""
- Identifies a routing table by a unique property.
+ Identifies a VPC by a unique property.
"""
def __init__(self) -> None:
"""
- Initialize a RoutingTableIdentity object.
+ Initialize a VPCIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['RoutingTableIdentityById', 'RoutingTableIdentityByHref']))
+ ", ".join(['VPCIdentityById', 'VPCIdentityByCRN', 'VPCIdentityByHref']))
raise Exception(msg)
-class RoutingTablePatch():
+class VPCPatch():
"""
- RoutingTablePatch.
+ VPCPatch.
- :attr str name: (optional) The user-defined name for this routing table. Names
- must be unique within the VPC the routing table resides in.
- :attr 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 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.
- :attr bool route_transit_gateway_ingress: (optional) Indicates whether this
- routing table is used to route traffic that originates from
- [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this VPC.
- 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 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.
- 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 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.
+ :attr str name: (optional) The unique user-defined name for this VPC.
"""
def __init__(self,
*,
- name: str = None,
- route_direct_link_ingress: bool = None,
- route_transit_gateway_ingress: bool = None,
- route_vpc_zone_ingress: bool = None) -> None:
+ name: str = None) -> None:
"""
- Initialize a RoutingTablePatch object.
+ Initialize a VPCPatch object.
- :param str name: (optional) The user-defined name for this routing table.
- Names must be unique within the VPC the routing table resides in.
- :param 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 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.
- :param bool route_transit_gateway_ingress: (optional) Indicates whether
- this routing table is used to route traffic that originates from
- [Transit Gateway](https://cloud.ibm.com/cloud/transit-gateway/) to this
- VPC. Updating to
- `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 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.
- 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 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.
+ :param str name: (optional) The unique user-defined name for this VPC.
"""
self.name = name
- self.route_direct_link_ingress = route_direct_link_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) -> 'RoutingTablePatch':
- """Initialize a RoutingTablePatch object from a json dictionary."""
+ 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')
- if 'route_direct_link_ingress' in _dict:
- args['route_direct_link_ingress'] = _dict.get('route_direct_link_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."""
+ """Initialize a VPCPatch object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -44039,12 +52839,6 @@ def to_dict(self) -> Dict:
_dict = {}
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_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):
@@ -44052,88 +52846,90 @@ 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 VPCPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTablePatch') -> bool:
+ 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: 'RoutingTablePatch') -> bool:
+ def __ne__(self, other: 'VPCPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class RoutingTableReference():
+class VPCReference():
"""
- RoutingTableReference.
+ VPCReference.
- :attr RoutingTableReferenceDeleted deleted: (optional) If present, this property
+ :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 routing table.
- :attr str id: The unique identifier for this routing table.
- :attr str name: The user-defined name for this routing table.
- :attr str resource_type: The resource type.
+ :attr str href: The URL for this VPC.
+ :attr str id: The unique identifier for this VPC.
+ :attr str name: The unique user-defined name for this VPC.
"""
def __init__(self,
+ crn: str,
href: str,
id: str,
name: str,
- resource_type: str,
*,
- deleted: 'RoutingTableReferenceDeleted' = None) -> None:
+ deleted: 'VPCReferenceDeleted' = None) -> None:
"""
- Initialize a RoutingTableReference object.
+ Initialize a VPCReference object.
- :param str href: The URL for this routing table.
- :param str id: The unique identifier for this routing table.
- :param str name: The user-defined name for this routing table.
- :param str resource_type: The resource type.
- :param RoutingTableReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted and provides
+ :param str crn: The CRN for this VPC.
+ :param str href: The URL for this VPC.
+ :param str id: The unique identifier for this VPC.
+ :param str name: The unique user-defined name for this VPC.
+ :param VPCReferenceDeleted 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) -> 'RoutingTableReference':
- """Initialize a RoutingTableReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPCReference':
+ """Initialize a VPCReference 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'] = RoutingTableReferenceDeleted.from_dict(_dict.get('deleted'))
+ 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 RoutingTableReference 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 RoutingTableReference 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 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')
+ raise ValueError('Required property \'name\' not present in VPCReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableReference 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, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
_dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
@@ -44142,8 +52938,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):
@@ -44151,27 +52945,20 @@ 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 VPCReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableReference') -> 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: 'RoutingTableReference') -> bool:
+ def __ne__(self, other: 'VPCReference') -> 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 RoutingTableReferenceDeleted():
+class VPCReferenceDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -44182,25 +52969,25 @@ class RoutingTableReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a RoutingTableReferenceDeleted object.
+ Initialize a VPCReferenceDeleted 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."""
+ 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 RoutingTableReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in VPCReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a RoutingTableReferenceDeleted object from a json dictionary."""
+ """Initialize a VPCReferenceDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -44215,250 +53002,156 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this RoutingTableReferenceDeleted object."""
+ """Return a `str` version of this VPCReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'RoutingTableReferenceDeleted') -> bool:
+ 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: 'RoutingTableReferenceDeleted') -> bool:
+ def __ne__(self, other: 'VPCReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroup():
+class VPNGateway():
"""
- SecurityGroup.
+ VPNGateway.
- :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 user-defined name for this security group. Names must be
- unique within the VPC the security group resides in.
- :attr List[NetworkInterfaceReference] network_interfaces: The network interfaces
- for this security group.
- :attr ResourceGroupReference resource_group: The resource group for this
- security group.
- :attr List[SecurityGroupRule] rules: The rules for this security group. If no
- rules exist, all traffic will be denied.
- :attr List[SecurityGroupTargetReference] targets: The targets for this security
- group.
- :attr VPCReference vpc: The VPC this security group is a part of.
+ :attr 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 user-defined name for this VPN gateway.
+ :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:
"""
def __init__(self,
+ connections: List['VPNGatewayConnectionReference'],
created_at: datetime,
crn: str,
href: str,
id: str,
+ members: List['VPNGatewayMember'],
name: str,
- network_interfaces: List['NetworkInterfaceReference'],
resource_group: 'ResourceGroupReference',
- rules: List['SecurityGroupRule'],
- targets: List['SecurityGroupTargetReference'],
- vpc: 'VPCReference') -> None:
+ resource_type: str,
+ status: str,
+ subnet: 'SubnetReference') -> None:
"""
- Initialize a SecurityGroup object.
+ Initialize a VPNGateway object.
- :param datetime created_at: The date and time that this security group was
+ :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 security group's CRN.
- :param str href: The security group's canonical URL.
- :param str id: The unique identifier for this security group.
- :param str name: The user-defined name for this security group. Names must
- be unique within the VPC the security group resides in.
- :param List[NetworkInterfaceReference] network_interfaces: The network
- interfaces for this security group.
+ :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 user-defined name for this VPN gateway.
: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 is a part of.
+ VPN gateway.
+ :param str resource_type: The resource type.
+ :param str status: The status of the VPN gateway.
+ :param SubnetReference subnet:
"""
- self.created_at = created_at
- self.crn = crn
- self.href = href
- self.id = id
- self.name = name
- self.network_interfaces = network_interfaces
- self.resource_group = resource_group
- self.rules = rules
- self.targets = targets
- self.vpc = vpc
-
- @classmethod
- 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 SecurityGroup JSON')
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
- else:
- 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 SecurityGroup JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- 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 SecurityGroup JSON')
- if 'network_interfaces' in _dict:
- args['network_interfaces'] = [NetworkInterfaceReference.from_dict(x) for x in _dict.get('network_interfaces')]
- else:
- raise ValueError('Required property \'network_interfaces\' not present in SecurityGroup JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
- else:
- raise ValueError('Required property \'resource_group\' not present in SecurityGroup JSON')
- if 'rules' in _dict:
- args['rules'] = [SecurityGroupRule.from_dict(x) for x in _dict.get('rules')]
- else:
- raise ValueError('Required property \'rules\' not present in SecurityGroup JSON')
- if 'targets' in _dict:
- args['targets'] = _dict.get('targets')
- else:
- 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 SecurityGroup JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a SecurityGroup object from 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, 'network_interfaces') and self.network_interfaces is not None:
- _dict['network_interfaces'] = [x.to_dict() for x in self.network_interfaces]
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'rules') and self.rules is not None:
- _dict['rules'] = [x.to_dict() for x in self.rules]
- if hasattr(self, 'targets') and self.targets is not None:
- targets_list = []
- for x in self.targets:
- if isinstance(x, dict):
- targets_list.append(x)
- else:
- targets_list.append(x.to_dict())
- _dict['targets'] = targets_list
- if hasattr(self, 'vpc') and self.vpc is not None:
- _dict['vpc'] = self.vpc.to_dict()
- return _dict
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNGatewayRouteMode', 'VPNGatewayPolicyMode']))
+ raise Exception(msg)
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ VPN_GATEWAY = 'vpn_gateway'
- def __str__(self) -> str:
- """Return a `str` version of this SecurityGroup object."""
- return json.dumps(self.to_dict(), indent=2)
- 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__
+ class StatusEnum(str, Enum):
+ """
+ The status of the VPN gateway.
+ """
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
- def __ne__(self, other: 'SecurityGroup') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class SecurityGroupCollection():
+class VPNGatewayCollection():
"""
- SecurityGroupCollection.
+ VPNGatewayCollection.
- :attr SecurityGroupCollectionFirst first: A link to the first page of resources.
+ :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 SecurityGroupCollectionNext next: (optional) A link to the next page of
+ :attr VPNGatewayCollectionNext 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 int total_count: The total number of resources across all pages.
+ :attr List[VPNGateway] vpn_gateways: Collection of VPN gateways.
"""
def __init__(self,
- first: 'SecurityGroupCollectionFirst',
+ first: 'VPNGatewayCollectionFirst',
limit: int,
- security_groups: List['SecurityGroup'],
total_count: int,
+ vpn_gateways: List['VPNGateway'],
*,
- next: 'SecurityGroupCollectionNext' = None) -> None:
+ next: 'VPNGatewayCollectionNext' = None) -> None:
"""
- Initialize a SecurityGroupCollection object.
+ Initialize a VPNGatewayCollection object.
- :param SecurityGroupCollectionFirst first: A link to the first page of
+ :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 List[SecurityGroup] security_groups: Collection of security groups.
:param int total_count: The total number of resources across all pages.
- :param SecurityGroupCollectionNext next: (optional) A link to the next page
- of resources. This property is present for all pages
+ :param 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.first = first
self.limit = limit
self.next = next
- self.security_groups = security_groups
self.total_count = total_count
+ self.vpn_gateways = vpn_gateways
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupCollection':
- """Initialize a SecurityGroupCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollection':
+ """Initialize a VPNGatewayCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = SecurityGroupCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = VPNGatewayCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in SecurityGroupCollection JSON')
+ raise ValueError('Required property \'first\' not present in VPNGatewayCollection 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 VPNGatewayCollection JSON')
if 'next' in _dict:
- args['next'] = SecurityGroupCollectionNext.from_dict(_dict.get('next'))
- if 'security_groups' in _dict:
- args['security_groups'] = [SecurityGroup.from_dict(x) for x in _dict.get('security_groups')]
- else:
- raise ValueError('Required property \'security_groups\' not present in SecurityGroupCollection JSON')
+ 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 \'total_count\' not present in SecurityGroupCollection 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 SecurityGroupCollection object from a json dictionary."""
+ """Initialize a VPNGatewayCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -44470,10 +53163,16 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'security_groups') and self.security_groups is not None:
- _dict['security_groups'] = [x.to_dict() for x in self.security_groups]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
+ if hasattr(self, 'vpn_gateways') and self.vpn_gateways is not None:
+ vpn_gateways_list = []
+ for x in self.vpn_gateways:
+ if isinstance(x, dict):
+ vpn_gateways_list.append(x)
+ else:
+ vpn_gateways_list.append(x.to_dict())
+ _dict['vpn_gateways'] = vpn_gateways_list
return _dict
def _to_dict(self):
@@ -44481,20 +53180,20 @@ 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 VPNGatewayCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupCollection') -> 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: 'SecurityGroupCollection') -> bool:
+ def __ne__(self, other: 'VPNGatewayCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupCollectionFirst():
+class VPNGatewayCollectionFirst():
"""
A link to the first page of resources.
@@ -44504,25 +53203,25 @@ class SecurityGroupCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a SecurityGroupCollectionFirst object.
+ Initialize a VPNGatewayCollectionFirst 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) -> 'VPNGatewayCollectionFirst':
+ """Initialize a VPNGatewayCollectionFirst 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 VPNGatewayCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupCollectionFirst object from a json dictionary."""
+ """Initialize a VPNGatewayCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -44537,20 +53236,20 @@ 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 VPNGatewayCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupCollectionFirst') -> 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: 'SecurityGroupCollectionFirst') -> bool:
+ def __ne__(self, other: 'VPNGatewayCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupCollectionNext():
+class VPNGatewayCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -44561,25 +53260,25 @@ class SecurityGroupCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a SecurityGroupCollectionNext object.
+ Initialize a VPNGatewayCollectionNext 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) -> 'VPNGatewayCollectionNext':
+ """Initialize a VPNGatewayCollectionNext 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 VPNGatewayCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupCollectionNext object from a json dictionary."""
+ """Initialize a VPNGatewayCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -44594,172 +53293,166 @@ 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 VPNGatewayCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupCollectionNext') -> 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: 'SecurityGroupCollectionNext') -> bool:
+ def __ne__(self, other: 'VPNGatewayCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupIdentity():
+class VPNGatewayConnection():
"""
- Identifies a security group by a unique property.
+ VPNGatewayConnection.
+ :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 user-defined name for this VPN gateway connection.
+ :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.
"""
- def __init__(self) -> None:
+ 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) -> None:
"""
- Initialize a SecurityGroupIdentity object.
+ 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 user-defined name for this VPN gateway connection.
+ :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(['SecurityGroupIdentityById', 'SecurityGroupIdentityByCRN', 'SecurityGroupIdentityByHref']))
+ ", ".join(['VPNGatewayConnectionStaticRouteMode', 'VPNGatewayConnectionPolicyMode']))
raise Exception(msg)
-class SecurityGroupPatch():
- """
- SecurityGroupPatch.
-
- :attr str name: (optional) The user-defined name for this security group. Names
- must be unique within the VPC the security group resides in.
- """
-
- def __init__(self,
- *,
- name: str = None) -> None:
+ class AuthenticationModeEnum(str, Enum):
"""
- Initialize a SecurityGroupPatch object.
-
- :param str name: (optional) The user-defined name for this security group.
- Names must be unique within the VPC the security group resides in.
+ The authentication mode. Only `psk` is currently supported.
"""
- self.name = name
+ PSK = 'psk'
- @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)
+ class ModeEnum(str, Enum):
+ """
+ The mode of the VPN gateway.
+ """
+ POLICY = 'policy'
+ ROUTE = 'route'
- 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()
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
- 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__
+ class StatusEnum(str, Enum):
+ """
+ The status of a VPN gateway connection.
+ """
+ DOWN = 'down'
+ UP = 'up'
- def __ne__(self, other: 'SecurityGroupPatch') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-class SecurityGroupReference():
+class VPNGatewayConnectionCollection():
"""
- SecurityGroupReference.
+ Collection of VPN gateway connections in a VPN gateway.
- :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 user-defined name for this security group. Names must be
- unique within the VPC the security group resides in.
+ :attr List[VPNGatewayConnection] connections: Array of VPN gateway connections.
"""
def __init__(self,
- crn: str,
- href: str,
- id: str,
- name: str,
- *,
- deleted: 'SecurityGroupReferenceDeleted' = None) -> None:
+ connections: List['VPNGatewayConnection']) -> None:
"""
- Initialize a SecurityGroupReference object.
+ Initialize a VPNGatewayConnectionCollection 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 user-defined name for this security group. Names must
- be unique within the VPC the security group resides in.
- :param SecurityGroupReferenceDeleted deleted: (optional) If present, this
- property indicates the referenced resource has been deleted and provides
- some supplementary information.
+ :param List[VPNGatewayConnection] connections: Array of VPN gateway
+ connections.
"""
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
+ self.connections = connections
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupReference':
- """Initialize a SecurityGroupReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollection':
+ """Initialize a VPNGatewayConnectionCollection 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')
+ if 'connections' in _dict:
+ args['connections'] = _dict.get('connections')
else:
- raise ValueError('Required property \'name\' not present in SecurityGroupReference JSON')
+ raise ValueError('Required property \'connections\' not present in VPNGatewayConnectionCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'connections') and self.connections is not None:
+ connections_list = []
+ for x in self.connections:
+ if isinstance(x, dict):
+ connections_list.append(x)
+ else:
+ connections_list.append(x.to_dict())
+ _dict['connections'] = connections_list
return _dict
def _to_dict(self):
@@ -44767,56 +53460,77 @@ 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 VPNGatewayConnectionCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupReference') -> 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: 'SecurityGroupReference') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupReferenceDeleted():
+class VPNGatewayConnectionDPD():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ The Dead Peer Detection settings.
- :attr str more_info: Link to documentation about deleted 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,
- more_info: str) -> None:
+ action: str,
+ interval: int,
+ timeout: int) -> None:
"""
- Initialize a SecurityGroupReferenceDeleted object.
+ Initialize a VPNGatewayConnectionDPD object.
- :param str more_info: Link to documentation about deleted 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.more_info = more_info
+ self.action = action
+ self.interval = interval
+ self.timeout = timeout
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupReferenceDeleted':
- """Initialize a SecurityGroupReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPD':
+ """Initialize a VPNGatewayConnectionDPD object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if 'action' in _dict:
+ args['action'] = _dict.get('action')
else:
- raise ValueError('Required property \'more_info\' not present in SecurityGroupReferenceDeleted 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 SecurityGroupReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ 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):
@@ -44824,163 +53538,82 @@ 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 VPNGatewayConnectionDPD object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupReferenceDeleted') -> 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: 'SecurityGroupReferenceDeleted') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionDPD') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRule():
- """
- SecurityGroupRule.
-
- :attr str direction: The direction of traffic to enforce, either `inbound` or
- `outbound`.
- :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
- source,
- for outbound rules).
- """
-
- def __init__(self,
- direction: str,
- href: str,
- id: str,
- ip_version: str,
- protocol: str,
- remote: 'SecurityGroupRuleRemote') -> None:
- """
- Initialize a SecurityGroupRule object.
-
- :param str direction: The direction of traffic to enforce, either `inbound`
- or `outbound`.
- :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 source,
- for outbound rules).
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".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)
-
- @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, either `inbound` or `outbound`.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
+ class ActionEnum(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.
+ Dead Peer Detection actions.
"""
- IPV4 = 'ipv4'
+ CLEAR = 'clear'
+ HOLD = 'hold'
+ NONE = 'none'
+ RESTART = 'restart'
-class SecurityGroupRuleCollection():
+class VPNGatewayConnectionDPDPatch():
"""
- Collection of rules in a security group.
+ The Dead Peer Detection settings.
- :attr List[SecurityGroupRule] rules: Array of rules.
+ :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,
- rules: List['SecurityGroupRule']) -> None:
+ *,
+ action: str = None,
+ interval: int = None,
+ timeout: int = None) -> None:
"""
- Initialize a SecurityGroupRuleCollection object.
+ Initialize a VPNGatewayConnectionDPDPatch object.
- :param List[SecurityGroupRule] rules: Array of rules.
+ :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.rules = rules
+ self.action = action
+ self.interval = interval
+ self.timeout = timeout
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRuleCollection':
- """Initialize a SecurityGroupRuleCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPatch':
+ """Initialize a VPNGatewayConnectionDPDPatch object from a json dictionary."""
args = {}
- if 'rules' in _dict:
- args['rules'] = [SecurityGroupRule.from_dict(x) for x in _dict.get('rules')]
- else:
- raise ValueError('Required property \'rules\' not present in SecurityGroupRuleCollection 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 SecurityGroupRuleCollection 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, 'rules') and self.rules is not None:
- _dict['rules'] = [x.to_dict() for x in self.rules]
+ 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):
@@ -44988,141 +53621,82 @@ 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 VPNGatewayConnectionDPDPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRuleCollection') -> 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: 'SecurityGroupRuleCollection') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionDPDPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupRulePatch():
+ class ActionEnum(str, Enum):
+ """
+ Dead Peer Detection actions.
+ """
+ CLEAR = 'clear'
+ HOLD = 'hold'
+ NONE = 'none'
+ RESTART = 'restart'
+
+
+class VPNGatewayConnectionDPDPrototype():
"""
- SecurityGroupRulePatch.
+ The Dead Peer Detection settings.
- :attr int code: (optional) The ICMP traffic code to allow. Specify `null` to
- remove an existing ICMP traffic code value.
- :attr str direction: (optional) The direction of traffic to enforce, either
- `inbound` or `outbound`.
- :attr str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they are
- used. Alternatively, if `remote` references a security group, then this rule
- only applies to IP addresses (network interfaces) in that group matching this IP
- version.
- :attr int port_max: (optional) The inclusive upper bound of the protocol port
- range. Specify `null` to clear an existing upper bound. If a lower bound has
- been set, the upper bound must also be set, and must not be smaller.
- :attr int port_min: (optional) The inclusive lower bound of the protocol port
- range. Specify `null` to clear an existing lower bound. If an upper bound has
- been set, the lower bound must also be set, and must not be larger.
- :attr SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or
- security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR block, or
- a
- security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source
- (or to
- any source, for outbound rules).
- :attr int type: (optional) The ICMP traffic type to allow. Specify `null` to
- remove an existing ICMP traffic type value.
+ :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,
*,
- 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:
+ action: str = None,
+ interval: int = None,
+ timeout: int = None) -> None:
"""
- Initialize a SecurityGroupRulePatch object.
+ Initialize a VPNGatewayConnectionDPDPrototype object.
- :param int code: (optional) The ICMP traffic code to allow. Specify `null`
- to remove an existing ICMP traffic code value.
- :param str direction: (optional) The direction of traffic to enforce,
- either `inbound` or `outbound`.
- :param str ip_version: (optional) The IP version to enforce. The format of
- `remote.address` or `remote.cidr_block` must match this property, if they
- are used. Alternatively, if `remote` references a security group, then this
- rule only applies to IP addresses (network interfaces) in that group
- matching this IP version.
- :param int port_max: (optional) The inclusive upper bound of the protocol
- port range. Specify `null` to clear an existing upper bound. If a lower
- bound has been set, the upper bound must also be set, and must not be
- smaller.
- :param int port_min: (optional) The inclusive lower bound of the protocol
- port range. Specify `null` to clear an existing lower bound. If an upper
- bound has been set, the lower bound must also be set, and must not be
- larger.
- :param SecurityGroupRuleRemotePatch remote: (optional) The IP addresses or
- security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR
- block, or a
- security group. A CIDR block of `0.0.0.0/0` will allow traffic from any
- source (or to
- any source, for outbound rules).
- :param int type: (optional) The ICMP traffic type to allow. Specify `null`
- to remove an existing ICMP traffic type value.
+ :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.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.action = action
+ self.interval = interval
+ self.timeout = timeout
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupRulePatch':
- """Initialize a SecurityGroupRulePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPrototype':
+ """Initialize a VPNGatewayConnectionDPDPrototype 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 '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 SecurityGroupRulePatch 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, '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['remote'] = self.remote.to_dict()
- if hasattr(self, 'type') and self.type is not None:
- _dict['type'] = self.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):
@@ -45130,285 +53704,128 @@ 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 VPNGatewayConnectionDPDPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupRulePatch') -> 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: 'SecurityGroupRulePatch') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionDPDPrototype') -> 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, either `inbound` or `outbound`.
- """
- INBOUND = 'inbound'
- OUTBOUND = 'outbound'
-
-
- class IpVersionEnum(str, Enum):
+ class ActionEnum(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.
+ Dead Peer Detection actions.
"""
- IPV4 = 'ipv4'
+ CLEAR = 'clear'
+ HOLD = 'hold'
+ NONE = 'none'
+ RESTART = 'restart'
-class SecurityGroupRulePrototype():
+class VPNGatewayConnectionIKEPolicyPatch():
"""
- SecurityGroupRulePrototype.
+ 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 str direction: The direction of traffic to enforce, either `inbound` or
- `outbound`.
- :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. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow
- traffic
- from any source (or to any source, for outbound rules).
"""
- def __init__(self,
- direction: str,
- protocol: str,
- *,
- ip_version: str = None,
- remote: 'SecurityGroupRuleRemotePrototype' = None) -> None:
+ def __init__(self) -> None:
"""
- Initialize a SecurityGroupRulePrototype object.
+ Initialize a VPNGatewayConnectionIKEPolicyPatch object.
- :param str direction: The direction of traffic to enforce, either `inbound`
- or `outbound`.
- :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. If omitted, a CIDR block of `0.0.0.0/0` will be used to
- allow traffic
- from any source (or to any source, for outbound rules).
"""
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']))
+ ", ".join(['VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById', 'VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityByHref']))
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, either `inbound` or `outbound`.
- """
- 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 SecurityGroupRuleRemote():
+class VPNGatewayConnectionIKEPolicyPrototype():
"""
- The IP addresses or security groups from which this rule allows traffic (or to which,
- for outbound rules). Can be specified as an IP address, a CIDR block, or a security
- group. A CIDR block of `0.0.0.0/0` allows traffic from any source (or to any source,
- for outbound rules).
+ 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).
"""
def __init__(self) -> None:
"""
- Initialize a SecurityGroupRuleRemote object.
+ Initialize a VPNGatewayConnectionIKEPolicyPrototype object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupRuleRemoteIP', 'SecurityGroupRuleRemoteCIDR', 'SecurityGroupRuleRemoteSecurityGroupReference']))
+ ", ".join(['VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById', 'VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityByHref']))
raise Exception(msg)
-class SecurityGroupRuleRemotePatch():
+class VPNGatewayConnectionIPsecPolicyPatch():
"""
- The IP addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR block, or a
- security group. A CIDR block of `0.0.0.0/0` will allow traffic from any source (or to
- any source, for outbound rules).
+ 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 __init__(self) -> None:
"""
- Initialize a SecurityGroupRuleRemotePatch object.
+ Initialize a VPNGatewayConnectionIPsecPolicyPatch object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupRuleRemotePatchIP', 'SecurityGroupRuleRemotePatchCIDR', 'SecurityGroupRuleRemotePatchSecurityGroupIdentity']))
+ ", ".join(['VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById', 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref']))
raise Exception(msg)
-class SecurityGroupRuleRemotePrototype():
+class VPNGatewayConnectionIPsecPolicyPrototype():
"""
- The IP addresses or security groups from which this rule will allow traffic (or to
- which, for outbound rules). Can be specified as an IP address, a CIDR block, or a
- security group. If omitted, a CIDR block of `0.0.0.0/0` will be used to allow traffic
- from any source (or to any source, for outbound rules).
+ 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 __init__(self) -> None:
"""
- Initialize a SecurityGroupRuleRemotePrototype object.
+ Initialize a VPNGatewayConnectionIPsecPolicyPrototype object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupRuleRemotePrototypeIP', 'SecurityGroupRuleRemotePrototypeCIDR', 'SecurityGroupRuleRemotePrototypeSecurityGroupIdentity']))
+ ", ".join(['VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById', 'VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityByHref']))
raise Exception(msg)
-class SecurityGroupTargetCollection():
+class VPNGatewayConnectionLocalCIDRs():
"""
- SecurityGroupTargetCollection.
+ VPNGatewayConnectionLocalCIDRs.
- :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.
+ :attr List[str] local_cidrs: (optional) The local CIDRs for this resource.
"""
def __init__(self,
- first: 'SecurityGroupTargetCollectionFirst',
- limit: int,
- targets: List['SecurityGroupTargetReference'],
- total_count: int,
*,
- next: 'SecurityGroupTargetCollectionNext' = None) -> None:
+ local_cidrs: List[str] = None) -> None:
"""
- Initialize a SecurityGroupTargetCollection object.
+ Initialize a VPNGatewayConnectionLocalCIDRs object.
- :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.
+ :param List[str] local_cidrs: (optional) The local CIDRs for this resource.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.targets = targets
- self.total_count = total_count
+ self.local_cidrs = local_cidrs
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollection':
- """Initialize a SecurityGroupTargetCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionLocalCIDRs':
+ """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = SecurityGroupTargetCollectionFirst.from_dict(_dict.get('first'))
- else:
- raise ValueError('Required property \'first\' not present in SecurityGroupTargetCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
- else:
- 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 \'targets\' not present in SecurityGroupTargetCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
- else:
- raise ValueError('Required property \'total_count\' not present in SecurityGroupTargetCollection JSON')
+ if 'local_cidrs' in _dict:
+ args['local_cidrs'] = _dict.get('local_cidrs')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetCollection 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'targets') and self.targets is not None:
- targets_list = []
- for x in self.targets:
- if isinstance(x, dict):
- targets_list.append(x)
- else:
- targets_list.append(x.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, 'local_cidrs') and self.local_cidrs is not None:
+ _dict['local_cidrs'] = self.local_cidrs
return _dict
def _to_dict(self):
@@ -45416,112 +53833,106 @@ 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 VPNGatewayConnectionLocalCIDRs object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetCollection') -> 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: 'SecurityGroupTargetCollection') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionLocalCIDRs') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupTargetCollectionFirst():
+class VPNGatewayConnectionPatch():
"""
- A link to the first page of resources.
+ VPNGatewayConnectionPatch.
- :attr str href: The URL for a page of resources.
+ :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 user-defined name for this VPN gateway
+ connection.
+ :attr str peer_address: (optional) The IP address of the peer VPN gateway.
+ :attr str psk: (optional) The preshared key.
"""
def __init__(self,
- href: str) -> 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 SecurityGroupTargetCollectionFirst object.
+ Initialize a VPNGatewayConnectionPatch object.
- :param str href: The URL for a page of resources.
+ :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 user-defined name for this VPN gateway
+ connection.
+ :param str peer_address: (optional) The IP address of the peer VPN gateway.
+ :param str psk: (optional) The preshared key.
"""
- self.href = href
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionFirst':
- """Initialize a SecurityGroupTargetCollectionFirst 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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetCollectionFirst object from a json dictionary."""
- return cls.from_dict(_dict)
-
- def to_dict(self) -> Dict:
- """Return a json dictionary representing this model."""
- _dict = {}
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this SecurityGroupTargetCollectionFirst object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'SecurityGroupTargetCollectionFirst') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch']))
+ raise Exception(msg)
-class SecurityGroupTargetCollectionNext():
+class VPNGatewayConnectionPeerCIDRs():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ VPNGatewayConnectionPeerCIDRs.
- :attr str href: The URL for a page of resources.
+ :attr List[str] peer_cidrs: (optional) The peer CIDRs for this resource.
"""
def __init__(self,
- href: str) -> None:
+ *,
+ peer_cidrs: List[str] = None) -> None:
"""
- Initialize a SecurityGroupTargetCollectionNext object.
+ Initialize a VPNGatewayConnectionPeerCIDRs object.
- :param str href: The URL for a page of resources.
+ :param List[str] peer_cidrs: (optional) The peer CIDRs for this resource.
"""
- self.href = href
+ self.peer_cidrs = peer_cidrs
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'SecurityGroupTargetCollectionNext':
- """Initialize a SecurityGroupTargetCollectionNext object from a json dictionary."""
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPeerCIDRs':
+ """Initialize a VPNGatewayConnectionPeerCIDRs 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')
+ if 'peer_cidrs' in _dict:
+ args['peer_cidrs'] = _dict.get('peer_cidrs')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SecurityGroupTargetCollectionNext 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, 'href') and self.href is not None:
- _dict['href'] = self.href
+ if hasattr(self, 'peer_cidrs') and self.peer_cidrs is not None:
+ _dict['peer_cidrs'] = self.peer_cidrs
return _dict
def _to_dict(self):
@@ -45529,255 +53940,150 @@ 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 VPNGatewayConnectionPeerCIDRs object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SecurityGroupTargetCollectionNext') -> 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: 'SecurityGroupTargetCollectionNext') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionPeerCIDRs') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SecurityGroupTargetReference():
+class VPNGatewayConnectionPrototype():
"""
- 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.
+ 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 user-defined name for this VPN gateway
+ connection.
+ :attr str peer_address: The IP address of the peer VPN gateway.
+ :attr str psk: The preshared key.
"""
- def __init__(self) -> None:
+ 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 SecurityGroupTargetReference object.
+ 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 user-defined name for this VPN gateway
+ connection.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext', 'SecurityGroupTargetReferenceLoadBalancerReference']))
+ ", ".join(['VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype', 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype']))
raise Exception(msg)
-class Snapshot():
+class VPNGatewayConnectionReference():
"""
- Snapshot.
+ VPNGatewayConnectionReference.
- :attr bool bootable: Indicates if a boot volume attachment can be created with a
- volume created from this snapshot.
- :attr datetime created_at: The date and time that this snapshot was created.
- :attr str crn: The CRN for this snapshot.
- :attr bool deletable: Indicates whether this snapshot can be deleted. This value
- will always be `true`.
- :attr str encryption: The type of encryption used on the source volume.
- :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 user-defined name for this snapshot.
- :attr OperatingSystem operating_system: (optional) The operating system included
- in this image.
- :attr ResourceGroupReference resource_group: The resource group for this
- snapshot.
+ :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 user-defined name for this VPN connection.
:attr str resource_type: The resource type.
- :attr int size: The size of this snapshot rounded up to the next gigabyte.
- :attr ImageReference source_image: (optional) If present, the image from which
- the data on this volume was most directly
- provisioned.
- :attr VolumeReference source_volume: The source volume this snapshot was created
- from (may be
- [deleted](https://cloud.ibm.com/apidocs/vpc#deleted-resources)).
"""
def __init__(self,
- bootable: bool,
- 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,
- size: int,
- source_volume: 'VolumeReference',
*,
- encryption_key: 'EncryptionKeyReference' = None,
- operating_system: 'OperatingSystem' = None,
- source_image: 'ImageReference' = None) -> None:
+ deleted: 'VPNGatewayConnectionReferenceDeleted' = None) -> None:
"""
- Initialize a Snapshot object.
+ Initialize a VPNGatewayConnectionReference object.
- :param bool bootable: Indicates if a boot volume attachment can be created
- with a volume created from this snapshot.
- :param datetime created_at: The date and time that this snapshot was
- created.
- :param str crn: The CRN for this snapshot.
- :param bool deletable: Indicates whether this snapshot can be deleted. This
- value will always be `true`.
- :param str encryption: The type of encryption used on the source volume.
- :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 user-defined name for this snapshot.
- :param ResourceGroupReference resource_group: The resource group for this
- snapshot.
+ :param str href: The VPN connection's canonical URL.
+ :param str id: The unique identifier for this VPN gateway connection.
+ :param str name: The user-defined name for this VPN connection.
:param str resource_type: The resource type.
- :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 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 volume was most directly
- provisioned.
+ :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present,
+ this property indicates the referenced resource has been deleted and
+ provides
+ some supplementary information.
"""
- self.bootable = bootable
- 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.size = size
- self.source_image = source_image
- self.source_volume = source_volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Snapshot':
- """Initialize a Snapshot object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReference':
+ """Initialize a VPNGatewayConnectionReference object from a json dictionary."""
args = {}
- if 'bootable' in _dict:
- args['bootable'] = _dict.get('bootable')
- else:
- raise ValueError('Required property \'bootable\' 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'))
+ 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 Snapshot 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 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 VPNGatewayConnectionReference 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 VPNGatewayConnectionReference 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 '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_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')
+ raise ValueError('Required property \'resource_type\' not present in VPNGatewayConnectionReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Snapshot 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, 'bootable') and self.bootable is not None:
- _dict['bootable'] = self.bootable
- 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:
- _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
- if hasattr(self, '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:
- _dict['operating_system'] = self.operating_system.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
if 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, 'source_image') and self.source_image is not None:
- _dict['source_image'] = self.source_image.to_dict()
- if hasattr(self, 'source_volume') and self.source_volume is not None:
- _dict['source_volume'] = self.source_volume.to_dict()
return _dict
def _to_dict(self):
@@ -45785,129 +54091,131 @@ 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 VPNGatewayConnectionReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Snapshot') -> 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: 'Snapshot') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionReference') -> 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'
+ VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
- 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 VPNGatewayConnectionReferenceDeleted():
+ """
+ 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 VPNGatewayConnectionReferenceDeleted object.
+
+ :param str more_info: Link to documentation about deleted resources.
"""
- SNAPSHOT = 'snapshot'
+ self.more_info = more_info
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReferenceDeleted':
+ """Initialize a VPNGatewayConnectionReferenceDeleted 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 VPNGatewayConnectionReferenceDeleted JSON')
+ return cls(**args)
-class SnapshotCollection():
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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 VPNGatewayConnectionReferenceDeleted object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'VPNGatewayConnectionReferenceDeleted') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class VPNGatewayConnectionStaticRouteModeTunnel():
"""
- SnapshotCollection.
+ VPNGatewayConnectionStaticRouteModeTunnel.
- :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 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,
- first: 'SnapshotCollectionFirst',
- limit: int,
- snapshots: List['Snapshot'],
- total_count: int,
- *,
- next: 'SnapshotCollectionNext' = None) -> None:
+ public_ip: 'IP',
+ status: str) -> None:
"""
- Initialize a SnapshotCollection object.
+ Initialize a VPNGatewayConnectionStaticRouteModeTunnel 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 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.first = first
- self.limit = limit
- self.next = next
- self.snapshots = snapshots
- self.total_count = total_count
+ self.public_ip = public_ip
+ self.status = status
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotCollection':
- """Initialize a SnapshotCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionStaticRouteModeTunnel':
+ """Initialize a VPNGatewayConnectionStaticRouteModeTunnel 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(x) for x in _dict.get('snapshots')]
+ if 'public_ip' in _dict:
+ args['public_ip'] = IP.from_dict(_dict.get('public_ip'))
else:
- raise ValueError('Required property \'snapshots\' not present in SnapshotCollection JSON')
- if 'total_count' in _dict:
- args['total_count'] = _dict.get('total_count')
+ 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 \'total_count\' not present in SnapshotCollection JSON')
+ raise ValueError('Required property \'status\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotCollection 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'snapshots') and self.snapshots is not None:
- _dict['snapshots'] = [x.to_dict() for x in self.snapshots]
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ if hasattr(self, 'public_ip') and self.public_ip is not None:
+ _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):
@@ -45915,55 +54223,100 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotCollection object."""
+ """Return a `str` version of this VPNGatewayConnectionStaticRouteModeTunnel object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotCollection') -> 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: 'SnapshotCollection') -> bool:
+ def __ne__(self, other: 'VPNGatewayConnectionStaticRouteModeTunnel') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotCollectionFirst():
+ class StatusEnum(str, Enum):
+ """
+ The status of the VPN Tunnel.
+ """
+ DOWN = 'down'
+ UP = 'up'
+
+
+class VPNGatewayMember():
"""
- A link to the first page of resources.
+ VPNGatewayMember.
- :attr str href: The URL for a page of resources.
+ :attr IP private_ip: (optional) The private IP address assigned to the VPN
+ gateway member. This
+ property will be present only when the VPN gateway status is
+ `available`.
+ :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) -> None:
+ public_ip: 'IP',
+ role: str,
+ status: str,
+ *,
+ private_ip: 'IP' = None) -> None:
"""
- Initialize a SnapshotCollectionFirst object.
+ Initialize a VPNGatewayMember object.
- :param str href: The URL for a page of resources.
+ :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 IP private_ip: (optional) The private IP address assigned to the VPN
+ gateway member. This
+ property will be present only when the VPN gateway status is
+ `available`.
"""
- 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) -> 'SnapshotCollectionFirst':
- """Initialize a SnapshotCollectionFirst 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'] = IP.from_dict(_dict.get('private_ip'))
+ if 'public_ip' in _dict:
+ args['public_ip'] = IP.from_dict(_dict.get('public_ip'))
else:
- raise ValueError('Required property \'href\' not present in SnapshotCollectionFirst JSON')
+ 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 SnapshotCollectionFirst 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:
+ _dict['private_ip'] = self.private_ip.to_dict()
+ if hasattr(self, 'public_ip') and self.public_ip is not None:
+ _dict['public_ip'] = self.public_ip.to_dict()
+ if 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):
@@ -45971,56 +54324,72 @@ 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 VPNGatewayMember object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotCollectionFirst') -> 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: 'SnapshotCollectionFirst') -> bool:
+ def __ne__(self, other: 'VPNGatewayMember') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotCollectionNext():
+ class RoleEnum(str, Enum):
+ """
+ The high availability role assigned to the VPN gateway member.
+ """
+ ACTIVE = 'active'
+ STANDBY = 'standby'
+
+
+ class StatusEnum(str, Enum):
+ """
+ The status of the VPN gateway member.
+ """
+ AVAILABLE = 'available'
+ DELETING = 'deleting'
+ FAILED = 'failed'
+ PENDING = 'pending'
+
+
+class VPNGatewayPatch():
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ VPNGatewayPatch.
- :attr str href: The URL for a page of resources.
+ :attr str name: (optional) The user-defined name for this VPN gateway.
"""
def __init__(self,
- href: str) -> None:
+ *,
+ name: str = None) -> None:
"""
- Initialize a SnapshotCollectionNext object.
+ Initialize a VPNGatewayPatch object.
- :param str href: The URL for a page of resources.
+ :param str name: (optional) The user-defined name for this VPN gateway.
"""
- self.href = href
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotCollectionNext':
- """Initialize a SnapshotCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VPNGatewayPatch':
+ """Initialize a VPNGatewayPatch object from a json dictionary."""
args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in SnapshotCollectionNext JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotCollectionNext object from a json dictionary."""
+ """Initialize a VPNGatewayPatch object from 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):
@@ -46028,69 +54397,332 @@ 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 VPNGatewayPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotCollectionNext') -> 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: 'SnapshotCollectionNext') -> bool:
+ def __ne__(self, other: 'VPNGatewayPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotIdentity():
+class VPNGatewayPrototype():
"""
- Identifies a snapshot by a unique property.
+ VPNGatewayPrototype.
+ :attr str name: (optional) The user-defined name for this VPN 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 SubnetIdentity subnet: Identifies a subnet by a unique property.
"""
- def __init__(self) -> None:
+ def __init__(self,
+ subnet: 'SubnetIdentity',
+ *,
+ name: str = None,
+ resource_group: 'ResourceGroupIdentity' = None) -> None:
"""
- Initialize a SnapshotIdentity object.
+ Initialize a VPNGatewayPrototype object.
+ :param SubnetIdentity subnet: Identifies a subnet by a unique property.
+ :param str name: (optional) The user-defined name for this VPN gateway.
+ :param 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(['SnapshotIdentityById', 'SnapshotIdentityByCRN', 'SnapshotIdentityByHref']))
+ ", ".join(['VPNGatewayPrototypeVPNGatewayRouteModePrototype', 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype']))
raise Exception(msg)
-class SnapshotPatch():
+class Volume():
"""
- SnapshotPatch.
+ Volume.
- :attr str name: (optional) The user-defined name for this snapshot.
+ :attr bool active: Indicates whether a running virtual server instance has an
+ attachment to this volume.
+ :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 str href: The URL for this volume.
+ :attr str id: The unique identifier for this volume.
+ :attr int iops: The maximum I/O operations per second (IOPS) to use for the
+ volume. Applicable only to volumes using a profile `family` of `custom`.
+ :attr str name: The unique user-defined name for this volume.
+ :attr OperatingSystemReference operating_system: (optional) The operating system
+ associated with this volume. If absent, this volume was not
+ created from an image, or the image did not include an operating system.
+ :attr VolumeProfileReference profile: The profile this volume uses.
+ :attr ResourceGroupReference resource_group: The resource group for this volume.
+ :attr ImageReference source_image: (optional) The image from which this volume
+ was created (this may be
+ [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[VolumeAttachmentReferenceVolumeContext] volume_attachments: The
+ volume attachments for this volume.
+ :attr ZoneReference zone: The zone this volume resides in.
"""
def __init__(self,
+ active: bool,
+ bandwidth: int,
+ busy: bool,
+ capacity: int,
+ created_at: datetime,
+ crn: str,
+ encryption: str,
+ href: str,
+ id: str,
+ iops: int,
+ name: str,
+ profile: 'VolumeProfileReference',
+ resource_group: 'ResourceGroupReference',
+ status: str,
+ status_reasons: List['VolumeStatusReason'],
+ volume_attachments: List['VolumeAttachmentReferenceVolumeContext'],
+ zone: 'ZoneReference',
*,
- name: str = None) -> None:
+ encryption_key: 'EncryptionKeyReference' = None,
+ operating_system: 'OperatingSystemReference' = None,
+ source_image: 'ImageReference' = None,
+ source_snapshot: 'SnapshotReference' = None) -> None:
"""
- Initialize a SnapshotPatch object.
+ Initialize a Volume object.
- :param str name: (optional) The user-defined name for this snapshot.
+ :param bool active: Indicates whether a running virtual server instance has
+ an attachment to this volume.
+ :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 str href: The URL for this volume.
+ :param str id: The unique identifier for this volume.
+ :param int iops: The maximum I/O operations per second (IOPS) to use for
+ the volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: The unique user-defined name for this volume.
+ :param VolumeProfileReference profile: The profile this volume uses.
+ :param ResourceGroupReference resource_group: The resource group for this
+ volume.
+ :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[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 OperatingSystemReference operating_system: (optional) The operating
+ system associated with this volume. If absent, this volume was not
+ created from an image, or the image did not include an operating system.
+ :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.active = active
+ 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.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.source_image = source_image
+ self.source_snapshot = source_snapshot
+ self.status = status
+ self.status_reasons = status_reasons
+ self.volume_attachments = volume_attachments
+ self.zone = zone
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotPatch':
- """Initialize a SnapshotPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Volume':
+ """Initialize a Volume 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 '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 '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'] = OperatingSystemReference.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 '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(x) for x in _dict.get('status_reasons')]
+ else:
+ raise ValueError('Required property \'status_reasons\' not present in Volume JSON')
+ if 'volume_attachments' in _dict:
+ args['volume_attachments'] = [VolumeAttachmentReferenceVolumeContext.from_dict(x) for x in _dict.get('volume_attachments')]
+ else:
+ 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 SnapshotPatch 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, 'active') and self.active is not None:
+ _dict['active'] = self.active
+ 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:
+ _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, 'name') and self.name is not None:
_dict['name'] = self.name
+ if hasattr(self, 'operating_system') and self.operating_system is not None:
+ _dict['operating_system'] = self.operating_system.to_dict()
+ if hasattr(self, 'profile') and self.profile is not None:
+ _dict['profile'] = self.profile.to_dict()
+ if hasattr(self, 'resource_group') and self.resource_group is not None:
+ _dict['resource_group'] = self.resource_group.to_dict()
+ if hasattr(self, 'source_image') and self.source_image is not None:
+ _dict['source_image'] = self.source_image.to_dict()
+ if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
+ _dict['source_snapshot'] = self.source_snapshot.to_dict()
+ if hasattr(self, 'status') and self.status is not None:
+ _dict['status'] = self.status
+ if hasattr(self, 'status_reasons') and self.status_reasons is not None:
+ _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons]
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments]
+ if hasattr(self, 'zone') and self.zone is not None:
+ _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -46098,108 +54730,179 @@ 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 Volume object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotPatch') -> 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: 'SnapshotPatch') -> bool:
+ def __ne__(self, other: 'Volume') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SnapshotReference():
+ class EncryptionEnum(str, Enum):
+ """
+ The type of encryption used on the volume.
+ """
+ PROVIDER_MANAGED = 'provider_managed'
+ USER_MANAGED = 'user_managed'
+
+
+ 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'
+
+
+class VolumeAttachment():
"""
- SnapshotReference.
+ VolumeAttachment.
- :attr str crn: The CRN for 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 user-defined name for this snapshot.
- :attr str resource_type: The resource type.
+ :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: If set to true, when deleting the
+ instance the volume will also be deleted.
+ :attr VolumeAttachmentDevice device: (optional) Information about how the volume
+ is exposed to the instance operating system.
+ This property may be absent if the volume attachment's `status` is not
+ `attached`.
+ :attr str href: The URL for this volume attachment.
+ :attr str id: The unique identifier for this volume attachment.
+ :attr str name: The user-defined name for this volume attachment.
+ :attr str status: The status of this volume attachment.
+ :attr str type: The type of volume attachment.
+ :attr VolumeReference volume: The attached volume.
"""
def __init__(self,
- crn: str,
+ bandwidth: int,
+ created_at: datetime,
+ delete_volume_on_instance_delete: bool,
href: str,
id: str,
name: str,
- resource_type: str,
+ status: str,
+ type: str,
+ volume: 'VolumeReference',
*,
- deleted: 'SnapshotReferenceDeleted' = None) -> None:
+ device: 'VolumeAttachmentDevice' = None) -> None:
"""
- Initialize a SnapshotReference object.
+ Initialize a VolumeAttachment object.
- :param str crn: The CRN for this snapshot.
- :param str href: The URL for this snapshot.
- :param str id: The unique identifier for this snapshot.
- :param str name: The user-defined name for this snapshot.
- :param str 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 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: If set to true, when deleting
+ the instance the volume will also be deleted.
+ :param str href: The URL for this volume attachment.
+ :param str id: The unique identifier for this volume attachment.
+ :param str name: The user-defined name for this volume attachment.
+ :param str status: The status of this volume attachment.
+ :param str type: The type of volume attachment.
+ :param VolumeReference volume: The attached volume.
+ :param VolumeAttachmentDevice device: (optional) Information about how the
+ volume is exposed to the instance operating system.
+ This property may be absent if the volume attachment's `status` is not
+ `attached`.
"""
- self.crn = crn
- self.deleted = deleted
+ 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.name = name
- self.resource_type = resource_type
+ self.status = status
+ self.type = type
+ self.volume = volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotReference':
- """Initialize a SnapshotReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachment':
+ """Initialize a VolumeAttachment object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if 'bandwidth' in _dict:
+ args['bandwidth'] = _dict.get('bandwidth')
else:
- raise ValueError('Required property \'crn\' not present in SnapshotReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = SnapshotReferenceDeleted.from_dict(_dict.get('deleted'))
+ 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 SnapshotReference 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 SnapshotReference JSON')
+ raise ValueError('Required property \'id\' not present in VolumeAttachment JSON')
if 'name' in _dict:
args['name'] = _dict.get('name')
else:
- raise ValueError('Required property \'name\' not present in SnapshotReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ raise ValueError('Required property \'name\' not present in VolumeAttachment JSON')
+ if 'status' in _dict:
+ args['status'] = _dict.get('status')
else:
- raise ValueError('Required property \'resource_type\' not present in SnapshotReference JSON')
+ 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'] = VolumeReference.from_dict(_dict.get('volume'))
+ else:
+ raise ValueError('Required property \'volume\' not present in VolumeAttachment JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, '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:
+ _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, '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, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'volume') and self.volume is not None:
+ _dict['volume'] = self.volume.to_dict()
return _dict
def _to_dict(self):
@@ -46207,63 +54910,75 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SnapshotReference object."""
+ """Return a `str` version of this VolumeAttachment object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotReference') -> 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: 'SnapshotReference') -> 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.
"""
- SNAPSHOT = 'snapshot'
+ ATTACHED = 'attached'
+ ATTACHING = 'attaching'
+ DELETING = 'deleting'
+ DETACHING = 'detaching'
-class SnapshotReferenceDeleted():
+ class TypeEnum(str, Enum):
+ """
+ The type of volume attachment.
+ """
+ BOOT = 'boot'
+ DATA = 'data'
+
+
+class VolumeAttachmentCollection():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ VolumeAttachmentCollection.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr List[VolumeAttachment] volume_attachments: Collection of volume
+ attachments.
"""
def __init__(self,
- more_info: str) -> None:
+ volume_attachments: List['VolumeAttachment']) -> None:
"""
- Initialize a SnapshotReferenceDeleted object.
+ Initialize a VolumeAttachmentCollection object.
- :param str more_info: Link to documentation about deleted resources.
+ :param List[VolumeAttachment] volume_attachments: Collection of volume
+ attachments.
"""
- self.more_info = more_info
+ self.volume_attachments = volume_attachments
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SnapshotReferenceDeleted':
- """Initialize a SnapshotReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentCollection':
+ """Initialize a VolumeAttachmentCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if 'volume_attachments' in _dict:
+ args['volume_attachments'] = [VolumeAttachment.from_dict(x) for x in _dict.get('volume_attachments')]
else:
- raise ValueError('Required property \'more_info\' not present in SnapshotReferenceDeleted JSON')
+ raise ValueError('Required property \'volume_attachments\' not present in VolumeAttachmentCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SnapshotReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
+ _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments]
return _dict
def _to_dict(self):
@@ -46271,222 +54986,56 @@ 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 VolumeAttachmentCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SnapshotReferenceDeleted') -> 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: 'SnapshotReferenceDeleted') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class Subnet():
+class VolumeAttachmentDevice():
"""
- Subnet.
+ VolumeAttachmentDevice.
- :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 user-defined name for this subnet.
- :attr NetworkACLReference network_acl: The network ACL for this subnet.
- :attr PublicGatewayReference public_gateway: (optional) The public gateway to
- handle internet bound traffic for this subnet.
- :attr ResourceGroupReference resource_group: The resource group for this subnet.
- :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 is a part of.
- :attr ZoneReference zone: The zone this subnet resides in.
+ :attr str id: (optional) A unique identifier for the device which is exposed to
+ the instance operating system.
"""
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',
- routing_table: 'RoutingTableReference',
- status: str,
- total_ipv4_address_count: int,
- vpc: 'VPCReference',
- zone: 'ZoneReference',
*,
- public_gateway: 'PublicGatewayReference' = None) -> None:
+ id: str = None) -> None:
"""
- Initialize a Subnet object.
+ Initialize a VolumeAttachmentDevice 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 user-defined name for this subnet.
- :param NetworkACLReference network_acl: The network ACL for this subnet.
- :param ResourceGroupReference resource_group: The resource group for this
- subnet.
- :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 is a part of.
- :param ZoneReference zone: The zone this subnet resides in.
- :param PublicGatewayReference public_gateway: (optional) The public gateway
- to handle internet bound traffic for this subnet.
+ :param str id: (optional) A unique identifier for the device which is
+ exposed to the instance operating system.
"""
- 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.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) -> 'VolumeAttachmentDevice':
+ """Initialize a VolumeAttachmentDevice 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 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- 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 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 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')
- 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Subnet 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, '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, 'href') 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:
- _dict['network_acl'] = self.network_acl.to_dict()
- if hasattr(self, 'public_gateway') and self.public_gateway is not None:
- _dict['public_gateway'] = self.public_gateway.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'routing_table') and self.routing_table is not None:
- _dict['routing_table'] = self.routing_table.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
- if hasattr(self, 'total_ipv4_address_count') and self.total_ipv4_address_count is not None:
- _dict['total_ipv4_address_count'] = self.total_ipv4_address_count
- if hasattr(self, 'vpc') and self.vpc is not None:
- _dict['vpc'] = self.vpc.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- _dict['zone'] = self.zone.to_dict()
return _dict
def _to_dict(self):
@@ -46494,117 +55043,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 VolumeAttachmentDevice object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Subnet') -> bool:
+ 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: 'Subnet') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentDevice') -> 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 StatusEnum(str, Enum):
- """
- The status of the subnet.
- """
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
-
-
-class SubnetCollection():
+class VolumeAttachmentPatch():
"""
- SubnetCollection.
+ VolumeAttachmentPatch.
- :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 bool delete_volume_on_instance_delete: (optional) If set to true, when
+ deleting the instance the volume will also be deleted.
+ :attr str name: (optional) The user-defined name for this volume attachment.
+ Names must be unique within the instance the volume attachment resides in.
"""
def __init__(self,
- first: 'SubnetCollectionFirst',
- limit: int,
- subnets: List['Subnet'],
- total_count: int,
*,
- next: 'SubnetCollectionNext' = None) -> None:
+ delete_volume_on_instance_delete: bool = None,
+ name: str = None) -> None:
"""
- Initialize a SubnetCollection object.
+ Initialize a VolumeAttachmentPatch 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 bool delete_volume_on_instance_delete: (optional) If set to true,
+ when deleting the instance the volume will also be deleted.
+ :param str name: (optional) The user-defined name for this volume
+ attachment. Names must be unique within the instance the volume attachment
+ resides in.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.subnets = subnets
- self.total_count = total_count
+ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetCollection':
- """Initialize a SubnetCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPatch':
+ """Initialize a VolumeAttachmentPatch 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(x) for x 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')
- else:
- raise ValueError('Required property \'total_count\' not present in SubnetCollection JSON')
+ 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 SubnetCollection object from a json dictionary."""
+ """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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'subnets') and self.subnets is not None:
- _dict['subnets'] = [x.to_dict() for x in self.subnets]
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
+ 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):
@@ -46612,55 +55111,79 @@ 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 VolumeAttachmentPatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetCollection') -> 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: 'SubnetCollection') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentPatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SubnetCollectionFirst():
+class VolumeAttachmentPrototypeInstanceByImageContext():
"""
- A link to the first page of resources.
+ VolumeAttachmentPrototypeInstanceByImageContext.
- :attr str href: The URL for a page of resources.
+ :attr bool delete_volume_on_instance_delete: (optional) If set to true, when
+ deleting the instance the volume will also be deleted.
+ :attr str name: (optional) The user-defined name for this volume attachment.
+ Names must be unique within the instance the volume attachment resides in.
+ :attr VolumePrototypeInstanceByImageContext volume: A prototype object for a new
+ volume.
"""
def __init__(self,
- href: str) -> None:
+ volume: 'VolumePrototypeInstanceByImageContext',
+ *,
+ delete_volume_on_instance_delete: bool = None,
+ name: str = None) -> None:
"""
- Initialize a SubnetCollectionFirst object.
+ Initialize a VolumeAttachmentPrototypeInstanceByImageContext object.
- :param str href: The URL for a page of resources.
+ :param VolumePrototypeInstanceByImageContext volume: A prototype object for
+ a new volume.
+ :param bool delete_volume_on_instance_delete: (optional) If set to true,
+ when deleting the instance the volume will also be deleted.
+ :param str name: (optional) The user-defined name for this volume
+ attachment. Names must be unique within the instance the volume attachment
+ resides in.
"""
- 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) -> 'SubnetCollectionFirst':
- """Initialize a SubnetCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByImageContext':
+ """Initialize a VolumeAttachmentPrototypeInstanceByImageContext 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'] = VolumePrototypeInstanceByImageContext.from_dict(_dict.get('volume'))
else:
- raise ValueError('Required property \'href\' not present in SubnetCollectionFirst JSON')
+ raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByImageContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetCollectionFirst 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, '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:
+ _dict['volume'] = self.volume.to_dict()
return _dict
def _to_dict(self):
@@ -46668,56 +55191,83 @@ 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 VolumeAttachmentPrototypeInstanceByImageContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetCollectionFirst') -> 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: 'SubnetCollectionFirst') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SubnetCollectionNext():
+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) If set to true, when
+ deleting the instance the volume will also be deleted.
+ :attr str name: (optional) The user-defined name for this volume attachment.
+ Names must be unique within the instance the volume attachment resides in.
+ :attr VolumeAttachmentVolumePrototypeInstanceByVolumeContext volume: An existing
+ volume to attach to the instance, or a prototype object for a new volume.
"""
def __init__(self,
- href: str) -> None:
+ volume: 'VolumeAttachmentVolumePrototypeInstanceByVolumeContext',
+ *,
+ delete_volume_on_instance_delete: bool = None,
+ name: str = None) -> None:
"""
- Initialize a SubnetCollectionNext object.
+ Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object.
- :param str href: The URL for a page of resources.
+ :param VolumeAttachmentVolumePrototypeInstanceByVolumeContext volume: An
+ existing volume to attach to the instance, or a prototype object for a new
+ volume.
+ :param bool delete_volume_on_instance_delete: (optional) If set to true,
+ when deleting the instance the volume will also be deleted.
+ :param str name: (optional) The user-defined name for this volume
+ attachment. Names must be unique within the instance the volume attachment
+ resides in.
"""
- self.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) -> 'SubnetCollectionNext':
- """Initialize a SubnetCollectionNext 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 SubnetCollectionNext JSON')
+ raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByVolumeContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetCollectionNext 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):
@@ -46725,114 +55275,82 @@ 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 VolumeAttachmentPrototypeInstanceByVolumeContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetCollectionNext') -> 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: 'SubnetCollectionNext') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class SubnetIdentity():
- """
- Identifies a subnet by a unique property.
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a SubnetIdentity object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['SubnetIdentityById', 'SubnetIdentityByCRN', 'SubnetIdentityByHref']))
- raise Exception(msg)
-
-class SubnetPatch():
+ def __ne__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class VolumeAttachmentPrototypeInstanceContext():
"""
- SubnetPatch.
+ VolumeAttachmentPrototypeInstanceContext.
- :attr str name: (optional) The user-defined name for this subnet. Names must be
- unique within the VPC the subnet resides in.
- :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this
- subnet.
- :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to
- handle internet bound traffic for this subnet.
- :attr RoutingTableIdentity routing_table: (optional) The routing table to use
- for this subnet. The routing table properties
- `route_direct_link_ingress`, `route_transit_gateway_ingress`, and
- `route_vpc_zone_ingress` must be `false`.
+ :attr bool delete_volume_on_instance_delete: (optional) If set to true, when
+ deleting the instance the volume will also be deleted.
+ :attr str name: (optional) The user-defined name for this volume attachment.
+ Names must be unique within the instance the volume attachment resides in.
+ :attr VolumeAttachmentVolumePrototypeInstanceContext volume: An existing volume
+ to attach to the instance, or a prototype object for a new volume.
"""
def __init__(self,
+ volume: 'VolumeAttachmentVolumePrototypeInstanceContext',
*,
- name: str = None,
- network_acl: 'NetworkACLIdentity' = None,
- public_gateway: 'PublicGatewayIdentity' = None,
- routing_table: 'RoutingTableIdentity' = None) -> None:
+ delete_volume_on_instance_delete: bool = None,
+ name: str = None) -> None:
"""
- Initialize a SubnetPatch object.
+ Initialize a VolumeAttachmentPrototypeInstanceContext object.
- :param str name: (optional) The user-defined name for this subnet. Names
- must be unique within the VPC the subnet resides in.
- :param NetworkACLIdentity network_acl: (optional) The network ACL to use
- for this subnet.
- :param PublicGatewayIdentity public_gateway: (optional) The public gateway
- to handle internet bound traffic for this subnet.
- :param RoutingTableIdentity routing_table: (optional) The routing table to
- use for this subnet. The routing table properties
- `route_direct_link_ingress`, `route_transit_gateway_ingress`, and
- `route_vpc_zone_ingress` must be `false`.
+ :param VolumeAttachmentVolumePrototypeInstanceContext volume: An existing
+ volume to attach to the instance, or a prototype object for a new volume.
+ :param bool delete_volume_on_instance_delete: (optional) If set to true,
+ when deleting the instance the volume will also be deleted.
+ :param str name: (optional) The user-defined name for this volume
+ attachment. Names must be unique within the instance the volume attachment
+ resides in.
"""
+ self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
self.name = name
- self.network_acl = network_acl
- self.public_gateway = public_gateway
- self.routing_table = routing_table
+ self.volume = volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetPatch':
- """Initialize a SubnetPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceContext':
+ """Initialize a VolumeAttachmentPrototypeInstanceContext object from a json dictionary."""
args = {}
+ if 'delete_volume_on_instance_delete' in _dict:
+ args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete')
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')
+ if 'volume' in _dict:
+ args['volume'] = _dict.get('volume')
+ else:
+ raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetPatch object from a json dictionary."""
+ """Initialize a VolumeAttachmentPrototypeInstanceContext object from 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, '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
+ if hasattr(self, 'volume') and self.volume is not None:
+ if isinstance(self.volume, dict):
+ _dict['volume'] = self.volume
else:
- _dict['routing_table'] = self.routing_table.to_dict()
+ _dict['volume'] = self.volume.to_dict()
return _dict
def _to_dict(self):
@@ -46840,164 +55358,129 @@ 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 VolumeAttachmentPrototypeInstanceContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetPatch') -> bool:
+ def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceContext') -> bool:
"""Return `true` when 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: 'VolumeAttachmentPrototypeInstanceContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SubnetPrototype():
+class VolumeAttachmentPrototypeVolume():
"""
- SubnetPrototype.
+ An existing volume to attach to the instance, or a prototype object for a new volume.
- :attr str ip_version: (optional) The IP version(s) to support for this subnet.
- :attr str name: (optional) The user-defined name for this subnet. Names must be
- unique within the VPC the subnet resides in. If unspecified, the name will be a
- hyphenated list of randomly-selected words.
- :attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this
- subnet.
- :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to
- handle internet bound traffic for this subnet.
- :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_transit_gateway_ingress`, and `route_vpc_zone_ingress` must be `false`.
- :attr VPCIdentity vpc: The VPC the subnet is to be a part of.
"""
- 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:
+ def __init__(self) -> None:
"""
- Initialize a SubnetPrototype object.
+ Initialize a VolumeAttachmentPrototypeVolume object.
- :param VPCIdentity vpc: The VPC the subnet is to be a part of.
- :param str ip_version: (optional) The IP version(s) to support for this
- subnet.
- :param str name: (optional) The user-defined name for this subnet. Names
- must be unique within the VPC the subnet resides in. If unspecified, the
- name will be a hyphenated list of randomly-selected words.
- :param NetworkACLIdentity network_acl: (optional) The network ACL to use
- for this subnet.
- :param PublicGatewayIdentity public_gateway: (optional) The public gateway
- to handle internet bound traffic for this subnet.
- :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_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(['VolumeAttachmentPrototypeVolumeVolumeIdentity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext']))
raise Exception(msg)
- class IpVersionEnum(str, Enum):
- """
- The IP version(s) to support for this subnet.
- """
- IPV4 = 'ipv4'
-
-
-class SubnetReference():
+class VolumeAttachmentReferenceInstanceContext():
"""
- SubnetReference.
+ VolumeAttachmentReferenceInstanceContext.
- :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
+ :attr VolumeAttachmentReferenceInstanceContextDeleted 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 user-defined name for this subnet.
+ :attr VolumeAttachmentDevice device: (optional) Information about how the volume
+ is exposed to the instance operating system.
+ This property may be absent if the volume attachment's `status` is not
+ `attached`.
+ :attr str href: The URL for this volume attachment.
+ :attr str id: The unique identifier for this volume attachment.
+ :attr str name: The user-defined name for this volume attachment.
+ :attr VolumeReference volume: The attached volume.
"""
def __init__(self,
- crn: str,
href: str,
id: str,
name: str,
+ volume: 'VolumeReference',
*,
- deleted: 'SubnetReferenceDeleted' = None) -> None:
+ deleted: 'VolumeAttachmentReferenceInstanceContextDeleted' = None,
+ device: 'VolumeAttachmentDevice' = None) -> None:
"""
- Initialize a SubnetReference object.
+ Initialize a VolumeAttachmentReferenceInstanceContext 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 user-defined name for this subnet.
- :param SubnetReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted and provides
+ :param str href: The URL for this volume attachment.
+ :param str id: The unique identifier for this volume attachment.
+ :param str name: The user-defined name for this volume attachment.
+ :param VolumeReference volume: The attached volume.
+ :param VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional)
+ If present, this property indicates the referenced resource has been
+ deleted and provides
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.crn = crn
self.deleted = deleted
+ self.device = device
self.href = href
self.id = id
self.name = name
+ self.volume = volume
@classmethod
- def from_dict(cls, _dict: Dict) -> 'SubnetReference':
- """Initialize a SubnetReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContext':
+ """Initialize a VolumeAttachmentReferenceInstanceContext object from a json dictionary."""
args = {}
- 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'))
+ 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 SubnetReference JSON')
+ 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 SubnetReference JSON')
+ raise ValueError('Required property \'id\' not present in VolumeAttachmentReferenceInstanceContext 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 VolumeAttachmentReferenceInstanceContext JSON')
+ if 'volume' in _dict:
+ args['volume'] = VolumeReference.from_dict(_dict.get('volume'))
+ else:
+ raise ValueError('Required property \'volume\' not present in VolumeAttachmentReferenceInstanceContext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
if hasattr(self, 'deleted') and self.deleted is not None:
_dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'device') and self.device is not None:
+ _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:
+ _dict['volume'] = self.volume.to_dict()
return _dict
def _to_dict(self):
@@ -47005,20 +55488,20 @@ 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 VolumeAttachmentReferenceInstanceContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'SubnetReference') -> 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: 'SubnetReference') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentReferenceInstanceContext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class SubnetReferenceDeleted():
+class VolumeAttachmentReferenceInstanceContextDeleted():
"""
If present, this property indicates the referenced resource has been deleted and
provides some supplementary information.
@@ -47029,25 +55512,25 @@ class SubnetReferenceDeleted():
def __init__(self,
more_info: str) -> None:
"""
- Initialize a SubnetReferenceDeleted 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) -> 'SubnetReferenceDeleted':
- """Initialize a SubnetReferenceDeleted 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 SubnetReferenceDeleted JSON')
+ raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceInstanceContextDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a SubnetReferenceDeleted object from a json dictionary."""
+ """Initialize a VolumeAttachmentReferenceInstanceContextDeleted object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -47062,252 +55545,136 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this SubnetReferenceDeleted object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'SubnetReferenceDeleted') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class VCPU():
- """
- The VCPU configuration.
-
- :attr str architecture: The VCPU architecture.
- :attr int count: The number of VCPUs assigned.
- """
-
- def __init__(self,
- architecture: str,
- count: int) -> None:
- """
- Initialize a VCPU object.
-
- :param str architecture: The VCPU architecture.
- :param int count: The number of VCPUs assigned.
- """
- self.architecture = architecture
- self.count = count
-
- @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')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """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, '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
- return _dict
-
- def _to_dict(self):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this VCPU object."""
+ """Return a `str` version of this VolumeAttachmentReferenceInstanceContextDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VCPU') -> 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: 'VCPU') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentReferenceInstanceContextDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPC():
+class VolumeAttachmentReferenceVolumeContext():
"""
- VPC.
+ VolumeAttachmentReferenceVolumeContext.
- :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
- to use for network interfaces created in this VPC.
- :attr str href: The URL for this VPC.
- :attr str id: The unique identifier for this VPC.
- :attr str name: The unique user-defined name for this VPC.
- :attr ResourceGroupReference resource_group: The resource group for this VPC.
- :attr str status: The status of this VPC.
+ :attr bool delete_volume_on_instance_delete: If set to true, when deleting the
+ instance the volume will also be deleted.
+ :attr VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If
+ present, this property indicates the referenced resource has been deleted and
+ 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 user-defined name for this volume attachment.
+ :attr str type: The type of volume attachment.
"""
def __init__(self,
- classic_access: bool,
- created_at: datetime,
- crn: str,
- default_network_acl: 'NetworkACLReference',
- default_routing_table: 'RoutingTableReference',
- default_security_group: 'SecurityGroupReference',
+ delete_volume_on_instance_delete: bool,
href: str,
id: str,
+ instance: 'InstanceReference',
name: str,
- resource_group: 'ResourceGroupReference',
- status: str,
+ type: str,
*,
- cse_source_ips: List['VPCCSESourceIP'] = None) -> None:
+ deleted: 'VolumeAttachmentReferenceVolumeContextDeleted' = None,
+ device: 'VolumeAttachmentDevice' = None) -> None:
"""
- Initialize a VPC object.
+ Initialize a VolumeAttachmentReferenceVolumeContext 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 to use for network interfaces created in this VPC.
- :param str href: The URL for this VPC.
- :param str id: The unique identifier for this VPC.
- :param str name: The unique user-defined name for this VPC.
- :param ResourceGroupReference resource_group: The resource group for this
- VPC.
- :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 bool delete_volume_on_instance_delete: If set to true, when deleting
+ the instance the volume will also be deleted.
+ :param str href: The URL for this volume attachment.
+ :param str id: The unique identifier for this volume attachment.
+ :param InstanceReference instance: The attached instance.
+ :param str name: The user-defined name for this volume attachment.
+ :param str 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.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.delete_volume_on_instance_delete = delete_volume_on_instance_delete
+ self.deleted = deleted
+ self.device = device
self.href = href
self.id = id
+ self.instance = instance
self.name = name
- self.resource_group = resource_group
- self.status = status
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPC':
- """Initialize a VPC object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContext':
+ """Initialize a VolumeAttachmentReferenceVolumeContext object from a json dictionary."""
args = {}
- 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(x) for x 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'))
+ 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 \'default_security_group\' not present in VPC 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 VPC 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 VPC JSON')
+ 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')
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 '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 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, '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:
- _dict['cse_source_ips'] = [x.to_dict() for x in self.cse_source_ips]
- if hasattr(self, 'default_network_acl') and self.default_network_acl is not None:
- _dict['default_network_acl'] = self.default_network_acl.to_dict()
- if hasattr(self, 'default_routing_table') and self.default_routing_table is not None:
- _dict['default_routing_table'] = self.default_routing_table.to_dict()
- if hasattr(self, 'default_security_group') and self.default_security_group is not None:
- _dict['default_security_group'] = self.default_security_group.to_dict()
+ raise ValueError('Required property \'name\' not present in VolumeAttachmentReferenceVolumeContext JSON')
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
+ else:
+ raise ValueError('Required property \'type\' not present in VolumeAttachmentReferenceVolumeContext JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None:
+ _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'device') and self.device is not None:
+ _dict['device'] = self.device.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'instance') and self.instance is not None:
+ _dict['instance'] = self.instance.to_dict()
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- if 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):
@@ -47315,77 +55682,64 @@ 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 VolumeAttachmentReferenceVolumeContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPC') -> 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: 'VPC') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContext') -> 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 this VPC.
+ The type of volume attachment.
"""
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
+ BOOT = 'boot'
+ DATA = 'data'
-class VPCCSESourceIP():
+class VolumeAttachmentReferenceVolumeContextDeleted():
"""
- VPCCSESourceIP.
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :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.
+ :attr str more_info: Link to documentation about deleted resources.
"""
def __init__(self,
- ip: 'IP',
- zone: 'ZoneReference') -> None:
+ more_info: str) -> None:
"""
- Initialize a VPCCSESourceIP object.
+ Initialize a VolumeAttachmentReferenceVolumeContextDeleted 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.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.ip = ip
- self.zone = zone
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCCSESourceIP':
- """Initialize a VPCCSESourceIP object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContextDeleted':
+ """Initialize a VolumeAttachmentReferenceVolumeContextDeleted 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'))
+ if 'more_info' in _dict:
+ args['more_info'] = _dict.get('more_info')
else:
- raise ValueError('Required property \'zone\' not present in VPCCSESourceIP JSON')
+ raise ValueError('Required property \'more_info\' not present in VolumeAttachmentReferenceVolumeContextDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCCSESourceIP object from a json dictionary."""
+ """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, 'ip') and self.ip is not None:
- _dict['ip'] = self.ip.to_dict()
- if hasattr(self, 'zone') and self.zone is not None:
- _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):
@@ -47393,85 +55747,107 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCCSESourceIP object."""
+ """Return a `str` version of this VolumeAttachmentReferenceVolumeContextDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCCSESourceIP') -> bool:
+ 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: 'VPCCSESourceIP') -> bool:
+ def __ne__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCCollection():
+class VolumeAttachmentVolumePrototypeInstanceByVolumeContext():
"""
- VPCCollection.
+ An existing volume to attach to the instance, or a prototype object for a new volume.
- :attr VPCCollectionFirst first: A link to the first page of resources.
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a VolumeAttachmentVolumePrototypeInstanceByVolumeContext object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext']))
+ raise Exception(msg)
+
+class VolumeAttachmentVolumePrototypeInstanceContext():
+ """
+ An existing volume to attach to the instance, or a prototype object for a new volume.
+
+ """
+
+ def __init__(self) -> None:
+ """
+ Initialize a VolumeAttachmentVolumePrototypeInstanceContext object.
+
+ """
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity', 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext']))
+ raise Exception(msg)
+
+class VolumeCollection():
+ """
+ VolumeCollection.
+
+ :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 VPCCollectionNext next: (optional) A link to the next page of resources.
- This property is present for all pages
+ :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[VPC] vpcs: Collection of VPCs.
+ :attr List[Volume] volumes: Collection of volumes.
"""
def __init__(self,
- first: 'VPCCollectionFirst',
+ first: 'VolumeCollectionFirst',
limit: int,
- total_count: int,
- vpcs: List['VPC'],
+ volumes: List['Volume'],
*,
- next: 'VPCCollectionNext' = None) -> None:
+ next: 'VolumeCollectionNext' = None) -> None:
"""
- Initialize a VPCCollection object.
+ Initialize a VolumeCollection object.
- :param VPCCollectionFirst 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 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
+ :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.total_count = total_count
- self.vpcs = vpcs
+ self.volumes = volumes
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCCollection':
- """Initialize a VPCCollection 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'] = VPCCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = VolumeCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in VPCCollection 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 VPCCollection JSON')
+ raise ValueError('Required property \'limit\' not present in VolumeCollection JSON')
if 'next' in _dict:
- 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 VPCCollection JSON')
- if 'vpcs' in _dict:
- args['vpcs'] = [VPC.from_dict(x) for x in _dict.get('vpcs')]
+ args['next'] = VolumeCollectionNext.from_dict(_dict.get('next'))
+ if 'volumes' in _dict:
+ args['volumes'] = [Volume.from_dict(x) for x in _dict.get('volumes')]
else:
- raise ValueError('Required property \'vpcs\' not present in VPCCollection JSON')
+ raise ValueError('Required property \'volumes\' not present in VolumeCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCCollection object from a json dictionary."""
+ """Initialize a VolumeCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -47483,10 +55859,8 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
- if hasattr(self, 'total_count') and self.total_count is not None:
- _dict['total_count'] = self.total_count
- if hasattr(self, 'vpcs') and self.vpcs is not None:
- _dict['vpcs'] = [x.to_dict() for x in self.vpcs]
+ if hasattr(self, 'volumes') and self.volumes is not None:
+ _dict['volumes'] = [x.to_dict() for x in self.volumes]
return _dict
def _to_dict(self):
@@ -47494,20 +55868,20 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCCollection object."""
+ """Return a `str` version of this VolumeCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCCollection') -> 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: 'VPCCollection') -> bool:
+ def __ne__(self, other: 'VolumeCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCCollectionFirst():
+class VolumeCollectionFirst():
"""
A link to the first page of resources.
@@ -47517,25 +55891,25 @@ class VPCCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a VPCCollectionFirst 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) -> 'VPCCollectionFirst':
- """Initialize a VPCCollectionFirst 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 VPCCollectionFirst JSON')
+ raise ValueError('Required property \'href\' not present in VolumeCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCCollectionFirst object from a json dictionary."""
+ """Initialize a VolumeCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -47550,20 +55924,20 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCCollectionFirst object."""
+ """Return a `str` version of this VolumeCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCCollectionFirst') -> 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: 'VPCCollectionFirst') -> bool:
+ def __ne__(self, other: 'VolumeCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCCollectionNext():
+class VolumeCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -47574,25 +55948,25 @@ class VPCCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a VPCCollectionNext 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) -> 'VPCCollectionNext':
- """Initialize a VPCCollectionNext 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 VPCCollectionNext JSON')
+ raise ValueError('Required property \'href\' not present in VolumeCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCCollectionNext object from a json dictionary."""
+ """Initialize a VolumeCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -47607,69 +55981,120 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCCollectionNext object."""
+ """Return a `str` version of this VolumeCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCCollectionNext') -> 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: 'VPCCollectionNext') -> bool:
+ def __ne__(self, other: 'VolumeCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCIdentity():
+class VolumeIdentity():
"""
- Identifies a VPC by a unique property.
+ Identifies a volume by a unique property.
"""
def __init__(self) -> None:
"""
- Initialize a VPCIdentity object.
+ Initialize a VolumeIdentity object.
"""
msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPCIdentityById', 'VPCIdentityByCRN', 'VPCIdentityByHref']))
+ ", ".join(['VolumeIdentityById', 'VolumeIdentityByCRN', 'VolumeIdentityByHref']))
raise Exception(msg)
-class VPCPatch():
+class VolumePatch():
"""
- VPCPatch.
+ VolumePatch.
- :attr str name: (optional) The unique user-defined name for this VPC.
+ :attr int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). The volume must be attached as a data volume to a running virtual
+ server instance, and the specified value must not be less than the current
+ capacity.
+ 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 the volume. Applicable only to volumes using a profile `family` of `custom`.
+ The volume must be attached as a data volume to a running virtual server
+ instance.
+ :attr str name: (optional) The unique user-defined name for this volume.
+ :attr 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.
"""
def __init__(self,
*,
- name: str = None) -> None:
+ capacity: int = None,
+ iops: int = None,
+ name: str = None,
+ profile: 'VolumeProfileIdentity' = None) -> None:
"""
- Initialize a VPCPatch object.
+ Initialize a VolumePatch object.
- :param str name: (optional) The unique user-defined name for this VPC.
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). The volume must be attached as a data volume to a running
+ virtual server instance, and the specified value must not be less than the
+ current capacity.
+ 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 the volume. Applicable only to volumes using a profile `family` of
+ `custom`. The volume must be attached as a data volume to a running virtual
+ server instance.
+ :param str name: (optional) The unique user-defined name for this volume.
+ :param 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.
"""
+ self.capacity = capacity
+ self.iops = iops
self.name = name
+ self.profile = profile
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCPatch':
- """Initialize a VPCPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumePatch':
+ """Initialize a VolumePatch 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCPatch 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, '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()
return _dict
def _to_dict(self):
@@ -47677,96 +56102,81 @@ 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 VolumePatch object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPCPatch') -> 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: 'VPCPatch') -> bool:
+ def __ne__(self, other: 'VolumePatch') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPCReference():
+class VolumeProfile():
"""
- VPCReference.
+ VolumeProfile.
- :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 unique user-defined name for this VPC.
+ :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,
- crn: str,
+ family: str,
href: str,
- id: str,
- name: str,
- *,
- deleted: 'VPCReferenceDeleted' = None) -> None:
+ name: str) -> None:
"""
- Initialize a VPCReference object.
+ Initialize a VolumeProfile 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 unique user-defined name for this VPC.
- :param VPCReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted and provides
- some supplementary information.
+ :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.crn = crn
- self.deleted = deleted
+ self.family = family
self.href = href
- self.id = id
self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPCReference':
- """Initialize a VPCReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfile':
+ """Initialize a VolumeProfile object from a json dictionary."""
args = {}
- if 'crn' in _dict:
- args['crn'] = _dict.get('crn')
+ if 'family' in _dict:
+ args['family'] = _dict.get('family')
else:
- raise ValueError('Required property \'crn\' not present in VPCReference JSON')
- if 'deleted' in _dict:
- args['deleted'] = VPCReferenceDeleted.from_dict(_dict.get('deleted'))
+ 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 VPCReference JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in VPCReference JSON')
+ 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 VPCReference JSON')
+ raise ValueError('Required property \'name\' not present in VolumeProfile JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPCReference 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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, '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
return _dict
@@ -47776,213 +56186,98 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VPCReference object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'VPCReference') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-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:
- """
- Initialize a VPCReferenceDeleted object.
-
- :param str more_info: Link to documentation about deleted resources.
- """
- self.more_info = more_info
-
- @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 user-defined name for this VPN gateway.
- :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:
- """
-
- 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') -> 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 user-defined name for this VPN gateway.
- :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:
- """
- 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'
+ """Return a `str` version of this VolumeProfile object."""
+ return json.dumps(self.to_dict(), indent=2)
+ 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__
- class StatusEnum(str, Enum):
+ 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 status of the VPN gateway.
+ 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.
"""
- AVAILABLE = 'available'
- DELETING = 'deleting'
- FAILED = 'failed'
- PENDING = 'pending'
+ CUSTOM = 'custom'
+ TIERED = 'tiered'
-class VPNGatewayCollection():
+class VolumeProfileCollection():
"""
- VPNGatewayCollection.
+ VolumeProfileCollection.
- :attr VPNGatewayCollectionFirst first: A link to the first page of resources.
+ :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 VPNGatewayCollectionNext next: (optional) A link to the next page of
+ :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 List[VPNGateway] vpn_gateways: Collection of VPN gateways.
"""
def __init__(self,
- first: 'VPNGatewayCollectionFirst',
+ first: 'VolumeProfileCollectionFirst',
limit: int,
+ profiles: List['VolumeProfile'],
total_count: int,
- vpn_gateways: List['VPNGateway'],
*,
- next: 'VPNGatewayCollectionNext' = None) -> None:
+ next: 'VolumeProfileCollectionNext' = None) -> None:
"""
- Initialize a VPNGatewayCollection object.
+ Initialize a VolumeProfileCollection object.
- :param VPNGatewayCollectionFirst first: A link to the first page of
+ :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 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
+ :param VolumeProfileCollectionNext 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.profiles = profiles
self.total_count = total_count
- self.vpn_gateways = vpn_gateways
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayCollection':
- """Initialize a VPNGatewayCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollection':
+ """Initialize a VolumeProfileCollection object from a json dictionary."""
args = {}
if 'first' in _dict:
- args['first'] = VPNGatewayCollectionFirst.from_dict(_dict.get('first'))
+ args['first'] = VolumeProfileCollectionFirst.from_dict(_dict.get('first'))
else:
- raise ValueError('Required property \'first\' not present in VPNGatewayCollection JSON')
+ 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 VPNGatewayCollection JSON')
+ raise ValueError('Required property \'limit\' not present in VolumeProfileCollection JSON')
if 'next' in _dict:
- args['next'] = VPNGatewayCollectionNext.from_dict(_dict.get('next'))
+ args['next'] = VolumeProfileCollectionNext.from_dict(_dict.get('next'))
+ if 'profiles' in _dict:
+ args['profiles'] = [VolumeProfile.from_dict(x) for x 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 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')
+ raise ValueError('Required property \'total_count\' not present in VolumeProfileCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayCollection object from a json dictionary."""
+ """Initialize a VolumeProfileCollection object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -47994,16 +56289,10 @@ def to_dict(self) -> Dict:
_dict['limit'] = self.limit
if hasattr(self, 'next') and self.next is not None:
_dict['next'] = self.next.to_dict()
+ if hasattr(self, 'profiles') and self.profiles is not None:
+ _dict['profiles'] = [x.to_dict() for x in self.profiles]
if hasattr(self, 'total_count') and self.total_count is not None:
_dict['total_count'] = self.total_count
- if hasattr(self, 'vpn_gateways') and self.vpn_gateways is not None:
- vpn_gateways_list = []
- for x in self.vpn_gateways:
- if isinstance(x, dict):
- vpn_gateways_list.append(x)
- else:
- vpn_gateways_list.append(x.to_dict())
- _dict['vpn_gateways'] = vpn_gateways_list
return _dict
def _to_dict(self):
@@ -48011,20 +56300,20 @@ 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 VolumeProfileCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayCollection') -> 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: 'VPNGatewayCollection') -> bool:
+ def __ne__(self, other: 'VolumeProfileCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayCollectionFirst():
+class VolumeProfileCollectionFirst():
"""
A link to the first page of resources.
@@ -48034,25 +56323,25 @@ class VPNGatewayCollectionFirst():
def __init__(self,
href: str) -> None:
"""
- Initialize a VPNGatewayCollectionFirst object.
+ Initialize a VolumeProfileCollectionFirst 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) -> 'VolumeProfileCollectionFirst':
+ """Initialize a VolumeProfileCollectionFirst 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 VolumeProfileCollectionFirst JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayCollectionFirst object from a json dictionary."""
+ """Initialize a VolumeProfileCollectionFirst object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -48067,20 +56356,20 @@ 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 VolumeProfileCollectionFirst object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayCollectionFirst') -> 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: 'VPNGatewayCollectionFirst') -> bool:
+ def __ne__(self, other: 'VolumeProfileCollectionFirst') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayCollectionNext():
+class VolumeProfileCollectionNext():
"""
A link to the next page of resources. This property is present for all pages except
the last page.
@@ -48091,25 +56380,25 @@ class VPNGatewayCollectionNext():
def __init__(self,
href: str) -> None:
"""
- Initialize a VPNGatewayCollectionNext object.
+ Initialize a VolumeProfileCollectionNext 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) -> 'VolumeProfileCollectionNext':
+ """Initialize a VolumeProfileCollectionNext 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 VolumeProfileCollectionNext JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayCollectionNext object from a json dictionary."""
+ """Initialize a VolumeProfileCollectionNext object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -48124,166 +56413,80 @@ 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 VolumeProfileCollectionNext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayCollectionNext') -> 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: 'VPNGatewayCollectionNext') -> bool:
+ def __ne__(self, other: 'VolumeProfileCollectionNext') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnection():
+class VolumeProfileIdentity():
"""
- VPNGatewayConnection.
+ Identifies a volume profile by a unique property.
- :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 user-defined name for this VPN gateway connection.
- :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.
"""
- 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) -> None:
+ def __init__(self) -> None:
"""
- Initialize a VPNGatewayConnection object.
+ Initialize a VolumeProfileIdentity 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 user-defined name for this VPN gateway connection.
- :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']))
+ ", ".join(['VolumeProfileIdentityByName', 'VolumeProfileIdentityByHref']))
raise Exception(msg)
- class AuthenticationModeEnum(str, Enum):
- """
- The authentication mode. Only `psk` is currently supported.
- """
- PSK = 'psk'
-
-
- class ModeEnum(str, Enum):
- """
- The mode of the VPN gateway.
- """
- POLICY = 'policy'
- ROUTE = 'route'
-
-
- class ResourceTypeEnum(str, Enum):
- """
- The resource type.
- """
- VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
-
-
- class StatusEnum(str, Enum):
- """
- The status of a VPN gateway connection.
- """
- DOWN = 'down'
- UP = 'up'
-
-
-class VPNGatewayConnectionCollection():
+class VolumeProfileReference():
"""
- Collection of VPN gateway connections in a VPN gateway.
+ VolumeProfileReference.
- :attr List[VPNGatewayConnection] connections: Array of VPN gateway connections.
+ :attr str href: The URL for this volume profile.
+ :attr str name: The globally unique name for this volume profile.
"""
def __init__(self,
- connections: List['VPNGatewayConnection']) -> None:
+ href: str,
+ name: str) -> None:
"""
- Initialize a VPNGatewayConnectionCollection object.
+ Initialize a VolumeProfileReference object.
- :param List[VPNGatewayConnection] connections: Array of VPN gateway
- connections.
+ :param str href: The URL for this volume profile.
+ :param str name: The globally unique name for this volume profile.
"""
- self.connections = connections
+ self.href = href
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionCollection':
- """Initialize a VPNGatewayConnectionCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeProfileReference':
+ """Initialize a VolumeProfileReference object from a json dictionary."""
args = {}
- if 'connections' in _dict:
- args['connections'] = _dict.get('connections')
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'connections\' not present in VPNGatewayConnectionCollection JSON')
+ raise ValueError('Required property \'href\' not present in VolumeProfileReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ else:
+ raise ValueError('Required property \'name\' not present in VolumeProfileReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionCollection 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, 'connections') and self.connections is not None:
- connections_list = []
- for x in self.connections:
- if isinstance(x, dict):
- connections_list.append(x)
- else:
- connections_list.append(x.to_dict())
- _dict['connections'] = connections_list
+ 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):
@@ -48291,160 +56494,153 @@ 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 VolumeProfileReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionCollection') -> 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: 'VPNGatewayConnectionCollection') -> bool:
+ def __ne__(self, other: 'VolumeProfileReference') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionDPD():
+class VolumePrototype():
"""
- The Dead Peer Detection settings.
+ VolumePrototype.
- :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 int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ for the volume. Applicable only to volumes using a profile `family` of `custom`.
+ :attr str name: (optional) The unique user-defined name for this volume.
+ :attr VolumeProfileIdentity profile: The profile to use for this volume.
+ :attr 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 ZoneIdentity zone: The zone this volume will reside in.
"""
def __init__(self,
- action: str,
- interval: int,
- timeout: int) -> None:
- """
- Initialize a VPNGatewayConnectionDPD 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.
+ profile: 'VolumeProfileIdentity',
+ zone: 'ZoneIdentity',
+ *,
+ iops: int = None,
+ name: str = None,
+ resource_group: 'ResourceGroupIdentity' = None) -> None:
"""
- self.action = action
- self.interval = interval
- self.timeout = timeout
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPD':
- """Initialize a VPNGatewayConnectionDPD 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')
- 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 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, '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):
- """Return a json dictionary representing this model."""
- return self.to_dict()
-
- def __str__(self) -> str:
- """Return a `str` version of this VPNGatewayConnectionDPD object."""
- return json.dumps(self.to_dict(), indent=2)
-
- 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: 'VPNGatewayConnectionDPD') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
+ Initialize a VolumePrototype object.
- class ActionEnum(str, Enum):
- """
- Dead Peer Detection actions.
+ :param VolumeProfileIdentity profile: The profile to use for this volume.
+ :param ZoneIdentity zone: The zone this volume will reside in.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to
+ use for the volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The unique user-defined name for this volume.
+ :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.
"""
- CLEAR = 'clear'
- HOLD = 'hold'
- NONE = 'none'
- RESTART = 'restart'
-
+ msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
+ ", ".join(['VolumePrototypeVolumeByCapacity']))
+ raise Exception(msg)
-class VPNGatewayConnectionDPDPatch():
+class VolumePrototypeInstanceByImageContext():
"""
- The Dead Peer Detection settings.
+ VolumePrototypeInstanceByImageContext.
- :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 int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). The only allowed value is the image's `minimum_provisioned_size`,
+ but the allowed values are expected to expand in the future.
+ If unspecified, the capacity will be the image's `minimum_provisioned_size`.
+ :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
+ wrap the data encryption key for the volume.
+ If unspecified, and the image is encrypted, the image's `encryption_key` will be
+ used. Otherwise, the `encryption` type for the volume will be
+ `provider_managed`.
+ :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
+ for the volume. Applicable only to volumes using a profile `family` of `custom`.
+ :attr str name: (optional) The unique user-defined name for this volume.
+ :attr VolumeProfileIdentity profile: The profile to use for this volume.
"""
def __init__(self,
+ profile: 'VolumeProfileIdentity',
*,
- action: str = None,
- interval: int = None,
- timeout: int = None) -> None:
+ capacity: int = None,
+ encryption_key: 'EncryptionKeyIdentity' = None,
+ iops: int = None,
+ name: str = None) -> None:
"""
- Initialize a VPNGatewayConnectionDPDPatch object.
+ Initialize a VolumePrototypeInstanceByImageContext 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 VolumeProfileIdentity profile: The profile to use for this volume.
+ :param int capacity: (optional) The capacity to use for the volume (in
+ gigabytes). The only allowed value is the image's
+ `minimum_provisioned_size`, but the allowed values are expected to expand
+ in the future.
+ 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, and the image is encrypted, the image's `encryption_key`
+ will be
+ used. Otherwise, the `encryption` type for the volume will be
+ `provider_managed`.
+ :param int iops: (optional) The maximum I/O operations per second (IOPS) to
+ use for the volume. Applicable only to volumes using a profile `family` of
+ `custom`.
+ :param str name: (optional) The unique user-defined name for this volume.
"""
- self.action = action
- self.interval = interval
- self.timeout = timeout
+ self.capacity = capacity
+ self.encryption_key = encryption_key
+ self.iops = iops
+ self.name = name
+ self.profile = profile
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPatch':
- """Initialize a VPNGatewayConnectionDPDPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumePrototypeInstanceByImageContext':
+ """Initialize a VolumePrototypeInstanceByImageContext 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 '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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionDPDPatch 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, '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, '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()
return _dict
def _to_dict(self):
@@ -48452,82 +56648,98 @@ 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 VolumePrototypeInstanceByImageContext object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionDPDPatch') -> 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: 'VPNGatewayConnectionDPDPatch') -> bool:
+ def __ne__(self, other: 'VolumePrototypeInstanceByImageContext') -> 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'
-
+ return not self == other
-class VPNGatewayConnectionDPDPrototype():
+class VolumeReference():
"""
- The Dead Peer Detection settings.
+ VolumeReference.
- :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 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 unique user-defined name for this volume.
"""
def __init__(self,
+ crn: str,
+ href: str,
+ id: str,
+ name: str,
*,
- action: str = None,
- interval: int = None,
- timeout: int = None) -> None:
+ deleted: 'VolumeReferenceDeleted' = None) -> None:
"""
- Initialize a VPNGatewayConnectionDPDPrototype object.
+ Initialize a VolumeReference 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 crn: The CRN for this volume.
+ :param str href: The URL for this volume.
+ :param str id: The unique identifier for this volume.
+ :param str name: The unique user-defined name for this volume.
+ :param VolumeReferenceDeleted deleted: (optional) If present, this property
+ indicates the referenced resource has been deleted and provides
+ some supplementary information.
"""
- self.action = action
- self.interval = interval
- self.timeout = timeout
+ self.crn = crn
+ self.deleted = deleted
+ self.href = href
+ self.id = id
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionDPDPrototype':
- """Initialize a VPNGatewayConnectionDPDPrototype object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeReference':
+ """Initialize a VolumeReference 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 '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'] = VolumeReferenceDeleted.from_dict(_dict.get('deleted'))
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ 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 VolumeReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ else:
+ raise ValueError('Required property \'name\' not present in VolumeReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionDPDPrototype 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, '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, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -48535,128 +56747,56 @@ 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 VolumeReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionDPDPrototype') -> 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: 'VPNGatewayConnectionDPDPrototype') -> bool:
+ def __ne__(self, other: 'VolumeReference') -> 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():
- """
- 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).
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a VPNGatewayConnectionIKEPolicyPrototype object.
-
- """
- 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).
-
- """
-
- def __init__(self) -> None:
- """
- Initialize a VPNGatewayConnectionIPsecPolicyPatch object.
-
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById', 'VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityByHref']))
- raise Exception(msg)
-
-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 __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 VPNGatewayConnectionLocalCIDRs():
+class VolumeReferenceDeleted():
"""
- VPNGatewayConnectionLocalCIDRs.
+ If present, this property indicates the referenced resource has been deleted and
+ provides some supplementary information.
- :attr List[str] local_cidrs: (optional) The local CIDRs for this resource.
+ :attr str more_info: Link to documentation about deleted resources.
"""
def __init__(self,
- *,
- local_cidrs: List[str] = None) -> None:
+ more_info: str) -> None:
"""
- Initialize a VPNGatewayConnectionLocalCIDRs object.
+ Initialize a VolumeReferenceDeleted object.
- :param List[str] local_cidrs: (optional) The local CIDRs for this resource.
+ :param str more_info: Link to documentation about deleted resources.
"""
- self.local_cidrs = local_cidrs
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionLocalCIDRs':
- """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeReferenceDeleted':
+ """Initialize a VolumeReferenceDeleted object from a json dictionary."""
args = {}
- if 'local_cidrs' in _dict:
- args['local_cidrs'] = _dict.get('local_cidrs')
+ if 'more_info' in _dict:
+ args['more_info'] = _dict.get('more_info')
+ else:
+ raise ValueError('Required property \'more_info\' not present in VolumeReferenceDeleted JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionLocalCIDRs object from a json dictionary."""
+ """Initialize a VolumeReferenceDeleted object from 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, 'more_info') and self.more_info is not None:
+ _dict['more_info'] = self.more_info
return _dict
def _to_dict(self):
@@ -48664,106 +56804,76 @@ 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 VolumeReferenceDeleted object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionLocalCIDRs') -> 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: 'VPNGatewayConnectionLocalCIDRs') -> bool:
+ def __ne__(self, other: 'VolumeReferenceDeleted') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionPatch():
- """
- VPNGatewayConnectionPatch.
-
- :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 user-defined name for this VPN gateway
- connection.
- :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:
- """
- 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 user-defined name for this VPN gateway
- connection.
- :param str peer_address: (optional) The IP address of the peer VPN gateway.
- :param str psk: (optional) The preshared key.
- """
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch']))
- raise Exception(msg)
-
-class VPNGatewayConnectionPeerCIDRs():
+class VolumeStatusReason():
"""
- VPNGatewayConnectionPeerCIDRs.
+ VolumeStatusReason.
- :attr List[str] peer_cidrs: (optional) The peer CIDRs for this resource.
+ :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,
*,
- peer_cidrs: List[str] = None) -> None:
+ more_info: str = None) -> None:
"""
- Initialize a VPNGatewayConnectionPeerCIDRs object.
+ Initialize a VolumeStatusReason object.
- :param List[str] peer_cidrs: (optional) The peer CIDRs for this resource.
+ :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.peer_cidrs = peer_cidrs
+ self.code = code
+ self.message = message
+ self.more_info = more_info
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionPeerCIDRs':
- """Initialize a VPNGatewayConnectionPeerCIDRs object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'VolumeStatusReason':
+ """Initialize a VolumeStatusReason object from a json dictionary."""
args = {}
- if 'peer_cidrs' in _dict:
- args['peer_cidrs'] = _dict.get('peer_cidrs')
+ if 'code' in _dict:
+ args['code'] = _dict.get('code')
+ else:
+ 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 VPNGatewayConnectionPeerCIDRs 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, 'peer_cidrs') and self.peer_cidrs is not None:
- _dict['peer_cidrs'] = self.peer_cidrs
+ 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):
@@ -48771,150 +56881,92 @@ 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 VolumeStatusReason object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionPeerCIDRs') -> 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: 'VPNGatewayConnectionPeerCIDRs') -> bool:
+ def __ne__(self, other: 'VolumeStatusReason') -> 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 user-defined name for this VPN gateway
- connection.
- :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:
+ class CodeEnum(str, Enum):
"""
- 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 user-defined name for this VPN gateway
- connection.
+ A snake case string succinctly identifying the status reason.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype', 'VPNGatewayConnectionPrototypeVPNGatewayConnectionPolicyModePrototype']))
- raise Exception(msg)
+ ENCRYPTION_KEY_DELETED = 'encryption_key_deleted'
-class VPNGatewayConnectionReference():
+
+class Zone():
"""
- VPNGatewayConnectionReference.
+ Zone.
- :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 user-defined name for this VPN connection.
- :attr str resource_type: The resource type.
+ :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,
href: str,
- id: str,
name: str,
- resource_type: str,
- *,
- deleted: 'VPNGatewayConnectionReferenceDeleted' = None) -> None:
+ region: 'RegionReference',
+ status: str) -> None:
"""
- Initialize a VPNGatewayConnectionReference object.
+ Initialize a Zone 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 user-defined name for this VPN connection.
- :param str resource_type: The resource type.
- :param VPNGatewayConnectionReferenceDeleted deleted: (optional) If present,
- this property indicates the referenced resource has been deleted and
- provides
- some supplementary information.
+ :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.deleted = deleted
self.href = href
- self.id = id
self.name = name
- self.resource_type = resource_type
+ self.region = region
+ self.status = status
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReference':
- """Initialize a VPNGatewayConnectionReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'Zone':
+ """Initialize a Zone 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')
+ 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 VPNGatewayConnectionReference JSON')
- if 'resource_type' in _dict:
- args['resource_type'] = _dict.get('resource_type')
+ 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 \'resource_type\' not present in VPNGatewayConnectionReference JSON')
+ 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 VPNGatewayConnectionReference 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, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
if hasattr(self, 'name') and self.name is not None:
_dict['name'] = self.name
- if hasattr(self, 'resource_type') and self.resource_type is not None:
- _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'region') and self.region is not None:
+ _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):
@@ -48922,63 +56974,64 @@ 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 Zone object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionReference') -> 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: 'VPNGatewayConnectionReference') -> bool:
+ def __ne__(self, other: 'Zone') -> 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 availability status of this zone.
"""
- VPN_GATEWAY_CONNECTION = 'vpn_gateway_connection'
+ AVAILABLE = 'available'
+ IMPAIRED = 'impaired'
+ UNAVAILABLE = 'unavailable'
-class VPNGatewayConnectionReferenceDeleted():
+class ZoneCollection():
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ ZoneCollection.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr List[Zone] zones: Collection of zones.
"""
def __init__(self,
- more_info: str) -> None:
+ zones: List['Zone']) -> None:
"""
- Initialize a VPNGatewayConnectionReferenceDeleted object.
+ Initialize a ZoneCollection object.
- :param str more_info: Link to documentation about deleted resources.
+ :param List[Zone] zones: Collection of zones.
"""
- self.more_info = more_info
+ self.zones = zones
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VPNGatewayConnectionReferenceDeleted':
- """Initialize a VPNGatewayConnectionReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'ZoneCollection':
+ """Initialize a ZoneCollection object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if 'zones' in _dict:
+ args['zones'] = [Zone.from_dict(x) for x in _dict.get('zones')]
else:
- raise ValueError('Required property \'more_info\' not present in VPNGatewayConnectionReferenceDeleted JSON')
+ raise ValueError('Required property \'zones\' not present in ZoneCollection JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionReferenceDeleted 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, 'more_info') and self.more_info is not None:
- _dict['more_info'] = self.more_info
+ if hasattr(self, 'zones') and self.zones is not None:
+ _dict['zones'] = [x.to_dict() for x in self.zones]
return _dict
def _to_dict(self):
@@ -48986,67 +57039,80 @@ 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 ZoneCollection object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionReferenceDeleted') -> 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: 'VPNGatewayConnectionReferenceDeleted') -> bool:
+ def __ne__(self, other: 'ZoneCollection') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayConnectionStaticRouteModeTunnel():
+class ZoneIdentity():
+ """
+ Identifies a zone by a unique property.
+
+ """
+
+ def __init__(self) -> 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():
"""
- VPNGatewayConnectionStaticRouteModeTunnel.
+ ZoneReference.
- :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 href: The URL for this zone.
+ :attr str name: The globally unique name for this zone.
"""
def __init__(self,
- public_ip: 'IP',
- status: str) -> None:
+ href: str,
+ name: str) -> None:
"""
- Initialize a VPNGatewayConnectionStaticRouteModeTunnel object.
+ Initialize a ZoneReference 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 href: The URL for this zone.
+ :param str name: The globally unique name for this zone.
"""
- self.public_ip = public_ip
- self.status = status
+ self.href = href
+ 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) -> 'ZoneReference':
+ """Initialize a ZoneReference object from a json dictionary."""
args = {}
- if 'public_ip' in _dict:
- args['public_ip'] = IP.from_dict(_dict.get('public_ip'))
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'public_ip\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON')
- if 'status' in _dict:
- args['status'] = _dict.get('status')
+ raise ValueError('Required property \'href\' not present in ZoneReference JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
else:
- raise ValueError('Required property \'status\' not present in VPNGatewayConnectionStaticRouteModeTunnel JSON')
+ raise ValueError('Required property \'name\' not present in ZoneReference JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VPNGatewayConnectionStaticRouteModeTunnel 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, 'public_ip') and self.public_ip is not None:
- _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, '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):
@@ -49054,100 +57120,100 @@ 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 ZoneReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayConnectionStaticRouteModeTunnel') -> 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: 'VPNGatewayConnectionStaticRouteModeTunnel') -> bool:
+ def __ne__(self, other: 'ZoneReference') -> 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 VPNGatewayMember():
+class BareMetalServerBootTargetBareMetalServerDiskReference(BareMetalServerBootTarget):
"""
- VPNGatewayMember.
+ BareMetalServerBootTargetBareMetalServerDiskReference.
- :attr IP private_ip: (optional) The private IP address assigned to the VPN
- gateway member. This
- property will be present only when the VPN gateway status is
- `available`.
- :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 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 user-defined name for this disk.
+ :attr str resource_type: The resource type.
"""
def __init__(self,
- public_ip: 'IP',
- role: str,
- status: str,
+ href: str,
+ id: str,
+ name: str,
+ resource_type: str,
*,
- private_ip: 'IP' = None) -> None:
+ deleted: 'BareMetalServerDiskReferenceDeleted' = None) -> None:
"""
- Initialize a VPNGatewayMember object.
+ Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object.
- :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 IP private_ip: (optional) The private IP address assigned to the VPN
- gateway member. This
- property will be present only when the VPN gateway status is
- `available`.
+ :param str href: The URL for this bare metal server disk.
+ :param str id: The unique identifier for this bare metal server disk.
+ :param str name: The user-defined name for this disk.
+ :param str 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.
"""
- self.private_ip = private_ip
- self.public_ip = public_ip
- self.role = role
- self.status = status
+ # 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) -> 'VPNGatewayMember':
- """Initialize a VPNGatewayMember object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerBootTargetBareMetalServerDiskReference':
+ """Initialize a BareMetalServerBootTargetBareMetalServerDiskReference object from a json dictionary."""
args = {}
- if 'private_ip' in _dict:
- args['private_ip'] = IP.from_dict(_dict.get('private_ip'))
- if 'public_ip' in _dict:
- args['public_ip'] = IP.from_dict(_dict.get('public_ip'))
+ 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 \'public_ip\' not present in VPNGatewayMember JSON')
- if 'role' in _dict:
- args['role'] = _dict.get('role')
+ raise ValueError('Required property \'href\' not present in BareMetalServerBootTargetBareMetalServerDiskReference 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 BareMetalServerBootTargetBareMetalServerDiskReference 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 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 VPNGatewayMember 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, 'private_ip') and self.private_ip is not None:
- _dict['private_ip'] = self.private_ip.to_dict()
- if hasattr(self, 'public_ip') and self.public_ip is not None:
- _dict['public_ip'] = self.public_ip.to_dict()
- if 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
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
return _dict
def _to_dict(self):
@@ -49155,72 +57221,98 @@ 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 BareMetalServerBootTargetBareMetalServerDiskReference object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayMember') -> 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: 'VPNGatewayMember') -> bool:
+ def __ne__(self, other: 'BareMetalServerBootTargetBareMetalServerDiskReference') -> 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'
+ BARE_METAL_SERVER_DISK = 'bare_metal_server_disk'
-class VPNGatewayPatch():
+class BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(BareMetalServerInitializationUserAccount):
"""
- VPNGatewayPatch.
+ BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.
- :attr str name: (optional) The user-defined name for this VPN gateway.
+ :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,
- *,
- name: str = None) -> None:
+ encrypted_password: bytes,
+ encryption_key: 'KeyReference',
+ resource_type: str,
+ username: str) -> None:
"""
- Initialize a VPNGatewayPatch object.
+ Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object.
- :param str name: (optional) The user-defined name for this VPN gateway.
+ :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.name = name
+ # 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) -> 'VPNGatewayPatch':
- """Initialize a VPNGatewayPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount':
+ """Initialize a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object from a json dictionary."""
args = {}
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ if 'encrypted_password' in _dict:
+ args['encrypted_password'] = base64.b64decode(_dict.get('encrypted_password'))
+ 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'))
+ 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 VPNGatewayPatch 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, 'name') and self.name is not None:
- _dict['name'] = self.name
+ if hasattr(self, 'encrypted_password') and self.encrypted_password is not None:
+ _dict['encrypted_password'] = str(base64.b64encode(self.encrypted_password), 'utf-8')
+ if hasattr(self, 'encryption_key') and self.encryption_key is not None:
+ _dict['encryption_key'] = self.encryption_key.to_dict()
+ if 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):
@@ -49228,332 +57320,283 @@ 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 BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VPNGatewayPatch') -> 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: 'VPNGatewayPatch') -> bool:
+ def __ne__(self, other: 'BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VPNGatewayPrototype():
- """
- VPNGatewayPrototype.
-
- :attr str name: (optional) The user-defined name for this VPN 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 SubnetIdentity subnet: Identifies a subnet by a unique property.
- """
-
- def __init__(self,
- subnet: 'SubnetIdentity',
- *,
- name: str = None,
- resource_group: 'ResourceGroupIdentity' = None) -> None:
+ class ResourceTypeEnum(str, Enum):
"""
- Initialize a VPNGatewayPrototype object.
-
- :param SubnetIdentity subnet: Identifies a subnet by a unique property.
- :param str name: (optional) The user-defined name for this VPN gateway.
- :param 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.
+ The resource type.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VPNGatewayPrototypeVPNGatewayRouteModePrototype', 'VPNGatewayPrototypeVPNGatewayPolicyModePrototype']))
- raise Exception(msg)
+ HOST_USER_ACCOUNT = 'host_user_account'
-class Volume():
+
+class BareMetalServerNetworkInterfaceByPCI(BareMetalServerNetworkInterface):
"""
- Volume.
+ BareMetalServerNetworkInterfaceByPCI.
- :attr bool active: Indicates whether a running virtual server instance has an
- attachment to this volume.
- :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 str href: The URL for this volume.
- :attr str id: The unique identifier for this volume.
- :attr int iops: The maximum I/O operations per second (IOPS) to use for the
- volume. Applicable only to volumes using a profile `family` of `custom`.
- :attr str name: The unique user-defined name for this volume.
- :attr OperatingSystemReference operating_system: (optional) The operating system
- associated with this volume. If absent, this volume was not
- created from an image, or the image did not include an operating system.
- :attr VolumeProfileReference profile: The profile this volume uses.
- :attr ResourceGroupReference resource_group: The resource group for this volume.
- :attr ImageReference source_image: (optional) The image from which this volume
- was created (this may be
- [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[VolumeAttachmentReferenceVolumeContext] volume_attachments: The
- volume attachments for this volume.
- :attr ZoneReference zone: The zone this volume resides in.
+ :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on
+ this interface. If false, source IP spoofing is prevented on this interface. If
+ true, source IP spoofing is allowed on this interface.
+ :attr datetime created_at: The date and time that the network interface was
+ created.
+ :attr bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :attr List[FloatingIPReference] floating_ips: (optional) The floating IPs
+ associated with this network interface.
+ :attr str href: The URL for this network interface.
+ :attr str id: The unique identifier for this network interface.
+ :attr str interface_type: The network interface type:
+ - `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.
+ :attr str mac_address: The MAC address of the interface. If absent, the value
+ is not known.
+ :attr str name: The user-defined name for this network interface.
+ :attr int port_speed: The network interface port speed in Mbps.
+ :attr str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :attr str resource_type: The resource type.
+ :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. A given VLAN can only be in the
+ `allowed_vlans` array for one PCI type adapter per bare metal server.
"""
def __init__(self,
- active: bool,
- bandwidth: int,
- busy: bool,
- capacity: int,
+ allow_ip_spoofing: bool,
created_at: datetime,
- crn: str,
- encryption: str,
+ enable_infrastructure_nat: bool,
href: str,
id: str,
- iops: int,
+ interface_type: str,
+ mac_address: str,
name: str,
- profile: 'VolumeProfileReference',
- resource_group: 'ResourceGroupReference',
+ port_speed: int,
+ primary_ipv4_address: str,
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
status: str,
- status_reasons: List['VolumeStatusReason'],
- volume_attachments: List['VolumeAttachmentReferenceVolumeContext'],
- zone: 'ZoneReference',
+ subnet: 'SubnetReference',
+ type: str,
+ allowed_vlans: List[int],
*,
- encryption_key: 'EncryptionKeyReference' = None,
- operating_system: 'OperatingSystemReference' = None,
- source_image: 'ImageReference' = None,
- source_snapshot: 'SnapshotReference' = None) -> None:
+ floating_ips: List['FloatingIPReference'] = None) -> None:
"""
- Initialize a Volume object.
+ Initialize a BareMetalServerNetworkInterfaceByPCI object.
- :param bool active: Indicates whether a running virtual server instance has
- an attachment to this volume.
- :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 str href: The URL for this volume.
- :param str id: The unique identifier for this volume.
- :param int iops: The maximum I/O operations per second (IOPS) to use for
- the volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :param str name: The unique user-defined name for this volume.
- :param VolumeProfileReference profile: The profile this volume uses.
- :param ResourceGroupReference resource_group: The resource group for this
- volume.
- :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[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 OperatingSystemReference operating_system: (optional) The operating
- system associated with this volume. If absent, this volume was not
- created from an image, or the image did not include an operating system.
- :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 bool allow_ip_spoofing: Indicates whether source IP spoofing is
+ allowed on this interface. If false, source IP spoofing is prevented on
+ this interface. If true, source IP spoofing is allowed on this interface.
+ :param datetime created_at: The date and time that the network interface
+ was created.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :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:
+ - `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.
+ :param str mac_address: The MAC address of the interface. If absent, the
+ value is not known.
+ :param str name: The user-defined name for this network interface.
+ :param int port_speed: The network interface port speed in Mbps.
+ :param str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :param str resource_type: The resource type.
+ :param 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. A given VLAN can only be
+ in the `allowed_vlans` array for one PCI type adapter per bare metal
+ server.
+ :param List[FloatingIPReference] floating_ips: (optional) The floating IPs
+ associated with this network interface.
"""
- self.active = active
- self.bandwidth = bandwidth
- self.busy = busy
- self.capacity = capacity
+ # pylint: disable=super-init-not-called
+ self.allow_ip_spoofing = allow_ip_spoofing
self.created_at = created_at
- self.crn = crn
- self.encryption = encryption
- self.encryption_key = encryption_key
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.floating_ips = floating_ips
self.href = href
self.id = id
- self.iops = iops
+ self.interface_type = interface_type
+ self.mac_address = mac_address
self.name = name
- self.operating_system = operating_system
- self.profile = profile
- self.resource_group = resource_group
- self.source_image = source_image
- self.source_snapshot = source_snapshot
+ self.port_speed = port_speed
+ self.primary_ipv4_address = primary_ipv4_address
+ self.resource_type = resource_type
+ self.security_groups = security_groups
self.status = status
- self.status_reasons = status_reasons
- self.volume_attachments = volume_attachments
- self.zone = zone
+ self.subnet = subnet
+ self.type = type
+ self.allowed_vlans = allowed_vlans
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Volume':
- """Initialize a Volume object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByPCI':
+ """Initialize a BareMetalServerNetworkInterfaceByPCI 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 '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')
+ if 'allow_ip_spoofing' in _dict:
+ args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
else:
- raise ValueError('Required property \'capacity\' not present in Volume JSON')
+ 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 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')
+ 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 \'encryption\' not present in Volume JSON')
- if 'encryption_key' in _dict:
- args['encryption_key'] = EncryptionKeyReference.from_dict(_dict.get('encryption_key'))
+ raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if 'floating_ips' in _dict:
+ args['floating_ips'] = [FloatingIPReference.from_dict(x) for x in _dict.get('floating_ips')]
if 'href' in _dict:
args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'href\' not present in Volume JSON')
+ 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 Volume JSON')
- if 'iops' in _dict:
- args['iops'] = _dict.get('iops')
+ raise ValueError('Required property \'id\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if 'interface_type' in _dict:
+ args['interface_type'] = _dict.get('interface_type')
else:
- raise ValueError('Required property \'iops\' not present in Volume JSON')
+ raise ValueError('Required property \'interface_type\' 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 Volume JSON')
- if 'operating_system' in _dict:
- args['operating_system'] = OperatingSystemReference.from_dict(_dict.get('operating_system'))
- if 'profile' in _dict:
- args['profile'] = VolumeProfileReference.from_dict(_dict.get('profile'))
+ 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 \'profile\' not present in Volume JSON')
- if 'resource_group' in _dict:
- args['resource_group'] = ResourceGroupReference.from_dict(_dict.get('resource_group'))
+ raise ValueError('Required property \'port_speed\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if 'primary_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
else:
- raise ValueError('Required property \'resource_group\' 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'))
+ raise ValueError('Required property \'primary_ipv4_address\' 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(x) for x 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 Volume JSON')
- if 'status_reasons' in _dict:
- args['status_reasons'] = [VolumeStatusReason.from_dict(x) for x in _dict.get('status_reasons')]
+ 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 \'status_reasons\' not present in Volume JSON')
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachmentReferenceVolumeContext.from_dict(x) for x in _dict.get('volume_attachments')]
+ raise ValueError('Required property \'subnet\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
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 \'type\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
+ if 'allowed_vlans' in _dict:
+ args['allowed_vlans'] = _dict.get('allowed_vlans')
else:
- raise ValueError('Required property \'zone\' not present in Volume JSON')
+ raise ValueError('Required property \'allowed_vlans\' not present in BareMetalServerNetworkInterfaceByPCI JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Volume 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, 'active') and self.active is not None:
- _dict['active'] = self.active
- 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
+ _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, '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:
- _dict['encryption_key'] = self.encryption_key.to_dict()
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips]
if hasattr(self, 'href') 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, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ 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, 'operating_system') and self.operating_system is not None:
- _dict['operating_system'] = self.operating_system.to_dict()
- if hasattr(self, 'profile') and self.profile is not None:
- _dict['profile'] = self.profile.to_dict()
- if hasattr(self, 'resource_group') and self.resource_group is not None:
- _dict['resource_group'] = self.resource_group.to_dict()
- if hasattr(self, 'source_image') and self.source_image is not None:
- _dict['source_image'] = self.source_image.to_dict()
- if hasattr(self, 'source_snapshot') and self.source_snapshot is not None:
- _dict['source_snapshot'] = self.source_snapshot.to_dict()
+ if hasattr(self, 'port_speed') and self.port_speed is not None:
+ _dict['port_speed'] = self.port_speed
+ if hasattr(self, 'primary_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ _dict['security_groups'] = [x.to_dict() for x in self.security_groups]
if hasattr(self, 'status') and self.status is not None:
_dict['status'] = self.status
- if hasattr(self, 'status_reasons') and self.status_reasons is not None:
- _dict['status_reasons'] = [x.to_dict() for x in self.status_reasons]
- if hasattr(self, 'volume_attachments') and self.volume_attachments is not None:
- _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments]
- if hasattr(self, 'zone') and self.zone is not None:
- _dict['zone'] = self.zone.to_dict()
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
+ if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
+ _dict['allowed_vlans'] = self.allowed_vlans
return _dict
def _to_dict(self):
@@ -49561,179 +57604,338 @@ 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 BareMetalServerNetworkInterfaceByPCI object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Volume') -> 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: 'Volume') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceByPCI') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class EncryptionEnum(str, Enum):
+ class InterfaceTypeEnum(str, Enum):
"""
- The type of encryption used on the volume.
+ The network 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.
+ - `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.
+ """
+ PCI = 'pci'
+ VLAN = 'vlan'
+
+
+ class ResourceTypeEnum(str, Enum):
"""
- PROVIDER_MANAGED = 'provider_managed'
- USER_MANAGED = 'user_managed'
+ The resource type.
+ """
+ NETWORK_INTERFACE = 'network_interface'
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.
+ The status of the network interface.
"""
AVAILABLE = 'available'
+ DELETING = 'deleting'
FAILED = 'failed'
PENDING = 'pending'
- PENDING_DELETION = 'pending_deletion'
- UNUSABLE = 'unusable'
-class VolumeAttachment():
+ class TypeEnum(str, Enum):
+ """
+ The type of this bare metal server network interface.
+ """
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
+
+
+class BareMetalServerNetworkInterfaceByVLAN(BareMetalServerNetworkInterface):
"""
- VolumeAttachment.
+ BareMetalServerNetworkInterfaceByVLAN.
- :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: If set to true, when deleting the
- instance the volume will also be deleted.
- :attr VolumeAttachmentDevice device: (optional) Information about how the volume
- is exposed to the instance operating system.
- This property may be absent if the volume attachment's `status` is not
- `attached`.
- :attr str href: The URL for this volume attachment.
- :attr str id: The unique identifier for this volume attachment.
- :attr str name: The user-defined name for this volume attachment.
- :attr str status: The status of this volume attachment.
- :attr str type: The type of volume attachment.
- :attr VolumeReference volume: The attached volume.
+ :attr bool allow_ip_spoofing: Indicates whether source IP spoofing is allowed on
+ this interface. If false, source IP spoofing is prevented on this interface. If
+ true, source IP spoofing is allowed on this interface.
+ :attr datetime created_at: The date and time that the network interface was
+ created.
+ :attr bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :attr List[FloatingIPReference] floating_ips: (optional) The floating IPs
+ associated with this network interface.
+ :attr str href: The URL for this network interface.
+ :attr str id: The unique identifier for this network interface.
+ :attr str interface_type: The network interface type:
+ - `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.
+ :attr str mac_address: The MAC address of the interface. If absent, the value
+ is not known.
+ :attr str name: The user-defined name for this network interface.
+ :attr int port_speed: The network interface port speed in Mbps.
+ :attr str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :attr str resource_type: The resource type.
+ :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 int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all
+ traffic on this interface.
"""
def __init__(self,
- bandwidth: int,
+ allow_ip_spoofing: bool,
created_at: datetime,
- delete_volume_on_instance_delete: bool,
+ enable_infrastructure_nat: bool,
href: str,
id: str,
+ interface_type: str,
+ mac_address: str,
name: str,
+ port_speed: int,
+ primary_ipv4_address: str,
+ resource_type: str,
+ security_groups: List['SecurityGroupReference'],
status: str,
+ subnet: 'SubnetReference',
type: str,
- volume: 'VolumeReference',
+ allow_interface_to_float: bool,
+ vlan: int,
*,
- device: 'VolumeAttachmentDevice' = None) -> None:
+ floating_ips: List['FloatingIPReference'] = None) -> None:
"""
- Initialize a VolumeAttachment object.
+ Initialize a BareMetalServerNetworkInterfaceByVLAN 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: If set to true, when deleting
- the instance the volume will also be deleted.
- :param str href: The URL for this volume attachment.
- :param str id: The unique identifier for this volume attachment.
- :param str name: The user-defined name for this volume attachment.
- :param str status: The status of this volume attachment.
- :param str type: The type of volume attachment.
- :param VolumeReference volume: The attached volume.
- :param VolumeAttachmentDevice device: (optional) Information about how the
- volume is exposed to the instance operating system.
- This property may be absent if the volume attachment's `status` is not
- `attached`.
+ :param bool allow_ip_spoofing: Indicates whether source IP spoofing is
+ allowed on this interface. If false, source IP spoofing is prevented on
+ this interface. If true, source IP spoofing is allowed on this interface.
+ :param datetime created_at: The date and time that the network interface
+ was created.
+ :param bool enable_infrastructure_nat: If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :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:
+ - `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.
+ :param str mac_address: The MAC address of the interface. If absent, the
+ value is not known.
+ :param str name: The user-defined name for this network interface.
+ :param int port_speed: The network interface port speed in Mbps.
+ :param str primary_ipv4_address: The primary IPv4 address.
+ If the address has not yet been selected, the value will be `0.0.0.0`.
+ :param str resource_type: The resource type.
+ :param 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 int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all
+ traffic on this interface.
+ :param List[FloatingIPReference] floating_ips: (optional) The floating IPs
+ associated with this network interface.
"""
- self.bandwidth = bandwidth
+ # pylint: disable=super-init-not-called
+ self.allow_ip_spoofing = allow_ip_spoofing
self.created_at = created_at
- self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.device = device
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.floating_ips = floating_ips
self.href = href
self.id = id
+ self.interface_type = interface_type
+ self.mac_address = mac_address
self.name = name
+ self.port_speed = port_speed
+ self.primary_ipv4_address = primary_ipv4_address
+ self.resource_type = resource_type
+ self.security_groups = security_groups
self.status = status
+ self.subnet = subnet
self.type = type
- self.volume = volume
+ self.allow_interface_to_float = allow_interface_to_float
+ self.vlan = vlan
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachment':
- """Initialize a VolumeAttachment object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfaceByVLAN':
+ """Initialize a BareMetalServerNetworkInterfaceByVLAN object from a json dictionary."""
args = {}
- if 'bandwidth' in _dict:
- args['bandwidth'] = _dict.get('bandwidth')
+ if 'allow_ip_spoofing' in _dict:
+ args['allow_ip_spoofing'] = _dict.get('allow_ip_spoofing')
else:
- raise ValueError('Required property \'bandwidth\' not present in VolumeAttachment JSON')
+ 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 VolumeAttachment JSON')
- if 'delete_volume_on_instance_delete' in _dict:
- args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete')
+ 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 \'delete_volume_on_instance_delete\' not present in VolumeAttachment JSON')
- if 'device' in _dict:
- args['device'] = VolumeAttachmentDevice.from_dict(_dict.get('device'))
+ raise ValueError('Required property \'enable_infrastructure_nat\' not present in BareMetalServerNetworkInterfaceByVLAN JSON')
+ if 'floating_ips' in _dict:
+ args['floating_ips'] = [FloatingIPReference.from_dict(x) for x in _dict.get('floating_ips')]
if 'href' in _dict:
args['href'] = _dict.get('href')
else:
- raise ValueError('Required property \'href\' not present in VolumeAttachment 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 VolumeAttachment JSON')
+ raise ValueError('Required property \'id\' 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 '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 VolumeAttachment JSON')
+ 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_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ else:
+ raise ValueError('Required property \'primary_ipv4_address\' 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(x) for x 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 VolumeAttachment JSON')
+ 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 VolumeAttachment JSON')
- if 'volume' in _dict:
- args['volume'] = VolumeReference.from_dict(_dict.get('volume'))
+ 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 \'volume\' not present in VolumeAttachment JSON')
+ raise ValueError('Required property \'allow_interface_to_float\' 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')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachment 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, 'bandwidth') and self.bandwidth is not None:
- _dict['bandwidth'] = self.bandwidth
+ 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, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None:
- _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete
- if hasattr(self, 'device') and self.device is not None:
- _dict['device'] = self.device.to_dict()
+ if hasattr(self, 'enable_infrastructure_nat') and self.enable_infrastructure_nat is not None:
+ _dict['enable_infrastructure_nat'] = self.enable_infrastructure_nat
+ if hasattr(self, 'floating_ips') and self.floating_ips is not None:
+ _dict['floating_ips'] = [x.to_dict() for x in self.floating_ips]
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
if hasattr(self, 'id') and self.id is not None:
_dict['id'] = self.id
+ if hasattr(self, 'interface_type') and self.interface_type is not None:
+ _dict['interface_type'] = self.interface_type
+ 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_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ _dict['security_groups'] = [x.to_dict() for x in self.security_groups]
if hasattr(self, 'status') and self.status is not None:
_dict['status'] = self.status
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ _dict['subnet'] = self.subnet.to_dict()
if hasattr(self, 'type') and self.type is not None:
_dict['type'] = self.type
- if hasattr(self, 'volume') and self.volume is not None:
- _dict['volume'] = self.volume.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, 'vlan') and self.vlan is not None:
+ _dict['vlan'] = self.vlan
return _dict
def _to_dict(self):
@@ -49741,75 +57943,465 @@ 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 BareMetalServerNetworkInterfaceByVLAN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachment') -> 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: 'VolumeAttachment') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfaceByVLAN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+ class InterfaceTypeEnum(str, Enum):
+ """
+ The network 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.
+ - `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.
+ """
+ PCI = 'pci'
+ VLAN = 'vlan'
+
+
+ class ResourceTypeEnum(str, Enum):
+ """
+ The resource type.
+ """
+ NETWORK_INTERFACE = 'network_interface'
+
+
class StatusEnum(str, Enum):
"""
- The status of this volume attachment.
+ The status of the network interface.
"""
- ATTACHED = 'attached'
- ATTACHING = 'attaching'
+ AVAILABLE = 'available'
DELETING = 'deleting'
- DETACHING = 'detaching'
+ FAILED = 'failed'
+ PENDING = 'pending'
class TypeEnum(str, Enum):
"""
- The type of volume attachment.
+ The type of this bare metal server network interface.
"""
- BOOT = 'boot'
- DATA = 'data'
+ PRIMARY = 'primary'
+ SECONDARY = 'secondary'
-class VolumeAttachmentCollection():
+class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(BareMetalServerNetworkInterfacePrototype):
"""
- VolumeAttachmentCollection.
+ BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.
- :attr List[VolumeAttachment] volume_attachments: Collection of volume
- attachments.
+ :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
+ allowed on this interface. If false, source IP spoofing is prevented on this
+ interface. If true, source IP spoofing is allowed on this interface.
+ :attr bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :attr str interface_type: The network 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.
+ - `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 str name: (optional) The user-defined name for network interface. Names
+ must be unique within the instance the network interface resides in. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :attr str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's subnet. If
+ unspecified, an available address on the subnet will be automatically selected.
+ :attr 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. A given VLAN can only be in
+ the `allowed_vlans` array for one PCI type adapter per bare metal server.
"""
def __init__(self,
- volume_attachments: List['VolumeAttachment']) -> None:
+ interface_type: str,
+ subnet: 'SubnetIdentity',
+ *,
+ allow_ip_spoofing: bool = None,
+ enable_infrastructure_nat: bool = None,
+ name: str = None,
+ primary_ipv4_address: str = None,
+ security_groups: List['SecurityGroupIdentity'] = None,
+ allowed_vlans: List[int] = None) -> None:
+ """
+ Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object.
+
+ :param str interface_type: The network 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.
+ - `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 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.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :param str name: (optional) The user-defined name for network interface.
+ Names must be unique within the instance the network interface resides in.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's
+ subnet. If unspecified, an available address on the subnet will be
+ automatically selected.
+ :param 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. A given VLAN
+ can only be in the `allowed_vlans` array for one PCI type adapter per bare
+ metal server.
"""
- Initialize a VolumeAttachmentCollection object.
+ # pylint: disable=super-init-not-called
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.interface_type = interface_type
+ self.name = name
+ self.primary_ipv4_address = primary_ipv4_address
+ self.security_groups = security_groups
+ self.subnet = subnet
+ self.allowed_vlans = allowed_vlans
- :param List[VolumeAttachment] volume_attachments: Collection of volume
- attachments.
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype':
+ """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype 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 'interface_type' in _dict:
+ args['interface_type'] = _dict.get('interface_type')
+ else:
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ if 'primary_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ if '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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype JSON')
+ if 'allowed_vlans' in _dict:
+ args['allowed_vlans'] = _dict.get('allowed_vlans')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """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, '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, '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_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for x in self.security_groups:
+ if isinstance(x, dict):
+ security_groups_list.append(x)
+ else:
+ security_groups_list.append(x.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, 'allowed_vlans') and self.allowed_vlans is not None:
+ _dict['allowed_vlans'] = self.allowed_vlans
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+ class InterfaceTypeEnum(str, Enum):
"""
- self.volume_attachments = volume_attachments
+ The network 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.
+ - `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.
+ """
+ PCI = 'pci'
+ VLAN = 'vlan'
+
+
+class BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype(BareMetalServerNetworkInterfacePrototype):
+ """
+ BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.
+
+ :attr bool allow_ip_spoofing: (optional) Indicates whether source IP spoofing is
+ allowed on this interface. If false, source IP spoofing is prevented on this
+ interface. If true, source IP spoofing is allowed on this interface.
+ :attr bool enable_infrastructure_nat: (optional) If `true`:
+ - The VPC infrastructure performs any needed NAT operations.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :attr str interface_type: The network 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.
+ - `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 str name: (optional) The user-defined name for network interface. Names
+ must be unique within the instance the network interface resides in. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
+ :attr str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's subnet. If
+ unspecified, an available address on the subnet will be automatically selected.
+ :attr 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 int vlan: Indicates the 802.1Q VLAN ID tag that must be used for all
+ traffic on this interface.
+ """
+
+ def __init__(self,
+ interface_type: str,
+ subnet: 'SubnetIdentity',
+ vlan: int,
+ *,
+ allow_ip_spoofing: bool = None,
+ enable_infrastructure_nat: bool = None,
+ name: str = None,
+ primary_ipv4_address: str = None,
+ security_groups: List['SecurityGroupIdentity'] = None,
+ allow_interface_to_float: bool = None) -> None:
+ """
+ Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object.
+
+ :param str interface_type: The network 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.
+ - `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 SubnetIdentity subnet: The associated subnet.
+ :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.
+ - A single floating IP can be assigned to the network interface.
+ If `false`:
+ - The packet is passed unmodified to/from the network interface,
+ allowing the workload to perform any needed NAT operations.
+ - Multiple floating IPs can be assigned to the network interface.
+ - `allow_ip_spoofing` must be set to `false`.
+ :param str name: (optional) The user-defined name for network interface.
+ Names must be unique within the instance the network interface resides in.
+ If unspecified, the name will be a hyphenated list of randomly-selected
+ words.
+ :param str primary_ipv4_address: (optional) The primary IPv4 address. If
+ specified, it must be an available address on the network interface's
+ subnet. If unspecified, an available address on the subnet will be
+ automatically selected.
+ :param 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.
+ """
+ # pylint: disable=super-init-not-called
+ self.allow_ip_spoofing = allow_ip_spoofing
+ self.enable_infrastructure_nat = enable_infrastructure_nat
+ self.interface_type = interface_type
+ self.name = name
+ self.primary_ipv4_address = primary_ipv4_address
+ self.security_groups = security_groups
+ self.subnet = subnet
+ self.allow_interface_to_float = allow_interface_to_float
+ self.vlan = vlan
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentCollection':
- """Initialize a VolumeAttachmentCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype':
+ """Initialize a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object from a json dictionary."""
args = {}
- if 'volume_attachments' in _dict:
- args['volume_attachments'] = [VolumeAttachment.from_dict(x) for x in _dict.get('volume_attachments')]
+ 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 'interface_type' in _dict:
+ args['interface_type'] = _dict.get('interface_type')
else:
- raise ValueError('Required property \'volume_attachments\' not present in VolumeAttachmentCollection JSON')
+ raise ValueError('Required property \'interface_type\' not present in BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
+ if 'primary_ipv4_address' in _dict:
+ args['primary_ipv4_address'] = _dict.get('primary_ipv4_address')
+ if '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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype JSON')
+ if 'allow_interface_to_float' in _dict:
+ args['allow_interface_to_float'] = _dict.get('allow_interface_to_float')
+ 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 VolumeAttachmentCollection 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, 'volume_attachments') and self.volume_attachments is not None:
- _dict['volume_attachments'] = [x.to_dict() for x in self.volume_attachments]
+ 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, '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_ipv4_address') and self.primary_ipv4_address is not None:
+ _dict['primary_ipv4_address'] = self.primary_ipv4_address
+ if hasattr(self, 'security_groups') and self.security_groups is not None:
+ security_groups_list = []
+ for x in self.security_groups:
+ if isinstance(x, dict):
+ security_groups_list.append(x)
+ else:
+ security_groups_list.append(x.to_dict())
+ _dict['security_groups'] = security_groups_list
+ if hasattr(self, 'subnet') and self.subnet is not None:
+ if isinstance(self.subnet, dict):
+ _dict['subnet'] = self.subnet
+ else:
+ _dict['subnet'] = self.subnet.to_dict()
+ if hasattr(self, '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, 'vlan') and self.vlan is not None:
+ _dict['vlan'] = self.vlan
return _dict
def _to_dict(self):
@@ -49817,56 +58409,79 @@ 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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentCollection') -> 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: 'VolumeAttachmentCollection') -> bool:
+ def __ne__(self, other: 'BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentDevice():
+ class InterfaceTypeEnum(str, Enum):
+ """
+ The network 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.
+ - `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.
+ """
+ PCI = 'pci'
+ VLAN = 'vlan'
+
+
+class BareMetalServerProfileBandwidthDependent(BareMetalServerProfileBandwidth):
"""
- VolumeAttachmentDevice.
+ The total bandwidth shared across the network interfaces of a bare metal server with
+ this profile depends on its configuration.
- :attr str id: (optional) A unique identifier for the device which is exposed to
- the instance operating system.
+ :attr str type: The type for this profile field.
"""
def __init__(self,
- *,
- id: str = None) -> None:
+ type: str) -> None:
"""
- Initialize a VolumeAttachmentDevice object.
+ Initialize a BareMetalServerProfileBandwidthDependent object.
- :param str id: (optional) A unique identifier for the device which is
- exposed to the instance operating system.
+ :param str type: The type for this profile field.
"""
- self.id = id
+ # pylint: disable=super-init-not-called
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentDevice':
- """Initialize a VolumeAttachmentDevice object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthDependent':
+ """Initialize a BareMetalServerProfileBandwidthDependent 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 \'type\' not present in BareMetalServerProfileBandwidthDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentDevice 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, '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
return _dict
def _to_dict(self):
@@ -49874,67 +58489,84 @@ 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 BareMetalServerProfileBandwidthDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentDevice') -> 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: 'VolumeAttachmentDevice') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileBandwidthDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentPatch():
- """
- VolumeAttachmentPatch.
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ DEPENDENT = 'dependent'
- :attr bool delete_volume_on_instance_delete: (optional) If set to true, when
- deleting the instance the volume will also be deleted.
- :attr str name: (optional) The user-defined name for this volume attachment.
- Names must be unique within the instance the volume attachment resides in.
+
+class BareMetalServerProfileBandwidthEnum(BareMetalServerProfileBandwidth):
+ """
+ The permitted total bandwidth values (in megabits per second) shared across the
+ network interfaces of 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.
+ :attr List[int] values: The permitted values for this profile field.
"""
def __init__(self,
- *,
- delete_volume_on_instance_delete: bool = None,
- name: str = None) -> None:
+ default: int,
+ type: str,
+ values: List[int]) -> None:
"""
- Initialize a VolumeAttachmentPatch object.
+ Initialize a BareMetalServerProfileBandwidthEnum object.
- :param bool delete_volume_on_instance_delete: (optional) If set to true,
- when deleting the instance the volume will also be deleted.
- :param str name: (optional) The user-defined name for this volume
- attachment. Names must be unique within the instance the volume attachment
- resides in.
+ :param 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.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.name = name
+ # pylint: disable=super-init-not-called
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPatch':
- """Initialize a VolumeAttachmentPatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthEnum':
+ """Initialize a BareMetalServerProfileBandwidthEnum 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 'default' in _dict:
+ args['default'] = _dict.get('default')
+ else:
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileBandwidthEnum JSON')
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
+ else:
+ 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 VolumeAttachmentPatch 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, '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, '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):
@@ -49942,79 +58574,74 @@ 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 BareMetalServerProfileBandwidthEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentPatch') -> 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: 'VolumeAttachmentPatch') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileBandwidthEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentPrototypeInstanceByImageContext():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ ENUM = 'enum'
+
+
+class BareMetalServerProfileBandwidthFixed(BareMetalServerProfileBandwidth):
"""
- VolumeAttachmentPrototypeInstanceByImageContext.
+ The total bandwidth (in megabits per second) shared across the network interfaces of a
+ bare metal server with this profile.
- :attr bool delete_volume_on_instance_delete: (optional) If set to true, when
- deleting the instance the volume will also be deleted.
- :attr str name: (optional) The user-defined name for this volume attachment.
- Names must be unique within the instance the volume attachment resides in.
- :attr VolumePrototypeInstanceByImageContext volume: A prototype object for a new
- volume.
+ :attr str type: The type for this profile field.
+ :attr int value: The value for this profile field.
"""
def __init__(self,
- volume: 'VolumePrototypeInstanceByImageContext',
- *,
- delete_volume_on_instance_delete: bool = None,
- name: str = None) -> None:
+ type: str,
+ value: int) -> None:
"""
- Initialize a VolumeAttachmentPrototypeInstanceByImageContext object.
+ Initialize a BareMetalServerProfileBandwidthFixed object.
- :param VolumePrototypeInstanceByImageContext volume: A prototype object for
- a new volume.
- :param bool delete_volume_on_instance_delete: (optional) If set to true,
- when deleting the instance the volume will also be deleted.
- :param str name: (optional) The user-defined name for this volume
- attachment. Names must be unique within the instance the volume attachment
- resides in.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
- self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.name = name
- self.volume = volume
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceByImageContext':
- """Initialize a VolumeAttachmentPrototypeInstanceByImageContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthFixed':
+ """Initialize a BareMetalServerProfileBandwidthFixed object from a json dictionary."""
args = {}
- if 'delete_volume_on_instance_delete' in _dict:
- args['delete_volume_on_instance_delete'] = _dict.get('delete_volume_on_instance_delete')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
- if 'volume' in _dict:
- args['volume'] = VolumePrototypeInstanceByImageContext.from_dict(_dict.get('volume'))
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
else:
- raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByImageContext JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileBandwidthFixed JSON')
+ if 'value' in _dict:
+ args['value'] = _dict.get('value')
+ else:
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileBandwidthFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentPrototypeInstanceByImageContext 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, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None:
- _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
- if hasattr(self, 'volume') and self.volume is not None:
- _dict['volume'] = self.volume.to_dict()
+ 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):
@@ -50022,83 +58649,104 @@ 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 BareMetalServerProfileBandwidthFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByImageContext') -> 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: 'VolumeAttachmentPrototypeInstanceByImageContext') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileBandwidthFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentPrototypeInstanceByVolumeContext():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ FIXED = 'fixed'
+
+
+class BareMetalServerProfileBandwidthRange(BareMetalServerProfileBandwidth):
"""
- VolumeAttachmentPrototypeInstanceByVolumeContext.
+ The permitted total bandwidth range (in megabits per second) shared across the network
+ interfaces of a bare metal server with this profile.
- :attr bool delete_volume_on_instance_delete: (optional) If set to true, when
- deleting the instance the volume will also be deleted.
- :attr str name: (optional) The user-defined name for this volume attachment.
- Names must be unique within the instance the volume attachment resides in.
- :attr VolumeAttachmentVolumePrototypeInstanceByVolumeContext volume: An existing
- volume to attach to the instance, or a prototype object for a new volume.
+ :attr 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,
- volume: 'VolumeAttachmentVolumePrototypeInstanceByVolumeContext',
- *,
- delete_volume_on_instance_delete: bool = None,
- name: str = None) -> None:
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str) -> None:
"""
- Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object.
+ Initialize a BareMetalServerProfileBandwidthRange object.
- :param VolumeAttachmentVolumePrototypeInstanceByVolumeContext volume: An
- existing volume to attach to the instance, or a prototype object for a new
- volume.
- :param bool delete_volume_on_instance_delete: (optional) If set to true,
- when deleting the instance the volume will also be deleted.
- :param str name: (optional) The user-defined name for this volume
- attachment. Names must be unique within the instance the volume attachment
- resides in.
+ :param 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.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.name = name
- self.volume = volume
+ # 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) -> 'VolumeAttachmentPrototypeInstanceByVolumeContext':
- """Initialize a VolumeAttachmentPrototypeInstanceByVolumeContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileBandwidthRange':
+ """Initialize a BareMetalServerProfileBandwidthRange 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 'default' in _dict:
+ args['default'] = _dict.get('default')
else:
- raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceByVolumeContext 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 VolumeAttachmentPrototypeInstanceByVolumeContext 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, '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()
+ 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):
@@ -50106,82 +58754,64 @@ 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 BareMetalServerProfileBandwidthRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> 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: 'VolumeAttachmentPrototypeInstanceByVolumeContext') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileBandwidthRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentPrototypeInstanceContext():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ RANGE = 'range'
+
+
+class BareMetalServerProfileCPUCoreCountDependent(BareMetalServerProfileCPUCoreCount):
"""
- VolumeAttachmentPrototypeInstanceContext.
+ The CPU core count for a bare metal server with this profile depends on its
+ configuration.
- :attr bool delete_volume_on_instance_delete: (optional) If set to true, when
- deleting the instance the volume will also be deleted.
- :attr str name: (optional) The user-defined name for this volume attachment.
- Names must be unique within the instance the volume attachment resides in.
- :attr VolumeAttachmentVolumePrototypeInstanceContext volume: An existing volume
- to attach to the instance, or a prototype object for a new volume.
+ :attr str type: The type for this profile field.
"""
def __init__(self,
- volume: 'VolumeAttachmentVolumePrototypeInstanceContext',
- *,
- delete_volume_on_instance_delete: bool = None,
- name: str = None) -> None:
+ type: str) -> None:
"""
- Initialize a VolumeAttachmentPrototypeInstanceContext object.
+ Initialize a BareMetalServerProfileCPUCoreCountDependent object.
- :param VolumeAttachmentVolumePrototypeInstanceContext volume: An existing
- volume to attach to the instance, or a prototype object for a new volume.
- :param bool delete_volume_on_instance_delete: (optional) If set to true,
- when deleting the instance the volume will also be deleted.
- :param str name: (optional) The user-defined name for this volume
- attachment. Names must be unique within the instance the volume attachment
- resides in.
+ :param str type: The type for this profile field.
"""
- self.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.name = name
- self.volume = volume
+ # pylint: disable=super-init-not-called
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentPrototypeInstanceContext':
- """Initialize a VolumeAttachmentPrototypeInstanceContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountDependent':
+ """Initialize a BareMetalServerProfileCPUCoreCountDependent 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 'type' in _dict:
+ args['type'] = _dict.get('type')
else:
- raise ValueError('Required property \'volume\' not present in VolumeAttachmentPrototypeInstanceContext JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentPrototypeInstanceContext 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, '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()
+ if hasattr(self, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -50189,129 +58819,83 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeAttachmentPrototypeInstanceContext object."""
+ """Return a `str` version of this BareMetalServerProfileCPUCoreCountDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentPrototypeInstanceContext') -> 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: 'VolumeAttachmentPrototypeInstanceContext') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountDependent') -> 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:
+ class TypeEnum(str, Enum):
"""
- Initialize a VolumeAttachmentPrototypeVolume object.
-
+ The type for this profile field.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumeAttachmentPrototypeVolumeVolumeIdentity', 'VolumeAttachmentPrototypeVolumeVolumePrototypeInstanceContext']))
- raise Exception(msg)
+ DEPENDENT = 'dependent'
-class VolumeAttachmentReferenceInstanceContext():
+
+class BareMetalServerProfileCPUCoreCountEnum(BareMetalServerProfileCPUCoreCount):
"""
- VolumeAttachmentReferenceInstanceContext.
+ The permitted values for CPU cores for a bare metal server with this profile.
- :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 user-defined name for this volume attachment.
- :attr VolumeReference volume: The attached volume.
+ :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,
- id: str,
- name: str,
- volume: 'VolumeReference',
- *,
- deleted: 'VolumeAttachmentReferenceInstanceContextDeleted' = None,
- device: 'VolumeAttachmentDevice' = None) -> None:
+ default: int,
+ type: str,
+ values: List[int]) -> None:
"""
- Initialize a VolumeAttachmentReferenceInstanceContext object.
+ Initialize a BareMetalServerProfileCPUCoreCountEnum object.
- :param str href: The URL for this volume attachment.
- :param str id: The unique identifier for this volume attachment.
- :param str name: The user-defined name for this volume attachment.
- :param VolumeReference volume: The attached volume.
- :param VolumeAttachmentReferenceInstanceContextDeleted deleted: (optional)
- If present, this property indicates the referenced resource has been
- deleted and provides
- 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 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.deleted = deleted
- self.device = device
- self.href = href
- self.id = id
- self.name = name
- self.volume = volume
+ # pylint: disable=super-init-not-called
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContext':
- """Initialize a VolumeAttachmentReferenceInstanceContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountEnum':
+ """Initialize a BareMetalServerProfileCPUCoreCountEnum object from a json dictionary."""
args = {}
- 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')
+ if 'default' in _dict:
+ args['default'] = _dict.get('default')
else:
- raise ValueError('Required property \'id\' not present in VolumeAttachmentReferenceInstanceContext 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 VolumeAttachmentReferenceInstanceContext JSON')
- if 'volume' in _dict:
- args['volume'] = VolumeReference.from_dict(_dict.get('volume'))
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountEnum JSON')
+ if 'values' in _dict:
+ args['values'] = _dict.get('values')
else:
- raise ValueError('Required property \'volume\' not present in VolumeAttachmentReferenceInstanceContext JSON')
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileCPUCoreCountEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentReferenceInstanceContext 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, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'device') and self.device is not None:
- _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:
- _dict['volume'] = self.volume.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, 'values') and self.values is not None:
+ _dict['values'] = self.values
return _dict
def _to_dict(self):
@@ -50319,56 +58903,73 @@ 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 BareMetalServerProfileCPUCoreCountEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentReferenceInstanceContext') -> 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: 'VolumeAttachmentReferenceInstanceContext') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentReferenceInstanceContextDeleted():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ ENUM = 'enum'
+
+
+class BareMetalServerProfileCPUCoreCountFixed(BareMetalServerProfileCPUCoreCount):
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ The CPU core count for a bare metal server with this profile.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr str type: The type for this profile field.
+ :attr int value: The value for this profile field.
"""
def __init__(self,
- more_info: str) -> None:
+ type: str,
+ value: int) -> None:
"""
- Initialize a VolumeAttachmentReferenceInstanceContextDeleted object.
+ Initialize a BareMetalServerProfileCPUCoreCountFixed object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
- self.more_info = more_info
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceInstanceContextDeleted':
- """Initialize a VolumeAttachmentReferenceInstanceContextDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountFixed':
+ """Initialize a BareMetalServerProfileCPUCoreCountFixed 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 VolumeAttachmentReferenceInstanceContextDeleted JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountFixed JSON')
+ if 'value' in _dict:
+ args['value'] = _dict.get('value')
+ else:
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUCoreCountFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentReferenceInstanceContextDeleted 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, '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, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -50376,134 +58977,102 @@ 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 BareMetalServerProfileCPUCoreCountFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentReferenceInstanceContextDeleted') -> 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: 'VolumeAttachmentReferenceInstanceContextDeleted') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentReferenceVolumeContext():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ FIXED = 'fixed'
+
+
+class BareMetalServerProfileCPUCoreCountRange(BareMetalServerProfileCPUCoreCount):
"""
- VolumeAttachmentReferenceVolumeContext.
+ The permitted range for the number of CPU cores for a bare metal server with this
+ profile.
- :attr bool delete_volume_on_instance_delete: If set to true, when deleting the
- instance the volume will also be deleted.
- :attr VolumeAttachmentReferenceVolumeContextDeleted deleted: (optional) If
- present, this property indicates the referenced resource has been deleted and
- 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 user-defined name for this volume attachment.
- :attr str type: The type of volume attachment.
+ :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,
- delete_volume_on_instance_delete: bool,
- href: str,
- id: str,
- instance: 'InstanceReference',
- name: str,
- type: str,
- *,
- deleted: 'VolumeAttachmentReferenceVolumeContextDeleted' = None,
- device: 'VolumeAttachmentDevice' = None) -> None:
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str) -> None:
"""
- Initialize a VolumeAttachmentReferenceVolumeContext object.
+ Initialize a BareMetalServerProfileCPUCoreCountRange object.
- :param bool delete_volume_on_instance_delete: If set to true, when deleting
- the instance the volume will also be deleted.
- :param str href: The URL for this volume attachment.
- :param str id: The unique identifier for this volume attachment.
- :param InstanceReference instance: The attached instance.
- :param str name: The user-defined name for this volume attachment.
- :param str 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.delete_volume_on_instance_delete = delete_volume_on_instance_delete
- self.deleted = deleted
- self.device = device
- self.href = href
- self.id = id
- self.instance = instance
- self.name = name
+ :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) -> 'VolumeAttachmentReferenceVolumeContext':
- """Initialize a VolumeAttachmentReferenceVolumeContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUCoreCountRange':
+ """Initialize a BareMetalServerProfileCPUCoreCountRange 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')
- else:
- 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')
+ if 'default' in _dict:
+ args['default'] = _dict.get('default')
else:
- raise ValueError('Required property \'href\' not present in VolumeAttachmentReferenceVolumeContext JSON')
- if 'id' in _dict:
- args['id'] = _dict.get('id')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
+ if 'max' in _dict:
+ args['max'] = _dict.get('max')
else:
- raise ValueError('Required property \'id\' not present in VolumeAttachmentReferenceVolumeContext JSON')
- if 'instance' in _dict:
- args['instance'] = InstanceReference.from_dict(_dict.get('instance'))
+ raise ValueError('Required property \'max\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
+ if 'min' in _dict:
+ args['min'] = _dict.get('min')
else:
- raise ValueError('Required property \'instance\' not present in VolumeAttachmentReferenceVolumeContext JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'min\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
+ if 'step' in _dict:
+ args['step'] = _dict.get('step')
else:
- raise ValueError('Required property \'name\' not present in VolumeAttachmentReferenceVolumeContext 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 VolumeAttachmentReferenceVolumeContext JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUCoreCountRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentReferenceVolumeContext 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, 'delete_volume_on_instance_delete') and self.delete_volume_on_instance_delete is not None:
- _dict['delete_volume_on_instance_delete'] = self.delete_volume_on_instance_delete
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
- if hasattr(self, 'device') and self.device is not None:
- _dict['device'] = self.device.to_dict()
- if hasattr(self, 'href') and self.href is not None:
- _dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'instance') and self.instance is not None:
- _dict['instance'] = self.instance.to_dict()
- if 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, '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
@@ -50513,64 +59082,64 @@ 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 BareMetalServerProfileCPUCoreCountRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentReferenceVolumeContext') -> 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: 'VolumeAttachmentReferenceVolumeContext') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUCoreCountRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
class TypeEnum(str, Enum):
"""
- The type of volume attachment.
+ The type for this profile field.
"""
- BOOT = 'boot'
- DATA = 'data'
+ RANGE = 'range'
-class VolumeAttachmentReferenceVolumeContextDeleted():
+class BareMetalServerProfileCPUSocketCountDependent(BareMetalServerProfileCPUSocketCount):
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ The CPU socket count for a bare metal server with this profile depends on its
+ configuration.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr str type: The type for this profile field.
"""
def __init__(self,
- more_info: str) -> None:
+ type: str) -> None:
"""
- Initialize a VolumeAttachmentReferenceVolumeContextDeleted object.
+ Initialize a BareMetalServerProfileCPUSocketCountDependent object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str type: The type for this profile field.
"""
- self.more_info = more_info
+ # pylint: disable=super-init-not-called
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeAttachmentReferenceVolumeContextDeleted':
- """Initialize a VolumeAttachmentReferenceVolumeContextDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountDependent':
+ """Initialize a BareMetalServerProfileCPUSocketCountDependent 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 VolumeAttachmentReferenceVolumeContextDeleted JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeAttachmentReferenceVolumeContextDeleted 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, '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
return _dict
def _to_dict(self):
@@ -50578,120 +59147,157 @@ 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 BareMetalServerProfileCPUSocketCountDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeAttachmentReferenceVolumeContextDeleted') -> 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: 'VolumeAttachmentReferenceVolumeContextDeleted') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeAttachmentVolumePrototypeInstanceByVolumeContext():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ DEPENDENT = 'dependent'
+
+
+class BareMetalServerProfileCPUSocketCountEnum(BareMetalServerProfileCPUSocketCount):
"""
- An existing volume to attach to the instance, or a prototype object for a new volume.
+ The permitted values for CPU sockets 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.
+ :attr List[int] values: The permitted values for this profile field.
"""
- def __init__(self) -> None:
+ def __init__(self,
+ default: int,
+ type: str,
+ values: List[int]) -> None:
"""
- Initialize a VolumeAttachmentVolumePrototypeInstanceByVolumeContext object.
+ Initialize a BareMetalServerProfileCPUSocketCountEnum 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.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext']))
- raise Exception(msg)
+ # pylint: disable=super-init-not-called
+ self.default = default
+ self.type = type
+ self.values = values
-class VolumeAttachmentVolumePrototypeInstanceContext():
- """
- An existing volume to attach to the instance, or a prototype object for a new volume.
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountEnum':
+ """Initialize a BareMetalServerProfileCPUSocketCountEnum 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 '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')
+ return cls(**args)
- """
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a BareMetalServerProfileCPUSocketCountEnum object from a json dictionary."""
+ return cls.from_dict(_dict)
- def __init__(self) -> None:
- """
- Initialize a VolumeAttachmentVolumePrototypeInstanceContext object.
+ 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 BareMetalServerProfileCPUSocketCountEnum object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: 'BareMetalServerProfileCPUSocketCountEnum') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+ class TypeEnum(str, Enum):
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentity', 'VolumeAttachmentVolumePrototypeInstanceContextVolumePrototypeInstanceContext']))
- raise Exception(msg)
+ The type for this profile field.
+ """
+ ENUM = 'enum'
-class VolumeCollection():
+
+class BareMetalServerProfileCPUSocketCountFixed(BareMetalServerProfileCPUSocketCount):
"""
- VolumeCollection.
+ The number of CPU sockets for a bare metal server with this profile.
- :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 List[Volume] volumes: Collection of volumes.
+ :attr str type: The type for this profile field.
+ :attr int value: The value for this profile field.
"""
def __init__(self,
- first: 'VolumeCollectionFirst',
- limit: int,
- volumes: List['Volume'],
- *,
- next: 'VolumeCollectionNext' = None) -> None:
+ type: str,
+ value: int) -> None:
"""
- Initialize a VolumeCollection object.
+ Initialize a BareMetalServerProfileCPUSocketCountFixed 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 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 str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
- self.first = first
- self.limit = limit
- self.next = next
- self.volumes = volumes
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeCollection':
- """Initialize a VolumeCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountFixed':
+ """Initialize a BareMetalServerProfileCPUSocketCountFixed 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')
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
else:
- raise ValueError('Required property \'limit\' not present in VolumeCollection JSON')
- if 'next' in _dict:
- args['next'] = VolumeCollectionNext.from_dict(_dict.get('next'))
- if 'volumes' in _dict:
- args['volumes'] = [Volume.from_dict(x) for x in _dict.get('volumes')]
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountFixed JSON')
+ if 'value' in _dict:
+ args['value'] = _dict.get('value')
else:
- raise ValueError('Required property \'volumes\' not present in VolumeCollection JSON')
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileCPUSocketCountFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeCollection object from a json dictionary."""
+ """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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'volumes') and self.volumes is not None:
- _dict['volumes'] = [x.to_dict() for x in self.volumes]
+ 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):
@@ -50699,55 +59305,104 @@ 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 BareMetalServerProfileCPUSocketCountFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeCollection') -> bool:
+ 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: 'VolumeCollection') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeCollectionFirst():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ FIXED = 'fixed'
+
+
+class BareMetalServerProfileCPUSocketCountRange(BareMetalServerProfileCPUSocketCount):
"""
- A link to the first page of resources.
+ The permitted range for the number of CPU sockets for a bare metal server with this
+ profile.
- :attr str href: The URL for a page of resources.
+ :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) -> None:
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str) -> None:
"""
- Initialize a VolumeCollectionFirst object.
+ Initialize a BareMetalServerProfileCPUSocketCountRange object.
- :param str href: The URL for a page of resources.
+ :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.href = href
+ # 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) -> 'VolumeCollectionFirst':
- """Initialize a VolumeCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileCPUSocketCountRange':
+ """Initialize a BareMetalServerProfileCPUSocketCountRange 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 VolumeCollectionFirst JSON')
+ 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')
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileCPUSocketCountRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeCollectionFirst 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, '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, '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):
@@ -50755,56 +59410,64 @@ 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 BareMetalServerProfileCPUSocketCountRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeCollectionFirst') -> 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: 'VolumeCollectionFirst') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileCPUSocketCountRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeCollectionNext():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ RANGE = 'range'
+
+
+class BareMetalServerProfileDiskQuantityDependent(BareMetalServerProfileDiskQuantity):
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ The number of disks of this configuration for a bare metal server with this profile
+ depends on its bare metal server configuration.
- :attr str href: The URL for a page of resources.
+ :attr str type: The type for this profile field.
"""
def __init__(self,
- href: str) -> None:
+ type: str) -> None:
"""
- Initialize a VolumeCollectionNext object.
+ Initialize a BareMetalServerProfileDiskQuantityDependent object.
- :param str href: The URL for a page of resources.
+ :param str type: The type for this profile field.
"""
- self.href = href
+ # pylint: disable=super-init-not-called
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeCollectionNext':
- """Initialize a VolumeCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityDependent':
+ """Initialize a BareMetalServerProfileDiskQuantityDependent 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 VolumeCollectionNext JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeCollectionNext object from a json dictionary."""
+ """Initialize a BareMetalServerProfileDiskQuantityDependent object from 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):
@@ -50812,120 +59475,84 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumeCollectionNext object."""
+ """Return a `str` version of this BareMetalServerProfileDiskQuantityDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeCollectionNext') -> bool:
+ 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: 'VolumeCollectionNext') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskQuantityDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeIdentity():
- """
- Identifies a volume by a unique property.
-
- """
-
- def __init__(self) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a VolumeIdentity object.
-
+ The type for this profile field.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumeIdentityById', 'VolumeIdentityByCRN', 'VolumeIdentityByHref']))
- raise Exception(msg)
+ DEPENDENT = 'dependent'
-class VolumePatch():
+
+class BareMetalServerProfileDiskQuantityEnum(BareMetalServerProfileDiskQuantity):
"""
- VolumePatch.
+ The permitted the number of disks of this configuration for a bare metal server with
+ this profile.
- :attr int capacity: (optional) The capacity to use for the volume (in
- gigabytes). The volume must be attached as a data volume to a running virtual
- server instance, and the specified value must not be less than the current
- capacity.
- 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 the volume. Applicable only to volumes using a profile `family` of `custom`.
- The volume must be attached as a data volume to a running virtual server
- instance.
- :attr str name: (optional) The unique user-defined name for this volume.
- :attr 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.
+ :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,
- *,
- capacity: int = None,
- iops: int = None,
- name: str = None,
- profile: 'VolumeProfileIdentity' = None) -> None:
+ default: int,
+ type: str,
+ values: List[int]) -> None:
"""
- Initialize a VolumePatch object.
+ Initialize a BareMetalServerProfileDiskQuantityEnum object.
- :param int capacity: (optional) The capacity to use for the volume (in
- gigabytes). The volume must be attached as a data volume to a running
- virtual server instance, and the specified value must not be less than the
- current capacity.
- 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 the volume. Applicable only to volumes using a profile `family` of
- `custom`. The volume must be attached as a data volume to a running virtual
- server instance.
- :param str name: (optional) The unique user-defined name for this volume.
- :param 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.
+ :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.capacity = capacity
- self.iops = iops
- self.name = name
- self.profile = profile
+ # pylint: disable=super-init-not-called
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumePatch':
- """Initialize a VolumePatch object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityEnum':
+ """Initialize a BareMetalServerProfileDiskQuantityEnum 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 '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')
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskQuantityEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumePatch 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, '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, '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):
@@ -50933,83 +59560,73 @@ 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 BareMetalServerProfileDiskQuantityEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumePatch') -> 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: 'VolumePatch') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskQuantityEnum') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeProfile():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ ENUM = 'enum'
+
+
+class BareMetalServerProfileDiskQuantityFixed(BareMetalServerProfileDiskQuantity):
"""
- VolumeProfile.
+ The number of disks of this configuration for a bare metal server with this profile.
- :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.
+ :attr str type: The type for this profile field.
+ :attr int value: The value for this profile field.
"""
def __init__(self,
- family: str,
- href: str,
- name: str) -> None:
+ type: str,
+ value: int) -> None:
"""
- Initialize a VolumeProfile object.
+ Initialize a BareMetalServerProfileDiskQuantityFixed 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 type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
- self.family = family
- self.href = href
- self.name = name
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfile':
- """Initialize a VolumeProfile object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityFixed':
+ """Initialize a BareMetalServerProfileDiskQuantityFixed 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')
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
else:
- raise ValueError('Required property \'href\' not present in VolumeProfile JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskQuantityFixed JSON')
+ if 'value' in _dict:
+ args['value'] = _dict.get('value')
else:
- raise ValueError('Required property \'name\' not present in VolumeProfile JSON')
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskQuantityFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfile 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, '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, '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):
@@ -51017,113 +59634,104 @@ 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 BareMetalServerProfileDiskQuantityFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfile') -> 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: 'VolumeProfile') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskQuantityFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
- class FamilyEnum(str, Enum):
+ class TypeEnum(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.
+ The type for this profile field.
"""
- CUSTOM = 'custom'
- TIERED = 'tiered'
+ FIXED = 'fixed'
-class VolumeProfileCollection():
+class BareMetalServerProfileDiskQuantityRange(BareMetalServerProfileDiskQuantity):
"""
- VolumeProfileCollection.
+ The permitted range for the number of disks of this configuration for a bare metal
+ server with this profile.
- :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 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,
- first: 'VolumeProfileCollectionFirst',
- limit: int,
- profiles: List['VolumeProfile'],
- total_count: int,
- *,
- next: 'VolumeProfileCollectionNext' = None) -> None:
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str) -> None:
"""
- Initialize a VolumeProfileCollection object.
+ Initialize a BareMetalServerProfileDiskQuantityRange 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 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.first = first
- self.limit = limit
- self.next = next
- self.profiles = profiles
- self.total_count = total_count
+ # 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) -> 'VolumeProfileCollection':
- """Initialize a VolumeProfileCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskQuantityRange':
+ """Initialize a BareMetalServerProfileDiskQuantityRange object from a json dictionary."""
args = {}
- if 'first' in _dict:
- args['first'] = VolumeProfileCollectionFirst.from_dict(_dict.get('first'))
+ if 'default' in _dict:
+ args['default'] = _dict.get('default')
else:
- raise ValueError('Required property \'first\' not present in VolumeProfileCollection JSON')
- if 'limit' in _dict:
- args['limit'] = _dict.get('limit')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileDiskQuantityRange JSON')
+ if 'max' in _dict:
+ args['max'] = _dict.get('max')
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(x) for x in _dict.get('profiles')]
+ raise ValueError('Required property \'max\' not present in BareMetalServerProfileDiskQuantityRange JSON')
+ if 'min' in _dict:
+ args['min'] = _dict.get('min')
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 \'min\' not present in BareMetalServerProfileDiskQuantityRange JSON')
+ if 'step' in _dict:
+ args['step'] = _dict.get('step')
else:
- raise ValueError('Required property \'total_count\' not present in VolumeProfileCollection JSON')
+ 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 VolumeProfileCollection 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, 'first') and self.first is not None:
- _dict['first'] = self.first.to_dict()
- if hasattr(self, 'limit') and self.limit is not None:
- _dict['limit'] = self.limit
- if hasattr(self, 'next') and self.next is not None:
- _dict['next'] = self.next.to_dict()
- if hasattr(self, 'profiles') and self.profiles is not None:
- _dict['profiles'] = [x.to_dict() for x in self.profiles]
- 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, '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):
@@ -51131,55 +59739,64 @@ 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 BareMetalServerProfileDiskQuantityRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileCollection') -> 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: 'VolumeProfileCollection') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskQuantityRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeProfileCollectionFirst():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ RANGE = 'range'
+
+
+class BareMetalServerProfileDiskSizeDependent(BareMetalServerProfileDiskSize):
"""
- A link to the first page of resources.
+ 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 href: The URL for a page of resources.
+ :attr str type: The type for this profile field.
"""
def __init__(self,
- href: str) -> None:
+ type: str) -> None:
"""
- Initialize a VolumeProfileCollectionFirst object.
+ Initialize a BareMetalServerProfileDiskSizeDependent object.
- :param str href: The URL for a page of resources.
+ :param str type: The type for this profile field.
"""
- self.href = href
+ # pylint: disable=super-init-not-called
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionFirst':
- """Initialize a VolumeProfileCollectionFirst object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeDependent':
+ """Initialize a BareMetalServerProfileDiskSizeDependent 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 VolumeProfileCollectionFirst JSON')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfileCollectionFirst object from a json dictionary."""
+ """Initialize a BareMetalServerProfileDiskSizeDependent object from 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):
@@ -51187,56 +59804,84 @@ 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 BareMetalServerProfileDiskSizeDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileCollectionFirst') -> 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: 'VolumeProfileCollectionFirst') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskSizeDependent') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeProfileCollectionNext():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ DEPENDENT = 'dependent'
+
+
+class BareMetalServerProfileDiskSizeEnum(BareMetalServerProfileDiskSize):
"""
- A link to the next page of resources. This property is present for all pages except
- the last page.
+ The permitted disk size in GB (gigabytes) of this configuration for a bare metal
+ server with this profile.
- :attr str href: The URL for a page of resources.
+ :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) -> None:
+ default: int,
+ type: str,
+ values: List[int]) -> None:
"""
- Initialize a VolumeProfileCollectionNext object.
+ Initialize a BareMetalServerProfileDiskSizeEnum object.
- :param str href: The URL for a page of resources.
+ :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.href = href
+ # pylint: disable=super-init-not-called
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfileCollectionNext':
- """Initialize a VolumeProfileCollectionNext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeEnum':
+ """Initialize a BareMetalServerProfileDiskSizeEnum 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 VolumeProfileCollectionNext 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 BareMetalServerProfileDiskSizeEnum JSON')
+ if 'values' in _dict:
+ args['values'] = _dict.get('values')
+ else:
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileDiskSizeEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfileCollectionNext object from a json dictionary."""
+ """Initialize a BareMetalServerProfileDiskSizeEnum object from 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):
@@ -51244,80 +59889,73 @@ 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 BareMetalServerProfileDiskSizeEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileCollectionNext') -> 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: 'VolumeProfileCollectionNext') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskSizeEnum') -> 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 TypeEnum(str, Enum):
"""
- Initialize a VolumeProfileIdentity object.
-
+ The type for this profile field.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumeProfileIdentityByName', 'VolumeProfileIdentityByHref']))
- raise Exception(msg)
+ ENUM = 'enum'
-class VolumeProfileReference():
+
+class BareMetalServerProfileDiskSizeFixed(BareMetalServerProfileDiskSize):
"""
- VolumeProfileReference.
+ The size of the disk in GB (gigabytes).
- :attr str href: The URL for this volume profile.
- :attr str name: The globally unique name for this volume profile.
+ :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) -> None:
+ type: str,
+ value: int) -> None:
"""
- Initialize a VolumeProfileReference object.
+ Initialize a BareMetalServerProfileDiskSizeFixed object.
- :param str href: The URL for this volume profile.
- :param str name: The globally unique name for this volume profile.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
- self.href = href
- self.name = name
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeProfileReference':
- """Initialize a VolumeProfileReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeFixed':
+ """Initialize a BareMetalServerProfileDiskSizeFixed 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 VolumeProfileReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeFixed JSON')
+ if 'value' in _dict:
+ args['value'] = _dict.get('value')
else:
- raise ValueError('Required property \'name\' not present in VolumeProfileReference JSON')
+ raise ValueError('Required property \'value\' not present in BareMetalServerProfileDiskSizeFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeProfileReference object from a json dictionary."""
+ """Initialize a BareMetalServerProfileDiskSizeFixed object from 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
+ if hasattr(self, 'value') and self.value is not None:
+ _dict['value'] = self.value
return _dict
def _to_dict(self):
@@ -51325,153 +59963,104 @@ 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 BareMetalServerProfileDiskSizeFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeProfileReference') -> 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: 'VolumeProfileReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskSizeFixed') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumePrototype():
- """
- VolumePrototype.
-
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
- for the volume. Applicable only to volumes using a profile `family` of `custom`.
- :attr str name: (optional) The unique user-defined name for this volume.
- :attr VolumeProfileIdentity profile: The profile to use for this volume.
- :attr 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 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) -> None:
+ class TypeEnum(str, Enum):
"""
- Initialize a VolumePrototype object.
-
- :param VolumeProfileIdentity profile: The profile to use for this volume.
- :param ZoneIdentity zone: The zone this volume will reside in.
- :param int iops: (optional) The maximum I/O operations per second (IOPS) to
- use for the volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :param str name: (optional) The unique user-defined name for this volume.
- :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.
+ The type for this profile field.
"""
- msg = "Cannot instantiate base class. Instead, instantiate one of the defined subclasses: {0}".format(
- ", ".join(['VolumePrototypeVolumeByCapacity']))
- raise Exception(msg)
+ FIXED = 'fixed'
-class VolumePrototypeInstanceByImageContext():
+
+class BareMetalServerProfileDiskSizeRange(BareMetalServerProfileDiskSize):
"""
- VolumePrototypeInstanceByImageContext.
+ The permitted range for the disk size of this configuration in GB (gigabytes) for a
+ bare metal server with this profile.
- :attr int capacity: (optional) The capacity to use for the volume (in
- gigabytes). The only allowed value is the image's `minimum_provisioned_size`,
- but the allowed values are expected to expand in the future.
- If unspecified, the capacity will be the image's `minimum_provisioned_size`.
- :attr EncryptionKeyIdentity encryption_key: (optional) The root key to use to
- wrap the data encryption key for the volume.
- If unspecified, and the image is encrypted, the image's `encryption_key` will be
- used. Otherwise, the `encryption` type for the volume will be
- `provider_managed`.
- :attr int iops: (optional) The maximum I/O operations per second (IOPS) to use
- for the volume. Applicable only to volumes using a profile `family` of `custom`.
- :attr str name: (optional) The unique user-defined name for this volume.
- :attr VolumeProfileIdentity profile: The profile to use for this volume.
+ :attr 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,
- profile: 'VolumeProfileIdentity',
- *,
- capacity: int = None,
- encryption_key: 'EncryptionKeyIdentity' = None,
- iops: int = None,
- name: str = None) -> None:
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str) -> None:
"""
- Initialize a VolumePrototypeInstanceByImageContext object.
+ Initialize a BareMetalServerProfileDiskSizeRange object.
- :param VolumeProfileIdentity profile: The profile to use for this volume.
- :param int capacity: (optional) The capacity to use for the volume (in
- gigabytes). The only allowed value is the image's
- `minimum_provisioned_size`, but the allowed values are expected to expand
- in the future.
- 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, and the image is encrypted, the image's `encryption_key`
- will be
- used. Otherwise, the `encryption` type for the volume will be
- `provider_managed`.
- :param int iops: (optional) The maximum I/O operations per second (IOPS) to
- use for the volume. Applicable only to volumes using a profile `family` of
- `custom`.
- :param str name: (optional) The unique user-defined name for this volume.
+ :param 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.capacity = capacity
- self.encryption_key = encryption_key
- self.iops = iops
- self.name = name
- self.profile = profile
+ # 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) -> 'VolumePrototypeInstanceByImageContext':
- """Initialize a VolumePrototypeInstanceByImageContext object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileDiskSizeRange':
+ """Initialize a BareMetalServerProfileDiskSizeRange 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')
+ if 'default' in _dict:
+ args['default'] = _dict.get('default')
else:
- raise ValueError('Required property \'profile\' not present in VolumePrototypeInstanceByImageContext 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 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')
+ else:
+ raise ValueError('Required property \'type\' not present in BareMetalServerProfileDiskSizeRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumePrototypeInstanceByImageContext object from a json dictionary."""
+ """Initialize a BareMetalServerProfileDiskSizeRange object from 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, '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):
@@ -51479,98 +60068,63 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this VolumePrototypeInstanceByImageContext object."""
+ """Return a `str` version of this BareMetalServerProfileDiskSizeRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumePrototypeInstanceByImageContext') -> 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: 'VolumePrototypeInstanceByImageContext') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileDiskSizeRange') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeReference():
+ class TypeEnum(str, Enum):
+ """
+ The type for this profile field.
+ """
+ RANGE = 'range'
+
+
+class BareMetalServerProfileIdentityByHref(BareMetalServerProfileIdentity):
"""
- VolumeReference.
+ BareMetalServerProfileIdentityByHref.
- :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 unique user-defined name for this volume.
+ :attr str href: The URL for this bare metal server profile.
"""
def __init__(self,
- crn: str,
- href: str,
- id: str,
- name: str,
- *,
- deleted: 'VolumeReferenceDeleted' = None) -> None:
+ href: str) -> None:
"""
- Initialize a VolumeReference object.
+ Initialize a BareMetalServerProfileIdentityByHref 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 unique user-defined name for this volume.
- :param VolumeReferenceDeleted deleted: (optional) If present, this property
- indicates the referenced resource has been deleted and provides
- some supplementary information.
+ :param str href: The URL for this bare metal server profile.
"""
- self.crn = crn
- self.deleted = deleted
- self.href = href
- self.id = id
- self.name = name
-
- @classmethod
- 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'] = VolumeReferenceDeleted.from_dict(_dict.get('deleted'))
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- 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 VolumeReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ # 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 \'name\' not present in VolumeReference JSON')
+ raise ValueError('Required property \'href\' not present in BareMetalServerProfileIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeReference object from a json dictionary."""
+ """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, 'crn') and self.crn is not None:
- _dict['crn'] = self.crn
- if hasattr(self, 'deleted') and self.deleted is not None:
- _dict['deleted'] = self.deleted.to_dict()
if hasattr(self, 'href') and self.href is not None:
_dict['href'] = self.href
- if hasattr(self, 'id') and self.id is not None:
- _dict['id'] = self.id
- if hasattr(self, 'name') and self.name is not None:
- _dict['name'] = self.name
return _dict
def _to_dict(self):
@@ -51578,56 +60132,56 @@ 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 BareMetalServerProfileIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeReference') -> bool:
+ 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: 'VolumeReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeReferenceDeleted():
+class BareMetalServerProfileIdentityByName(BareMetalServerProfileIdentity):
"""
- If present, this property indicates the referenced resource has been deleted and
- provides some supplementary information.
+ BareMetalServerProfileIdentityByName.
- :attr str more_info: Link to documentation about deleted resources.
+ :attr str name: The name for this bare metal server profile.
"""
def __init__(self,
- more_info: str) -> None:
+ name: str) -> None:
"""
- Initialize a VolumeReferenceDeleted object.
+ Initialize a BareMetalServerProfileIdentityByName object.
- :param str more_info: Link to documentation about deleted resources.
+ :param str name: The name for this bare metal server profile.
"""
- self.more_info = more_info
+ # pylint: disable=super-init-not-called
+ self.name = name
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeReferenceDeleted':
- """Initialize a VolumeReferenceDeleted object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileIdentityByName':
+ """Initialize a BareMetalServerProfileIdentityByName object from a json dictionary."""
args = {}
- if 'more_info' in _dict:
- args['more_info'] = _dict.get('more_info')
+ if 'name' in _dict:
+ args['name'] = _dict.get('name')
else:
- raise ValueError('Required property \'more_info\' not present in VolumeReferenceDeleted JSON')
+ raise ValueError('Required property \'name\' not present in BareMetalServerProfileIdentityByName JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeReferenceDeleted object from a json dictionary."""
+ """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, '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):
@@ -51635,76 +60189,57 @@ 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 BareMetalServerProfileIdentityByName object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeReferenceDeleted') -> bool:
+ 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: 'VolumeReferenceDeleted') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileIdentityByName') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class VolumeStatusReason():
+class BareMetalServerProfileMemoryDependent(BareMetalServerProfileMemory):
"""
- VolumeStatusReason.
+ The memory value for a bare metal server with this profile depends on its
+ configuration.
- :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 type: The type for this profile field.
"""
def __init__(self,
- code: str,
- message: str,
- *,
- more_info: str = None) -> None:
+ type: str) -> None:
"""
- Initialize a VolumeStatusReason object.
+ Initialize a BareMetalServerProfileMemoryDependent 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 type: The type for this profile field.
"""
- self.code = code
- self.message = message
- self.more_info = more_info
+ # pylint: disable=super-init-not-called
+ self.type = type
@classmethod
- def from_dict(cls, _dict: Dict) -> 'VolumeStatusReason':
- """Initialize a VolumeStatusReason object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryDependent':
+ """Initialize a BareMetalServerProfileMemoryDependent object from a json dictionary."""
args = {}
- if 'code' in _dict:
- args['code'] = _dict.get('code')
- else:
- raise ValueError('Required property \'code\' not present in VolumeStatusReason JSON')
- if 'message' in _dict:
- args['message'] = _dict.get('message')
+ 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 BareMetalServerProfileMemoryDependent JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a VolumeStatusReason object from a json dictionary."""
+ """Initialize a BareMetalServerProfileMemoryDependent object from 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, 'type') and self.type is not None:
+ _dict['type'] = self.type
return _dict
def _to_dict(self):
@@ -51712,92 +60247,83 @@ 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 BareMetalServerProfileMemoryDependent object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'VolumeStatusReason') -> 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: 'VolumeStatusReason') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileMemoryDependent') -> 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'
+ DEPENDENT = 'dependent'
-class Zone():
+class BareMetalServerProfileMemoryEnum(BareMetalServerProfileMemory):
"""
- Zone.
+ The permitted memory values (in gibibytes) for 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 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,
- name: str,
- region: 'RegionReference',
- status: str) -> None:
+ default: int,
+ type: str,
+ values: List[int]) -> None:
"""
- Initialize a Zone object.
+ Initialize a BareMetalServerProfileMemoryEnum 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 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.href = href
- self.name = name
- self.region = region
- self.status = status
+ # pylint: disable=super-init-not-called
+ self.default = default
+ self.type = type
+ self.values = values
@classmethod
- def from_dict(cls, _dict: Dict) -> 'Zone':
- """Initialize a Zone object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryEnum':
+ """Initialize a BareMetalServerProfileMemoryEnum 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')
+ if 'default' in _dict:
+ args['default'] = _dict.get('default')
else:
- raise ValueError('Required property \'name\' not present in Zone JSON')
- if 'region' in _dict:
- args['region'] = RegionReference.from_dict(_dict.get('region'))
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryEnum JSON')
+ 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 BareMetalServerProfileMemoryEnum JSON')
+ if 'values' in _dict:
+ args['values'] = _dict.get('values')
else:
- raise ValueError('Required property \'status\' not present in Zone JSON')
+ raise ValueError('Required property \'values\' not present in BareMetalServerProfileMemoryEnum JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a Zone object from a json dictionary."""
+ """Initialize a BareMetalServerProfileMemoryEnum object from 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:
- _dict['region'] = self.region.to_dict()
- if hasattr(self, 'status') and self.status is not None:
- _dict['status'] = self.status
+ 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):
@@ -51805,64 +60331,73 @@ 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 BareMetalServerProfileMemoryEnum object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'Zone') -> 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: 'Zone') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileMemoryEnum') -> 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'
+ ENUM = 'enum'
-class ZoneCollection():
+class BareMetalServerProfileMemoryFixed(BareMetalServerProfileMemory):
"""
- ZoneCollection.
+ The memory (in gibibytes) for a bare metal server with this profile.
- :attr List[Zone] zones: Collection of zones.
+ :attr str type: The type for this profile field.
+ :attr int value: The value for this profile field.
"""
def __init__(self,
- zones: List['Zone']) -> None:
+ type: str,
+ value: int) -> None:
"""
- Initialize a ZoneCollection object.
+ Initialize a BareMetalServerProfileMemoryFixed object.
- :param List[Zone] zones: Collection of zones.
+ :param str type: The type for this profile field.
+ :param int value: The value for this profile field.
"""
- self.zones = zones
+ # pylint: disable=super-init-not-called
+ self.type = type
+ self.value = value
@classmethod
- def from_dict(cls, _dict: Dict) -> 'ZoneCollection':
- """Initialize a ZoneCollection object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryFixed':
+ """Initialize a BareMetalServerProfileMemoryFixed object from a json dictionary."""
args = {}
- if 'zones' in _dict:
- args['zones'] = [Zone.from_dict(x) for x in _dict.get('zones')]
+ if 'type' in _dict:
+ args['type'] = _dict.get('type')
else:
- raise ValueError('Required property \'zones\' not present in ZoneCollection 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 BareMetalServerProfileMemoryFixed JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ZoneCollection object from a json dictionary."""
+ """Initialize a BareMetalServerProfileMemoryFixed object from 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:
- _dict['zones'] = [x.to_dict() for x in self.zones]
+ 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):
@@ -51870,80 +60405,103 @@ 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 BareMetalServerProfileMemoryFixed object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ZoneCollection') -> 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: 'ZoneCollection') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileMemoryFixed') -> 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)
+ FIXED = 'fixed'
-class ZoneReference():
+
+class BareMetalServerProfileMemoryRange(BareMetalServerProfileMemory):
"""
- ZoneReference.
+ The permitted memory range (in gibibytes) for 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 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,
- name: str) -> None:
+ default: int,
+ max: int,
+ min: int,
+ step: int,
+ type: str) -> None:
"""
- Initialize a ZoneReference object.
+ Initialize a BareMetalServerProfileMemoryRange object.
- :param str href: The URL for this zone.
- :param str name: The globally unique name for this zone.
+ :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.href = href
- self.name = name
+ # 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) -> 'ZoneReference':
- """Initialize a ZoneReference object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'BareMetalServerProfileMemoryRange':
+ """Initialize a BareMetalServerProfileMemoryRange 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 ZoneReference JSON')
- if 'name' in _dict:
- args['name'] = _dict.get('name')
+ raise ValueError('Required property \'default\' not present in BareMetalServerProfileMemoryRange JSON')
+ if 'max' in _dict:
+ args['max'] = _dict.get('max')
else:
- raise ValueError('Required property \'name\' not present in ZoneReference 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 BareMetalServerProfileMemoryRange JSON')
+ if 'step' in _dict:
+ args['step'] = _dict.get('step')
+ else:
+ 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 BareMetalServerProfileMemoryRange JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a ZoneReference object from a json dictionary."""
+ """Initialize a BareMetalServerProfileMemoryRange object from 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, '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):
@@ -51951,19 +60509,26 @@ 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 BareMetalServerProfileMemoryRange object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'ZoneReference') -> 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: 'ZoneReference') -> bool:
+ def __ne__(self, other: 'BareMetalServerProfileMemoryRange') -> 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 CertificateInstanceIdentityByCRN(CertificateInstanceIdentity):
"""
CertificateInstanceIdentityByCRN.
@@ -54058,120 +62623,6 @@ def __ne__(self, other: 'FloatingIPByTargetNetworkInterfaceIdentityNetworkInterf
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(FloatingIPPatchTargetNetworkInterfaceIdentity):
- """
- FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.
-
- :attr str href: The URL for this network interface.
- """
-
- def __init__(self,
- href: str) -> None:
- """
- Initialize a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object.
-
- :param str href: The URL for this network interface.
- """
- # pylint: disable=super-init-not-called
- self.href = href
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref':
- """Initialize a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from a json dictionary."""
- args = {}
- if 'href' in _dict:
- args['href'] = _dict.get('href')
- else:
- raise ValueError('Required property \'href\' not present in FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object from 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 FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
-class FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById(FloatingIPPatchTargetNetworkInterfaceIdentity):
- """
- FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.
-
- :attr str id: The unique identifier for this network interface.
- """
-
- def __init__(self,
- id: str) -> None:
- """
- Initialize a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById object.
-
- :param str id: The unique identifier for this network interface.
- """
- # pylint: disable=super-init-not-called
- self.id = id
-
- @classmethod
- def from_dict(cls, _dict: Dict) -> 'FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById':
- """Initialize a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById object from a json dictionary."""
- args = {}
- if 'id' in _dict:
- args['id'] = _dict.get('id')
- else:
- raise ValueError('Required property \'id\' not present in FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById JSON')
- return cls(**args)
-
- @classmethod
- def _from_dict(cls, _dict):
- """Initialize a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById object from 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 FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById object."""
- return json.dumps(self.to_dict(), indent=2)
-
- def __eq__(self, other: 'FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
- """Return `true` when self and other are equal, false otherwise."""
- if not isinstance(other, self.__class__):
- return False
- return self.__dict__ == other.__dict__
-
- def __ne__(self, other: 'FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById') -> bool:
- """Return `true` when self and other are not equal, false otherwise."""
- return not self == other
-
class FloatingIPPrototypeFloatingIPByTarget(FloatingIPPrototype):
"""
FloatingIPPrototypeFloatingIPByTarget.
@@ -54340,6 +62791,120 @@ def __ne__(self, other: 'FloatingIPPrototypeFloatingIPByZone') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+class FloatingIPTargetPatchNetworkInterfaceIdentityByHref(FloatingIPTargetPatch):
+ """
+ FloatingIPTargetPatchNetworkInterfaceIdentityByHref.
+
+ :attr str href: The URL for this network interface.
+ """
+
+ def __init__(self,
+ href: str) -> None:
+ """
+ Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityByHref object.
+
+ :param str href: The URL for this network interface.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchNetworkInterfaceIdentityByHref':
+ """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityByHref object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in FloatingIPTargetPatchNetworkInterfaceIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityByHref object from 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 FloatingIPTargetPatchNetworkInterfaceIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class FloatingIPTargetPatchNetworkInterfaceIdentityById(FloatingIPTargetPatch):
+ """
+ FloatingIPTargetPatchNetworkInterfaceIdentityById.
+
+ :attr str id: The unique identifier for this network interface.
+ """
+
+ def __init__(self,
+ id: str) -> None:
+ """
+ Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityById object.
+
+ :param str id: The unique identifier for this network interface.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'FloatingIPTargetPatchNetworkInterfaceIdentityById':
+ """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityById object from a json dictionary."""
+ args = {}
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
+ else:
+ raise ValueError('Required property \'id\' not present in FloatingIPTargetPatchNetworkInterfaceIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a FloatingIPTargetPatchNetworkInterfaceIdentityById object from 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 FloatingIPTargetPatchNetworkInterfaceIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'FloatingIPTargetPatchNetworkInterfaceIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
class FloatingIPTargetNetworkInterfaceReference(FloatingIPTarget):
"""
FloatingIPTargetNetworkInterfaceReference.
@@ -55486,7 +64051,8 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototype(InstanceGroupM
InstanceGroupManagerActionPrototypeScheduledActionPrototype.
:attr str name: (optional) The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
"""
def __init__(self,
@@ -55496,7 +64062,8 @@ def __init__(self,
Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototype object.
:param str name: (optional) The user-defined name for this instance group
- manager action. Names must be unique within the instance group manager.
+ manager action. Names must be unique within 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(
@@ -55520,7 +64087,6 @@ class InstanceGroupManagerActionScheduledAction(InstanceGroupManagerAction):
:attr str href: The URL for this instance group manager action.
:attr str id: The unique identifier for this instance group manager action.
:attr str name: The user-defined name for this instance group manager action.
- Names must be unique within 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
@@ -55571,7 +64137,7 @@ def __init__(self,
:param str id: The unique identifier for this instance group manager
action.
:param str name: The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action.
:param str resource_type: The resource type.
:param str status: The status of the instance group action
- `active`: Action is ready to be run
@@ -55638,8 +64204,7 @@ class InstanceGroupManagerAutoScale(InstanceGroupManager):
:attr str id: The unique identifier for this instance group manager.
:attr bool management_enabled: Indicates whether this manager will control the
instance group.
- :attr str name: The user-defined name for this instance group manager. Names
- must be unique within the instance group.
+ :attr str name: The user-defined name for this instance group manager.
: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
@@ -55678,7 +64243,6 @@ def __init__(self,
:param bool management_enabled: Indicates whether this manager will control
the instance group.
:param str name: The user-defined name for this instance group manager.
- Names must be unique within 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
@@ -55825,7 +64389,8 @@ class InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototy
InstanceGroupManagerPolicyPrototypeInstanceGroupManagerTargetPolicyPrototype.
:attr str name: (optional) The user-defined name for this instance group manager
- policy. Names must be unique within the instance group manager.
+ policy. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
:attr str 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.
@@ -55844,7 +64409,8 @@ def __init__(self,
:param int metric_value: The metric value to be evaluated.
:param str policy_type: The type of policy for the instance group.
:param str name: (optional) The user-defined name for this instance group
- manager policy. Names must be unique within the instance group manager.
+ manager policy. Names must be unique within 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
@@ -55934,7 +64500,6 @@ class InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy(InstanceGroupMa
:attr str href: The URL for this instance group manager policy.
:attr str id: The unique identifier for this instance group manager policy.
:attr str name: The user-defined name for this instance group manager policy.
- Names must be unique within 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.
@@ -55960,7 +64525,7 @@ def __init__(self,
:param str id: The unique identifier for this instance group manager
policy.
:param str name: The user-defined name for this instance group manager
- policy. Names must be unique within the instance group manager.
+ policy.
: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.
@@ -56083,7 +64648,8 @@ class InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype(Instan
:attr bool management_enabled: (optional) Indicates whether this manager will
control the instance group.
:attr str name: (optional) The user-defined name for this instance group
- manager. Names must be unique within the instance group.
+ manager. Names must be unique within 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
@@ -56113,7 +64679,8 @@ def __init__(self,
:param bool management_enabled: (optional) Indicates whether this manager
will control the instance group.
:param str name: (optional) The user-defined name for this instance group
- manager. Names must be unique within the instance group.
+ manager. Names must be unique within 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
@@ -56210,7 +64777,8 @@ class InstanceGroupManagerPrototypeInstanceGroupManagerScheduledPrototype(Instan
:attr bool management_enabled: (optional) Indicates whether this manager will
control the instance group.
:attr str name: (optional) The user-defined name for this instance group
- manager. Names must be unique within the instance group.
+ manager. Names must be unique within 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.
"""
@@ -56226,7 +64794,8 @@ def __init__(self,
:param bool management_enabled: (optional) Indicates whether this manager
will control the instance group.
:param str name: (optional) The user-defined name for this instance group
- manager. Names must be unique within the instance group.
+ manager. Names must be unique within the instance group. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
"""
# pylint: disable=super-init-not-called
self.management_enabled = management_enabled
@@ -56298,8 +64867,7 @@ class InstanceGroupManagerScheduled(InstanceGroupManager):
:attr str id: The unique identifier for this instance group manager.
:attr bool management_enabled: Indicates whether this manager will control the
instance group.
- :attr str name: The user-defined name for this instance group manager. Names
- must be unique within the instance group.
+ :attr str name: The user-defined name for this instance group manager.
:attr datetime updated_at: The date and time that the instance group manager was
updated.
:attr List[InstanceGroupManagerActionReference] actions: The actions of the
@@ -56326,7 +64894,6 @@ def __init__(self,
:param bool management_enabled: Indicates whether this manager will control
the instance group.
:param str name: The user-defined name for this instance group manager.
- Names must be unique within 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
@@ -56441,8 +65008,7 @@ class InstanceGroupManagerScheduledActionManagerAutoScale(InstanceGroupManagerSc
some supplementary information.
:attr str href: The URL for this instance group manager.
:attr str id: The unique identifier for this instance group manager.
- :attr str name: The user-defined name for this instance group manager. Names
- must be unique within the instance group.
+ :attr str name: The user-defined name for this instance group manager.
:attr int max_membership_count: (optional) The maximum number of members the
instance group should have at the scheduled time.
:attr int min_membership_count: (optional) The minimum number of members the
@@ -56463,7 +65029,6 @@ def __init__(self,
:param str href: The URL for this instance group manager.
:param str id: The unique identifier for this instance group manager.
:param str name: The user-defined name for this instance group manager.
- Names must be unique within the instance group.
:param InstanceGroupManagerReferenceDeleted deleted: (optional) If present,
this property indicates the referenced resource has been deleted and
provides
@@ -56691,6 +65256,38 @@ def __ne__(self, other: 'InstancePatchProfileInstanceProfileIdentityByName') ->
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+class InstancePlacementTargetPatchDedicatedHostGroupIdentity(InstancePlacementTargetPatch):
+ """
+ Identifies a dedicated host group by a unique property.
+
+ """
+
+ def __init__(self) -> 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.
@@ -67150,9 +75747,9 @@ def __ne__(self, other: 'PublicGatewayFloatingIPPrototypeFloatingIPPrototypeTarg
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PublicGatewayIdentityByCRN(PublicGatewayIdentity):
+class PublicGatewayIdentityPublicGatewayIdentityByCRN(PublicGatewayIdentity):
"""
- PublicGatewayIdentityByCRN.
+ PublicGatewayIdentityPublicGatewayIdentityByCRN.
:attr str crn: The CRN for this public gateway.
"""
@@ -67160,7 +75757,7 @@ class PublicGatewayIdentityByCRN(PublicGatewayIdentity):
def __init__(self,
crn: str) -> None:
"""
- Initialize a PublicGatewayIdentityByCRN object.
+ Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object.
:param str crn: The CRN for this public gateway.
"""
@@ -67168,18 +75765,18 @@ def __init__(self,
self.crn = crn
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityByCRN':
- """Initialize a PublicGatewayIdentityByCRN object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityByCRN':
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary."""
args = {}
if 'crn' in _dict:
args['crn'] = _dict.get('crn')
else:
- raise ValueError('Required property \'crn\' not present in PublicGatewayIdentityByCRN JSON')
+ raise ValueError('Required property \'crn\' not present in PublicGatewayIdentityPublicGatewayIdentityByCRN JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayIdentityByCRN object from a json dictionary."""
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityByCRN object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -67194,22 +75791,22 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayIdentityByCRN object."""
+ """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityByCRN object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayIdentityByCRN') -> 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: 'PublicGatewayIdentityByCRN') -> bool:
+ def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByCRN') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PublicGatewayIdentityByHref(PublicGatewayIdentity):
+class PublicGatewayIdentityPublicGatewayIdentityByHref(PublicGatewayIdentity):
"""
- PublicGatewayIdentityByHref.
+ PublicGatewayIdentityPublicGatewayIdentityByHref.
:attr str href: The URL for this public gateway.
"""
@@ -67217,7 +75814,7 @@ class PublicGatewayIdentityByHref(PublicGatewayIdentity):
def __init__(self,
href: str) -> None:
"""
- Initialize a PublicGatewayIdentityByHref object.
+ Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object.
:param str href: The URL for this public gateway.
"""
@@ -67225,18 +75822,18 @@ def __init__(self,
self.href = href
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityByHref':
- """Initialize a PublicGatewayIdentityByHref object from a json dictionary."""
+ 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 PublicGatewayIdentityByHref JSON')
+ raise ValueError('Required property \'href\' not present in PublicGatewayIdentityPublicGatewayIdentityByHref JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayIdentityByHref object from a json dictionary."""
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityByHref object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -67251,22 +75848,22 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayIdentityByHref object."""
+ """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityByHref object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayIdentityByHref') -> bool:
+ 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: 'PublicGatewayIdentityByHref') -> bool:
+ def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityByHref') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
-class PublicGatewayIdentityById(PublicGatewayIdentity):
+class PublicGatewayIdentityPublicGatewayIdentityById(PublicGatewayIdentity):
"""
- PublicGatewayIdentityById.
+ PublicGatewayIdentityPublicGatewayIdentityById.
:attr str id: The unique identifier for this public gateway.
"""
@@ -67274,7 +75871,7 @@ class PublicGatewayIdentityById(PublicGatewayIdentity):
def __init__(self,
id: str) -> None:
"""
- Initialize a PublicGatewayIdentityById object.
+ Initialize a PublicGatewayIdentityPublicGatewayIdentityById object.
:param str id: The unique identifier for this public gateway.
"""
@@ -67282,18 +75879,18 @@ def __init__(self,
self.id = id
@classmethod
- def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityById':
- """Initialize a PublicGatewayIdentityById object from a json dictionary."""
+ def from_dict(cls, _dict: Dict) -> 'PublicGatewayIdentityPublicGatewayIdentityById':
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityById object from a json dictionary."""
args = {}
if 'id' in _dict:
args['id'] = _dict.get('id')
else:
- raise ValueError('Required property \'id\' not present in PublicGatewayIdentityById JSON')
+ raise ValueError('Required property \'id\' not present in PublicGatewayIdentityPublicGatewayIdentityById JSON')
return cls(**args)
@classmethod
def _from_dict(cls, _dict):
- """Initialize a PublicGatewayIdentityById object from a json dictionary."""
+ """Initialize a PublicGatewayIdentityPublicGatewayIdentityById object from a json dictionary."""
return cls.from_dict(_dict)
def to_dict(self) -> Dict:
@@ -67308,16 +75905,16 @@ def _to_dict(self):
return self.to_dict()
def __str__(self) -> str:
- """Return a `str` version of this PublicGatewayIdentityById object."""
+ """Return a `str` version of this PublicGatewayIdentityPublicGatewayIdentityById object."""
return json.dumps(self.to_dict(), indent=2)
- def __eq__(self, other: 'PublicGatewayIdentityById') -> 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: 'PublicGatewayIdentityById') -> bool:
+ def __ne__(self, other: 'PublicGatewayIdentityPublicGatewayIdentityById') -> bool:
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
@@ -69502,6 +78099,123 @@ class ProtocolEnum(str, Enum):
UDP = 'udp'
+class SecurityGroupTargetReferenceEndpointGatewayReference(SecurityGroupTargetReference):
+ """
+ SecurityGroupTargetReferenceEndpointGatewayReference.
+
+ :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 unique user-defined name for this endpoint gateway.
+ :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 SecurityGroupTargetReferenceEndpointGatewayReference 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 unique user-defined name for this endpoint gateway.
+ :param str resource_type: The resource type.
+ :param EndpointGatewayReferenceDeleted deleted: (optional) If present, this
+ property indicates the referenced resource has been deleted and provides
+ 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) -> '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 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 SecurityGroupTargetReferenceEndpointGatewayReference object from a json dictionary."""
+ return cls.from_dict(_dict)
+
+ def to_dict(self) -> Dict:
+ """Return a json dictionary representing this model."""
+ _dict = {}
+ if hasattr(self, 'crn') and self.crn is not None:
+ _dict['crn'] = self.crn
+ if hasattr(self, 'deleted') and self.deleted is not None:
+ _dict['deleted'] = self.deleted.to_dict()
+ if hasattr(self, 'href') and self.href is not None:
+ _dict['href'] = self.href
+ if hasattr(self, 'id') and self.id is not None:
+ _dict['id'] = self.id
+ if hasattr(self, 'name') and self.name is not None:
+ _dict['name'] = self.name
+ if hasattr(self, 'resource_type') and self.resource_type is not None:
+ _dict['resource_type'] = self.resource_type
+ return _dict
+
+ def _to_dict(self):
+ """Return a json dictionary representing this model."""
+ return self.to_dict()
+
+ def __str__(self) -> str:
+ """Return a `str` version of this SecurityGroupTargetReferenceEndpointGatewayReference object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ 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: '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 SecurityGroupTargetReferenceLoadBalancerReference(SecurityGroupTargetReference):
"""
SecurityGroupTargetReferenceLoadBalancerReference.
@@ -70063,8 +78777,9 @@ class SubnetPrototypeSubnetByCIDR(SubnetPrototype):
hyphenated list of randomly-selected words.
:attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this
subnet. If unspecified, the default network ACL for the VPC is used.
- :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to
- handle internet bound traffic 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)
:attr RoutingTableIdentity routing_table: (optional) The routing table to use
for this subnet. If unspecified, the default routing table for the VPC is used.
@@ -70112,7 +78827,8 @@ def __init__(self,
for this subnet. If unspecified, the default network ACL for the VPC is
used.
:param PublicGatewayIdentity public_gateway: (optional) The public gateway
- to handle internet bound traffic for this subnet.
+ 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)
:param RoutingTableIdentity routing_table: (optional) The routing table to
use for this subnet. If unspecified, the default routing table for the VPC
@@ -70241,8 +78957,9 @@ class SubnetPrototypeSubnetByTotalCount(SubnetPrototype):
hyphenated list of randomly-selected words.
:attr NetworkACLIdentity network_acl: (optional) The network ACL to use for this
subnet. If unspecified, the default network ACL for the VPC is used.
- :attr PublicGatewayIdentity public_gateway: (optional) The public gateway to
- handle internet bound traffic 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)
:attr RoutingTableIdentity routing_table: (optional) The routing table to use
for this subnet. If unspecified, the default routing table for the VPC is used.
@@ -70285,7 +79002,8 @@ def __init__(self,
for this subnet. If unspecified, the default network ACL for the VPC is
used.
:param PublicGatewayIdentity public_gateway: (optional) The public gateway
- to handle internet bound traffic for this subnet.
+ 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)
:param RoutingTableIdentity routing_table: (optional) The routing table to
use for this subnet. If unspecified, the default routing table for the VPC
@@ -70405,6 +79123,177 @@ class IpVersionEnum(str, Enum):
IPV4 = 'ipv4'
+class SubnetPublicGatewayPatchPublicGatewayIdentityByCRN(SubnetPublicGatewayPatch):
+ """
+ SubnetPublicGatewayPatchPublicGatewayIdentityByCRN.
+
+ :attr str crn: The CRN for this public gateway.
+ """
+
+ def __init__(self,
+ crn: str) -> None:
+ """
+ Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object.
+
+ :param str crn: The CRN for this public gateway.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN':
+ """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object from a json dictionary."""
+ args = {}
+ if 'crn' in _dict:
+ args['crn'] = _dict.get('crn')
+ else:
+ raise ValueError('Required property \'crn\' not present in SubnetPublicGatewayPatchPublicGatewayIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object from 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 SubnetPublicGatewayPatchPublicGatewayIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class SubnetPublicGatewayPatchPublicGatewayIdentityByHref(SubnetPublicGatewayPatch):
+ """
+ SubnetPublicGatewayPatchPublicGatewayIdentityByHref.
+
+ :attr str href: The URL for this public gateway.
+ """
+
+ def __init__(self,
+ href: str) -> None:
+ """
+ Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByHref object.
+
+ :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) -> 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref':
+ """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByHref object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in SubnetPublicGatewayPatchPublicGatewayIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityByHref object from 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 SubnetPublicGatewayPatchPublicGatewayIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class SubnetPublicGatewayPatchPublicGatewayIdentityById(SubnetPublicGatewayPatch):
+ """
+ SubnetPublicGatewayPatchPublicGatewayIdentityById.
+
+ :attr str id: The unique identifier for this public gateway.
+ """
+
+ def __init__(self,
+ id: str) -> None:
+ """
+ Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityById object.
+
+ :param str id: The unique identifier for this public gateway.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'SubnetPublicGatewayPatchPublicGatewayIdentityById':
+ """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityById object from a json dictionary."""
+ args = {}
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
+ else:
+ raise ValueError('Required property \'id\' not present in SubnetPublicGatewayPatchPublicGatewayIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a SubnetPublicGatewayPatchPublicGatewayIdentityById object from 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 SubnetPublicGatewayPatchPublicGatewayIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'SubnetPublicGatewayPatchPublicGatewayIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
class VPCIdentityByCRN(VPCIdentity):
"""
VPCIdentityByCRN.
@@ -74175,7 +83064,8 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec(Inst
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec.
:attr str name: (optional) The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
:attr str 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.
"""
@@ -74188,7 +83078,8 @@ def __init__(self,
Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpec object.
:param str name: (optional) The user-defined name for this instance group
- manager action. Names must be unique within the instance group manager.
+ manager action. Names must be unique within the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
:param str 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.
@@ -74203,7 +83094,8 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt(Instanc
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt.
:attr str name: (optional) The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
:attr datetime run_at: (optional) The date and time the scheduled action will
run.
"""
@@ -74216,7 +83108,8 @@ def __init__(self,
Initialize a InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAt object.
:param str name: (optional) The user-defined name for this instance group
- manager action. Names must be unique within the instance group manager.
+ manager action. Names must be unique within the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
:param datetime run_at: (optional) The date and time the scheduled action
will run.
"""
@@ -74242,7 +83135,6 @@ class InstanceGroupManagerActionScheduledActionGroupTarget(InstanceGroupManagerA
:attr str href: The URL for this instance group manager action.
:attr str id: The unique identifier for this instance group manager action.
:attr str name: The user-defined name for this instance group manager action.
- Names must be unique within 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
@@ -74295,7 +83187,7 @@ def __init__(self,
:param str id: The unique identifier for this instance group manager
action.
:param str name: The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action.
:param str resource_type: The resource type.
:param str status: The status of the instance group action
- `active`: Action is ready to be run
@@ -74493,7 +83385,6 @@ class InstanceGroupManagerActionScheduledActionManagerTarget(InstanceGroupManage
:attr str href: The URL for this instance group manager action.
:attr str id: The unique identifier for this instance group manager action.
:attr str name: The user-defined name for this instance group manager action.
- Names must be unique within 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
@@ -74546,7 +83437,7 @@ def __init__(self,
:param str id: The unique identifier for this instance group manager
action.
:param str name: The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action.
:param str resource_type: The resource type.
:param str status: The status of the instance group action
- `active`: Action is ready to be run
@@ -74886,6 +83777,348 @@ def __ne__(self, other: 'InstanceGroupManagerScheduledActionManagerPrototypeAuto
"""Return `true` when self and other are not equal, false otherwise."""
return not self == other
+class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(InstancePlacementTargetPatchDedicatedHostGroupIdentity):
+ """
+ InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.
+
+ :attr str crn: The CRN for this dedicated host group.
+ """
+
+ def __init__(self,
+ crn: str) -> None:
+ """
+ Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object.
+
+ :param str crn: The CRN for this dedicated host group.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from a json dictionary."""
+ args = {}
+ if 'crn' in _dict:
+ args['crn'] = _dict.get('crn')
+ else:
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object from 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 InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(InstancePlacementTargetPatchDedicatedHostGroupIdentity):
+ """
+ InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.
+
+ :attr str href: The URL for this dedicated host group.
+ """
+
+ def __init__(self,
+ href: str) -> None:
+ """
+ Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object.
+
+ :param str href: The URL for this dedicated host group.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object from 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 InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(InstancePlacementTargetPatchDedicatedHostGroupIdentity):
+ """
+ InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.
+
+ :attr str id: The unique identifier for this dedicated host group.
+ """
+
+ def __init__(self,
+ id: str) -> None:
+ """
+ Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object.
+
+ :param str id: The unique identifier for this dedicated host group.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from a json dictionary."""
+ args = {}
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
+ else:
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object from 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 InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(InstancePlacementTargetPatchDedicatedHostIdentity):
+ """
+ InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN.
+
+ :attr str crn: The CRN for this dedicated host.
+ """
+
+ def __init__(self,
+ crn: str) -> None:
+ """
+ Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object.
+
+ :param str crn: The CRN for this dedicated host.
+ """
+ # pylint: disable=super-init-not-called
+ self.crn = crn
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object from a json dictionary."""
+ args = {}
+ if 'crn' in _dict:
+ args['crn'] = _dict.get('crn')
+ else:
+ raise ValueError('Required property \'crn\' not present in InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object from 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 InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(InstancePlacementTargetPatchDedicatedHostIdentity):
+ """
+ InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.
+
+ :attr str href: The URL for this dedicated host.
+ """
+
+ def __init__(self,
+ href: str) -> None:
+ """
+ Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object.
+
+ :param str href: The URL for this dedicated host.
+ """
+ # pylint: disable=super-init-not-called
+ self.href = href
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object from a json dictionary."""
+ args = {}
+ if 'href' in _dict:
+ args['href'] = _dict.get('href')
+ else:
+ raise ValueError('Required property \'href\' not present in InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object from 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 InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
+class InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById(InstancePlacementTargetPatchDedicatedHostIdentity):
+ """
+ InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.
+
+ :attr str id: The unique identifier for this dedicated host.
+ """
+
+ def __init__(self,
+ id: str) -> None:
+ """
+ Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object.
+
+ :param str id: The unique identifier for this dedicated host.
+ """
+ # pylint: disable=super-init-not-called
+ self.id = id
+
+ @classmethod
+ def from_dict(cls, _dict: Dict) -> 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById':
+ """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object from a json dictionary."""
+ args = {}
+ if 'id' in _dict:
+ args['id'] = _dict.get('id')
+ else:
+ raise ValueError('Required property \'id\' not present in InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById JSON')
+ return cls(**args)
+
+ @classmethod
+ def _from_dict(cls, _dict):
+ """Initialize a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object from 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 InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById object."""
+ return json.dumps(self.to_dict(), indent=2)
+
+ def __eq__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById') -> bool:
+ """Return `true` when self and other are equal, false otherwise."""
+ if not isinstance(other, self.__class__):
+ return False
+ return self.__dict__ == other.__dict__
+
+ def __ne__(self, other: 'InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById') -> bool:
+ """Return `true` when self and other are not equal, false otherwise."""
+ return not self == other
+
class InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(InstancePlacementTargetPrototypeDedicatedHostGroupIdentity):
"""
InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.
@@ -77472,7 +86705,8 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGro
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByGroup.
:attr str name: (optional) The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
:attr str cron_spec: (optional) The cron specification for a recurring scheduled
action. Actions can be applied a maximum of one time within a 5 min period.
:attr InstanceGroupManagerScheduledActionGroupPrototype group:
@@ -77488,7 +86722,8 @@ def __init__(self,
:param InstanceGroupManagerScheduledActionGroupPrototype group:
:param str name: (optional) The user-defined name for this instance group
- manager action. Names must be unique within the instance group manager.
+ manager action. Names must be unique within the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
:param str 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.
@@ -77551,7 +86786,8 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByMan
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByCronSpecByManager.
:attr str name: (optional) The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
:attr str cron_spec: (optional) The cron specification for a recurring scheduled
action. Actions can be applied a maximum of one time within a 5 min period.
:attr InstanceGroupManagerScheduledActionManagerPrototype manager:
@@ -77567,7 +86803,8 @@ def __init__(self,
:param InstanceGroupManagerScheduledActionManagerPrototype manager:
:param str name: (optional) The user-defined name for this instance group
- manager action. Names must be unique within the instance group manager.
+ manager action. Names must be unique within the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
:param str 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.
@@ -77633,7 +86870,8 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup(
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByGroup.
:attr str name: (optional) The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
:attr datetime run_at: (optional) The date and time the scheduled action will
run.
:attr InstanceGroupManagerScheduledActionGroupPrototype group:
@@ -77649,7 +86887,8 @@ def __init__(self,
:param InstanceGroupManagerScheduledActionGroupPrototype group:
:param str name: (optional) The user-defined name for this instance group
- manager action. Names must be unique within the instance group manager.
+ manager action. Names must be unique within the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
:param datetime run_at: (optional) The date and time the scheduled action
will run.
"""
@@ -77711,7 +86950,8 @@ class InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManage
InstanceGroupManagerActionPrototypeScheduledActionPrototypeByRunAtByManager.
:attr str name: (optional) The user-defined name for this instance group manager
- action. Names must be unique within the instance group manager.
+ action. Names must be unique within the instance group manager. If unspecified,
+ the name will be a hyphenated list of randomly-selected words.
:attr datetime run_at: (optional) The date and time the scheduled action will
run.
:attr InstanceGroupManagerScheduledActionManagerPrototype manager:
@@ -77727,7 +86967,8 @@ def __init__(self,
:param InstanceGroupManagerScheduledActionManagerPrototype manager:
:param str name: (optional) The user-defined name for this instance group
- manager action. Names must be unique within the instance group manager.
+ manager action. Names must be unique within the instance group manager. If
+ unspecified, the name will be a hyphenated list of randomly-selected words.
:param datetime run_at: (optional) The date and time the scheduled action
will run.
"""
diff --git a/requirements-dev.txt b/requirements-dev.txt
index c7ac2bd..c764632 100644
--- a/requirements-dev.txt
+++ b/requirements-dev.txt
@@ -1,7 +1,7 @@
# test dependencies
coverage>=4.5.4
pylint>=2.6.0,<3.0.0
-pytest>=6.2.1,<7.0.0
+pytest>=6.2.1,<=7.0.0
pytest-cov>=2.2.1,<3.0.0
pytest-rerunfailures>=3.1
responses>=0.12.1,<1.0.0
diff --git a/requirements.txt b/requirements.txt
index 3c15389..be10031 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1,2 +1,2 @@
python_dateutil>=2.5.3,<3.0.0
-ibm_cloud_sdk_core>=3.13.2
+ibm_cloud_sdk_core>=3.14.0
diff --git a/setup.py b/setup.py
index a85e6e2..be9ebce 100644
--- a/setup.py
+++ b/setup.py
@@ -78,7 +78,6 @@ def finalize_options(self):
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 3',
- 'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
diff --git a/test/integration/test_gen2.py b/test/integration/test_gen2.py
index 7cd4fa1..878dcc0 100644
--- a/test/integration/test_gen2.py
+++ b/test/integration/test_gen2.py
@@ -420,6 +420,158 @@ def test_delete_subnet_pgw(self, createGen2Service):
assertDeleteResponse(vpc)
+class TestBareMetalServers():
+
+ def test_list_bare_metal_server_profiles(self, createGen2Service):
+ profiles = list_bare_metal_server_profiles(createGen2Service)
+ assertListResponse(profiles, 'profiles')
+ store['bare_metal_server_profile'] = profiles.get_result()[
+ 'profiles'][0]['name']
+
+ def test_get_bare_metal_server_profile(self, createGen2Service):
+ prof = get_bare_metal_server_profile(
+ createGen2Service, store['bare_metal_server_profile'])
+ assert prof.status_code == 200
+ assert prof.get_result() is not None
+
+ def test_create_bare_metal_server(self, createGen2Service):
+ bms = create_bare_metal_server(createGen2Service, store['bare_metal_server_profile'], store['created_subnet'],
+ store['image_id'], store['created_key'], store['created_vpc'],
+ store['zone'], 'testString', 'my-bare-metal-server')
+ assertCreateResponse(bms)
+ store['created_bare_metal_server_id'] = bms.get_result()['id']
+ print('created_bare_metal_server_id -' + store['created_bare_metal_server_id'])
+
+ def test_list_bare_metal_servers(self, createGen2Service):
+ bare_metal_servers = list_bare_metal_servers(createGen2Service)
+ assertListResponse(bare_metal_servers, 'bare_metal_servers')
+ bare_metal_server = bare_metal_servers.get_result()['bare_metal_servers'][0]
+ store['bare_metal_server_id'] = bare_metal_server['id']
+ store['network_interface_id'] = bare_metal_server['primary_network_interface']['id']
+ print("primary network interface is - " + store['network_interface_id'])
+
+ def test_get_bare_metal_server(self, createGen2Service):
+ bare_metal_server = get_bare_metal_server(
+ createGen2Service, store['created_bare_metal_server_id'])
+ assertGetPatchResponse(bare_metal_server)
+
+ def test_update_bare_metal_server(self, createGen2Service):
+ bare_metal_server = update_bare_metal_server(
+ createGen2Service, store['created_bare_metal_server_id'], 'my-bare-metal-server-update', True)
+ assertGetPatchResponse(bare_metal_server)
+
+ def test_get_bare_metal_server_initialization(self, createGen2Service):
+ bare_metal_server = get_bare_metal_server_initialization(
+ createGen2Service, store['created_bare_metal_server_id'])
+ assert bare_metal_server.status_code == 200
+ assert bare_metal_server.get_result() is not None
+
+ def test_create_bare_metal_server_console_access_token(self, createGen2Service):
+ pytest.skip("no env")
+ bare_metal_server_access_token = create_bare_metal_server_console_access_token(
+ createGen2Service, store['created_bare_metal_server_id'],
+ 'serial'
+ )
+ assert bare_metal_server_access_token.status_code == 200
+ assert bare_metal_server_access_token.get_result() is not None
+
+ def test_list_bare_metal_server_disks(self, createGen2Service):
+ bare_metal_server_disks = list_bare_metal_server_disks(
+ createGen2Service, store['created_bare_metal_server_id'])
+ bare_metal_server_disk = bare_metal_server_disks.get_result()['disks'][0]
+ store['bare_metal_server_disk_id'] = bare_metal_server_disk['id']
+ assert bare_metal_server_disks.status_code == 200
+ assert bare_metal_server_disks.get_result() is not None
+
+ def test_get_bare_metal_server_disk(self, createGen2Service):
+ bare_metal_server_disk = get_bare_metal_server_disk(
+ createGen2Service, store['created_bare_metal_server_id'], store['bare_metal_server_disk_id'])
+ assert bare_metal_server_disk.status_code == 200
+ assert bare_metal_server_disk.get_result() is not None
+
+ def test_update_bare_metal_server_disk(self, createGen2Service):
+ bare_metal_server_disk = update_bare_metal_server_disk(
+ createGen2Service, store['created_bare_metal_server_id'], store['bare_metal_server_disk_id'],
+ 'my-bare-metal-server-disk-update'
+ )
+ assert bare_metal_server_disk.status_code == 200
+ assert bare_metal_server_disk.get_result() is not None
+
+ # create nic
+ def test_create_bare_metal_server_network_interface(self, createGen2Service):
+ nic = create_bare_metal_server_network_interface(
+ createGen2Service, store['created_bare_metal_server_id'],
+ [4, 4049], store['created_subnet'], 'pci', 'my-bms-nic', False, True)
+ assertCreateResponse(nic)
+ store['bare_metal_server_created_nic'] = nic.get_result()['id']
+
+ def test_list_bare_metal_server_network_interfaces(self, createGen2Service):
+ bare_metal_server_nics = list_bare_metal_server_network_interfaces(
+ createGen2Service, store['created_bare_metal_server_id'])
+ assertListResponse(bare_metal_server_nics, 'network_interfaces')
+ store['bms_nic_id'] = bare_metal_server_nics.get_result()[
+ 'network_interfaces'][0]['id']
+
+ def test_get_bare_metal_server_network_interface(self, createGen2Service):
+ bare_metal_server_nic = get_bare_metal_server_network_interface(
+ createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id'])
+ assertGetPatchResponse(bare_metal_server_nic)
+
+ # update nic
+ def test_update_bare_metal_server_network_interface(self, createGen2Service):
+ nic = update_bare_metal_server_network_interface(
+ createGen2Service, store['created_bare_metal_server_id'], store['bare_metal_server_created_nic'],
+ 'my-bare-metal-server-network-interface-update', True, False)
+ assertGetPatchResponse(nic)
+
+ def test_create_bare_metal_server_nic_fip(self, createGen2Service):
+ fip = add_bare_metal_server_network_interface_floating_ip(
+ createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id'], store['created_fip_id'])
+ assertCreateResponse(fip)
+ store['created_bms_nic_fip'] = fip.get_result()['id']
+
+ def test_get_bare_metal_server_nic_fips(self, createGen2Service):
+ fips = list_bare_metal_server_network_interface_floating_ips(
+ createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id'])
+ assertListResponse(fips, 'floating_ips')
+
+ def test_get_bare_metal_server_nic_fip(self, createGen2Service):
+ fips = get_bare_metal_server_network_interface_floating_ip(
+ createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id'], store['created_fip_id'])
+ assertGetPatchResponse(fips)
+
+ def test_delete_bare_metal_server_nic_fip(self, createGen2Service):
+ fips = remove_bare_metal_server_network_interface_floating_ip(
+ createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id'], store['created_fip_id'])
+ assertDeleteResponse(fips)
+
+ def test_delete_bare_metal_server_network_interface(self, createGen2Service):
+ nics = delete_bare_metal_server_network_interface(
+ createGen2Service, store['created_bare_metal_server_id'], store['bms_nic_id'])
+ assertDeleteResponse(nics)
+
+ def test_create_bare_metal_server_restart(self, createGen2Service):
+ bare_metal_server_restart = create_bare_metal_server_restart(
+ createGen2Service, store['created_bare_metal_server_id'])
+ assert bare_metal_server_restart.status_code == 204
+
+ def test_create_bare_metal_server_stop(self, createGen2Service):
+ bare_metal_server_stop = create_bare_metal_server_stop(
+ createGen2Service, store['created_bare_metal_server_id'], 'hard')
+ assert bare_metal_server_stop.status_code == 204
+
+ def test_create_bare_metal_server_start(self, createGen2Service):
+ bare_metal_server_start = create_bare_metal_server_start(
+ createGen2Service, store['created_bare_metal_server_id'])
+ assert bare_metal_server_start.status_code == 204
+
+ def test_delete_bare_metal_server(self, createGen2Service):
+ bare_metal_server_stop = create_bare_metal_server_stop(
+ createGen2Service, store['created_bare_metal_server_id'], 'hard')
+ assert bare_metal_server_stop.status_code == 204
+ bms = delete_bare_metal_server(createGen2Service, store['created_bare_metal_server_id'])
+ assertDeleteResponse(bms)
+
class TestInstances():
def test_list_instances(self, createGen2Service):
instances = list_instances(createGen2Service)
@@ -1027,30 +1179,6 @@ def test_delete_load_balancer(self, createGen2Service):
createGen2Service, store['created_load_balancer'])
assertDeleteResponse(load_balancer)
-class TestPlacementGroup():
- def test_create_placement_group(self, createGen2Service):
- name = 'my-placement-group'
- pg = create_placement_group(createGen2Service, name)
- assertCreateResponse(pg)
- store['created_placement_group'] = pg.get_result()['id']
-
- def test_list_placement_groups(self, createGen2Service):
- pgc = list_placement_groups(createGen2Service)
- assertListResponse(pgc, 'placement_groups')
-
- def test_get_placement_group(self, createGen2Service):
- pg = get_placement_group(createGen2Service, store['created_placement_group'])
- assert pg.status_code == 200
- assert pg.get_result() is not None
-
- def test_update_placement_group(self, createGen2Service):
- pg = update_placement_group(
- createGen2Service, store['created_placement_group'], 'my-placement-group1')
- assertGetPatchResponse(pg)
-
- def test_delete_placement_group(self, createGen2Service):
- pg = delete_placement_group(createGen2Service, store['created_placement_group'])
- assertDeleteResponse(pg)
class TestVPCFlowLogs():
def test_create_flow_log_collector(self, createGen2Service):
@@ -1241,6 +1369,30 @@ def test_delete_dedicated_host(self, createGen2Service):
createGen2Service, store['created_dh'])
assertDeleteResponse(igm)
+class TestPlacementGroup():
+ def test_create_placement_group(self, createGen2Service):
+ name = 'my-placement-group'
+ pg = create_placement_group(createGen2Service, name)
+ assertCreateResponse(pg)
+ store['created_placement_group'] = pg.get_result()['id']
+
+ def test_list_placement_groups(self, createGen2Service):
+ pgc = list_placement_groups(createGen2Service)
+ assertListResponse(pgc, 'placement_groups')
+
+ def test_get_placement_group(self, createGen2Service):
+ pg = get_placement_group(createGen2Service, store['created_placement_group'])
+ assert pg.status_code == 200
+ assert pg.get_result() is not None
+
+ def test_update_placement_group(self, createGen2Service):
+ pg = update_placement_group(
+ createGen2Service, store['created_placement_group'], 'my-placement-group1')
+ assertGetPatchResponse(pg)
+
+ def test_delete_placement_group(self, createGen2Service):
+ pg = delete_placement_group(createGen2Service, store['created_placement_group'])
+ assertDeleteResponse(pg)
class TestTeardown():
def test_delete_instance_group_manager_policy(self, createGen2Service):
@@ -1330,22 +1482,22 @@ def list_floating_ips(service):
def create_floating_ip(service):
- # ResourceGroupIdentityById model
+ # Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # ZoneIdentityByName model
+ # Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = store['zone']
- # FloatingIPPrototypeFloatingIPByZone model
+ # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model
floating_ip_prototype_model = {}
floating_ip_prototype_model['name'] = generate_name("fip")
floating_ip_prototype_model[
'resource_group'] = resource_group_identity_model
floating_ip_prototype_model['zone'] = zone_identity_model
-
+ # Set up parameter values
floating_ip_prototype = floating_ip_prototype_model
response = service.create_floating_ip(floating_ip_prototype)
@@ -1418,6 +1570,237 @@ def get_region_zone(service, region_name, zone_name):
response = service.get_region_zone(region_name, zone_name)
return response
+
+# --------------------------------------------------------
+# Bare Metal Servers
+# --------------------------------------------------------
+
+def list_bare_metal_server_profiles(service):
+ list_bare_metal_server_profiles_response = service.list_bare_metal_server_profiles()
+ return list_bare_metal_server_profiles_response
+
+
+def get_bare_metal_server_profile(service, profile_name):
+ get_bare_metal_server_profile_response = service.get_bare_metal_server_profile(profile_name)
+ return get_bare_metal_server_profile_response
+
+
+def list_bare_metal_servers(service):
+ list_bare_metal_servers_response = service.list_bare_metal_servers()
+ return list_bare_metal_servers_response
+
+
+def create_bare_metal_server(service, profile_name, subnet_id, image_id, key_id, vpc_id, zone_name, user_data,
+ bare_metal_server_name):
+ bare_metal_server_profile_identity_model = {}
+ bare_metal_server_profile_identity_model['name'] = profile_name
+
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = subnet_id
+
+ bare_metal_server_primary_network_interface_model = {}
+ bare_metal_server_primary_network_interface_model['subnet'] = subnet_identity_model
+
+ image_identity_model = {}
+ image_identity_model['id'] = image_id
+
+ key_identity_model = {}
+ key_identity_model['id'] = key_id
+
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = vpc_id
+
+ zone_identity_model = {}
+ zone_identity_model['name'] = zone_name
+
+ bare_metal_server_initialization_model = {}
+ bare_metal_server_initialization_model['image'] = image_identity_model
+ bare_metal_server_initialization_model['keys'] = [key_identity_model]
+ bare_metal_server_initialization_model['user_data'] = user_data
+
+ create_bare_metal_server_response = service.create_bare_metal_server(
+ initialization=bare_metal_server_initialization_model,
+ primary_network_interface=bare_metal_server_primary_network_interface_model,
+ profile=bare_metal_server_profile_identity_model,
+ zone=zone_identity_model,
+ name=bare_metal_server_name,
+ vpc=vpc_identity_model,
+ #enable_secure_boot=True
+ )
+ return create_bare_metal_server_response
+
+
+def get_bare_metal_server_console(service, bare_metal_server_id):
+ get_bare_metal_server_console_response = service.get_bare_metal_server_console(bare_metal_server_id)
+ return get_bare_metal_server_console_response
+
+
+def create_bare_metal_server_console_access_token(service, bare_metal_server_id, console_type):
+ create_bare_metal_server_console_access_token_response = service.create_bare_metal_server_console_access_token(
+ bare_metal_server_id,
+ console_type=console_type,
+ force=True
+ )
+ return create_bare_metal_server_console_access_token_response
+
+
+def list_bare_metal_server_disks(service, bare_metal_server_id):
+ list_bare_metal_server_disks_response = service.list_bare_metal_server_disks(bare_metal_server_id)
+ return list_bare_metal_server_disks_response
+
+
+def get_bare_metal_server_disk(service, bare_metal_server_id, id):
+ get_bare_metal_server_disk_response = service.get_bare_metal_server_disk(bare_metal_server_id, id)
+ return get_bare_metal_server_disk_response
+
+
+def update_bare_metal_server_disk(service, bare_metal_server_id, id, disk_name):
+ bare_metal_server_disk_patch_model = {}
+ bare_metal_server_disk_patch_model['name'] = disk_name
+ update_bare_metal_server_disk_response = service.update_bare_metal_server_disk(
+ bare_metal_server_id,
+ id,
+ bare_metal_server_disk_patch=bare_metal_server_disk_patch_model
+ )
+ return update_bare_metal_server_disk_response
+
+
+def list_bare_metal_server_network_interfaces(service, bare_metal_server_id):
+ list_bare_metal_server_network_interfaces_response = service.list_bare_metal_server_network_interfaces(
+ bare_metal_server_id
+ )
+ return list_bare_metal_server_network_interfaces_response
+
+
+def create_bare_metal_server_network_interface(service, bare_metal_server_id, vlans, subnet_id, inetrface_type,
+ nic_name, allow_ip_spoofing, enable_infrastructure_nat):
+ allowed_vlans = vlans
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = subnet_id
+ bare_metal_server_network_interface_prototype_model = {}
+ bare_metal_server_network_interface_prototype_model['interface_type'] = inetrface_type
+ bare_metal_server_network_interface_prototype_model['name'] = nic_name
+ bare_metal_server_network_interface_prototype_model['allowed_vlans'] = allowed_vlans
+ bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = allow_ip_spoofing
+ bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = enable_infrastructure_nat
+ bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
+
+ create_bare_metal_server_network_interface_response = service.create_bare_metal_server_network_interface(
+ bare_metal_server_id,
+ bare_metal_server_network_interface_prototype=bare_metal_server_network_interface_prototype_model
+ )
+ return create_bare_metal_server_network_interface_response
+
+
+def get_bare_metal_server_network_interface(service, bare_metal_server_id, id):
+ get_bare_metal_server_network_interface_response = service.get_bare_metal_server_network_interface(
+ bare_metal_server_id,
+ id
+ )
+ return get_bare_metal_server_network_interface_response
+
+
+def update_bare_metal_server_network_interface(service, bare_metal_server_id, id, bms_nic_name, allow_ip_spoofing,
+ enable_infrastructure_nat):
+ bare_metal_server_network_interface_patch_model = {}
+ bare_metal_server_network_interface_patch_model['name'] = bms_nic_name
+ bare_metal_server_network_interface_patch_model['allow_ip_spoofing'] = allow_ip_spoofing
+ bare_metal_server_network_interface_patch_model['enable_infrastructure_nat'] = enable_infrastructure_nat
+ update_bare_metal_server_network_interface_response = service.update_bare_metal_server_network_interface(
+ bare_metal_server_id,
+ id,
+ bare_metal_server_network_interface_patch=bare_metal_server_network_interface_patch_model
+ )
+ return update_bare_metal_server_network_interface_response
+
+
+def delete_bare_metal_server_network_interface(service, bare_metal_server_id, id):
+ delete_bare_metal_server_network_interface_response = service.delete_bare_metal_server_network_interface(
+ bare_metal_server_id,
+ id
+ )
+ return delete_bare_metal_server_network_interface_response
+
+
+def list_bare_metal_server_network_interface_floating_ips(service, bare_metal_server_id, network_interface_id, ):
+ list_bare_metal_server_network_interface_floating_ips_response = service.list_bare_metal_server_network_interface_floating_ips(
+ bare_metal_server_id,
+ network_interface_id
+ )
+ return list_bare_metal_server_network_interface_floating_ips_response
+
+
+def get_bare_metal_server_network_interface_floating_ip(service, bare_metal_server_id, network_interface_id, id):
+ get_bare_metal_server_network_interface_floating_ip_response = service.get_bare_metal_server_network_interface_floating_ip(
+ bare_metal_server_id,
+ network_interface_id,
+ id
+ )
+ return get_bare_metal_server_network_interface_floating_ip_response
+
+
+def add_bare_metal_server_network_interface_floating_ip(service, bare_metal_server_id, network_interface_id, id):
+ add_bare_metal_server_network_interface_floating_ip_response = service.add_bare_metal_server_network_interface_floating_ip(
+ bare_metal_server_id,
+ network_interface_id,
+ id
+ )
+ return add_bare_metal_server_network_interface_floating_ip_response
+
+
+def remove_bare_metal_server_network_interface_floating_ip(service, bare_metal_server_id, network_interface_id, id):
+ remove_bare_metal_server_network_interface_floating_ip_response = service.remove_bare_metal_server_network_interface_floating_ip(
+ bare_metal_server_id,
+ network_interface_id,
+ id
+ )
+ return remove_bare_metal_server_network_interface_floating_ip_response
+
+
+def get_bare_metal_server(service, id):
+ get_bare_metal_server_response = service.get_bare_metal_server(id)
+ return get_bare_metal_server_response
+
+
+def update_bare_metal_server(service, id, name, enable_secure_boot):
+ bare_metal_server_patch_model = {}
+ bare_metal_server_patch_model['name'] = name
+ bare_metal_server_patch_model['enable_secure_boot'] = enable_secure_boot
+
+ update_bare_metal_server_response = service.update_bare_metal_server(
+ id,
+ bare_metal_server_patch=bare_metal_server_patch_model
+ )
+ return update_bare_metal_server_response
+
+
+def delete_bare_metal_server(service, id):
+ delete_bare_metal_server_response = service.delete_bare_metal_server(id)
+ return delete_bare_metal_server_response
+
+
+def get_bare_metal_server_initialization(service, id):
+ get_bare_metal_server_initialization_response = service.get_bare_metal_server_initialization(id)
+ return get_bare_metal_server_initialization_response
+
+
+def create_bare_metal_server_restart(service, id):
+ create_bare_metal_server_restart_response = service.restart_bare_metal_server(id)
+ return create_bare_metal_server_restart_response
+
+
+def create_bare_metal_server_start(service, id):
+ create_bare_metal_server_start_response = service.start_bare_metal_server(id)
+ return create_bare_metal_server_start_response
+
+
+def create_bare_metal_server_stop(service, id, stopping_type):
+ create_bare_metal_server_stop_response = service.stop_bare_metal_server(
+ id,
+ stopping_type
+ )
+ return create_bare_metal_server_stop_response
+
# --------------------------------------------------------
# list_images()
# --------------------------------------------------------
@@ -1434,20 +1817,20 @@ def list_images(service):
def create_image(service):
- # ImageFilePrototype model
+ # Construct a dict representation of a ImageFilePrototype model
image_file_prototype_model = {}
image_file_prototype_model[
'href'] = 'cos://us-south/custom-image-vpc-bucket/customImage-0.vhd'
- # OperatingSystemIdentityByName model
+ # Construct a dict representation of a OperatingSystemIdentityByName model
operating_system_identity_model = {}
operating_system_identity_model['name'] = 'ubuntu-16-amd64'
- # ResourceGroupIdentityById model
+ # Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # ImagePrototypeImageByFile model
+ # Construct a dict representation of a ImagePrototypeImageByFile model
image_prototype_model = {}
image_prototype_model['name'] = generate_name('image')
image_prototype_model['resource_group'] = resource_group_identity_model
@@ -1455,7 +1838,7 @@ def create_image(service):
image_prototype_model[
'operating_system'] = operating_system_identity_model
-
+ # Set up parameter values
image_prototype = image_prototype_model
response = service.create_image(image_prototype)
@@ -1545,43 +1928,106 @@ def list_instances(service):
def create_instance(service, vpc, profile, zone, image, subnet):
- # SubnetIdentityById model
+ # Construct a dict representation of a VolumeProfileIdentityByName model
+ # volume_profile_identity_model = {}
+ # volume_profile_identity_model['name'] = 'general-purpose'
+
+ # # Construct a dict representation of a 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'] = subnet
+ # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContextVolumeVolumeIdentityVolumeIdentityById model
+ # volume_attachment_prototype_instance_context_volume_model = {}
+ # volume_attachment_prototype_instance_context_volume_model[
+ # 'id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+
+ # Construct a dict representation of a VolumePrototypeInstanceByImageContext model
+ # volume_prototype_instance_by_image_context_model = {}
+ # volume_prototype_instance_by_image_context_model['capacity'] = 100
+ # volume_prototype_instance_by_image_context_model['iops'] = 10000
+ # volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ # volume_prototype_instance_by_image_context_model[
+ # 'profile'] = volume_profile_identity_model
- # ImageIdentityById model
+ # Construct a dict representation of a ImageIdentityById model
image_identity_model = {}
image_identity_model['id'] = image
- # InstanceProfileIdentityByName model
+ # Construct a dict representation of a InstanceProfileIdentityByName model
instance_profile_identity_model = {}
instance_profile_identity_model['name'] = profile
- # NetworkInterfacePrototype model
+ # Construct a dict representation of a KeyIdentityById model
+ # key_identity_model = {}
+ # key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ # Construct a dict representation of a NetworkInterfacePrototype model
network_interface_prototype_model = {}
+ # network_interface_prototype_model['name'] = 'my-network-interface'
+ # network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5'
+ # network_interface_prototype_model['security_groups'] = [
+ # security_group_identity_model
+ # ]
network_interface_prototype_model['subnet'] = subnet_identity_model
- # VPCIdentityById model
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a VPCIdentityById model
vpc_identity_model = {}
vpc_identity_model['id'] = vpc
- # ZoneIdentityByName model
+ # Construct a dict representation of a VolumeAttachmentPrototypeInstanceByImageContext model
+ # volume_attachment_prototype_instance_by_image_context_model = {}
+ # volume_attachment_prototype_instance_by_image_context_model[
+ # 'delete_volume_on_instance_delete'] = True
+ # volume_attachment_prototype_instance_by_image_context_model[
+ # 'name'] = 'my-volume-attachment'
+ # volume_attachment_prototype_instance_by_image_context_model[
+ # 'volume'] = volume_prototype_instance_by_image_context_model
+
+ # Construct a dict representation of a VolumeAttachmentPrototypeInstanceContext model
+ # volume_attachment_prototype_instance_context_model = {}
+ # volume_attachment_prototype_instance_context_model[
+ # 'delete_volume_on_instance_delete'] = True
+ # volume_attachment_prototype_instance_context_model[
+ # 'name'] = 'my-volume-attachment'
+ # volume_attachment_prototype_instance_context_model[
+ # 'volume'] = volume_attachment_prototype_instance_context_volume_model
+
+ # Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = zone
- # InstancePrototypeInstanceByImage model
+ # Construct a dict representation of a InstancePrototypeInstanceByImage model
instance_prototype_model = {}
# instance_prototype_model['keys'] = [key_identity_model]
instance_prototype_model['name'] = generate_name('vsi')
+ # instance_prototype_model['network_interfaces'] = [
+ # network_interface_prototype_model
+ # ]
instance_prototype_model['profile'] = instance_profile_identity_model
+ # instance_prototype_model[
+ # 'resource_group'] = resource_group_identity_model
+ # instance_prototype_model['user_data'] = 'testString'
+ # instance_prototype_model['volume_attachments'] = [
+ # volume_attachment_prototype_instance_context_model
+ # ]
instance_prototype_model['vpc'] = vpc_identity_model
+ # instance_prototype_model[
+ # 'boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
instance_prototype_model['image'] = image_identity_model
instance_prototype_model[
'primary_network_interface'] = network_interface_prototype_model
instance_prototype_model['zone'] = zone_identity_model
-
+ # Set up parameter values
instance_prototype = instance_prototype_model
response = service.create_instance(instance_prototype)
@@ -1654,18 +2100,27 @@ def list_instance_network_interfaces(service, instance_id):
# create_instance_network_interface()
# --------------------------------------------------------
def create_instance_network_interface(service, instance_id, subnet_id):
- # SubnetIdentityById model
+ # Construct a dict representation of a SubnetIdentityById model
subnet_identity_model = {}
subnet_identity_model['id'] = subnet_id
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ # security_group_identity_model = {}
+ # security_group_identity_model[
+ # 'id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ # Set up parameter values
subnet = subnet_identity_model
name = generate_name('nic')
+ # primary_ipv4_address = '10.0.0.5'
+ # security_groups = [security_group_identity_model]
response = service.create_instance_network_interface(
instance_id,
subnet,
name=name,
+ # primary_ipv4_address=primary_ipv4_address,
+ # security_groups=security_groups,
)
return response
@@ -1755,7 +2210,7 @@ def list_instance_volume_attachments(service, instance_id):
def create_instance_volume_attachment(service, instance_id, vol_id):
- # VolumeIdentityById model
+ # Construct a dict representation of a VolumeIdentityById model
volume_identity_model = {}
volume_identity_model['id'] = vol_id
@@ -1837,18 +2292,85 @@ def list_load_balancers(service):
def create_load_balancer(service, subnet):
- # SubnetIdentityById model
+ # Construct a dict representation of a SubnetIdentityById model
subnet_identity_model = {}
subnet_identity_model['id'] = subnet
+ # Construct a dict representation of a LoadBalancerPoolIdentityByName model
+ # load_balancer_pool_identity_by_name_model = {}
+ # load_balancer_pool_identity_by_name_model[
+ # 'name'] = 'my-load-balancer-pool'
+
+ # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
+ # load_balancer_listener_prototype_load_balancer_context_model = {}
+ # load_balancer_listener_prototype_load_balancer_context_model[
+ # 'connection_limit'] = 2000
+ # load_balancer_listener_prototype_load_balancer_context_model[
+ # 'default_pool'] = load_balancer_pool_identity_by_name_model
+ # load_balancer_listener_prototype_load_balancer_context_model[
+ # 'port'] = 443
+ # load_balancer_listener_prototype_load_balancer_context_model[
+ # 'protocol'] = 'http'
+
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeByAddress model
+ # load_balancer_pool_member_target_prototype_model = {}
+ # load_balancer_pool_member_target_prototype_model[
+ # 'address'] = '192.168.3.4'
+
+ # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model
+ # load_balancer_pool_health_monitor_prototype_model = {}
+ # load_balancer_pool_health_monitor_prototype_model['delay'] = 5
+ # load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2
+ # load_balancer_pool_health_monitor_prototype_model['port'] = 22
+ # load_balancer_pool_health_monitor_prototype_model['timeout'] = 2
+ # load_balancer_pool_health_monitor_prototype_model['type'] = 'http'
+ # load_balancer_pool_health_monitor_prototype_model['url_path'] = '/'
+
+ # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
+ # load_balancer_pool_member_prototype_model = {}
+ # load_balancer_pool_member_prototype_model['port'] = 80
+ # # load_balancer_pool_member_prototype_model[
+ # # 'target'] = load_balancer_pool_member_target_prototype_model
+ # load_balancer_pool_member_prototype_model['weight'] = 50
+
+ # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model
+ # load_balancer_pool_session_persistence_prototype_model = {}
+ # load_balancer_pool_session_persistence_prototype_model[
+ # 'type'] = 'source_ip'
+
+ # Construct a dict representation of a LoadBalancerPoolPrototype model
+ # load_balancer_pool_prototype_model = {}
+ # load_balancer_pool_prototype_model['algorithm'] = 'least_connections'
+ # load_balancer_pool_prototype_model[
+ # 'health_monitor'] = load_balancer_pool_health_monitor_prototype_model
+ # load_balancer_pool_prototype_model['members'] = [
+ # load_balancer_pool_member_prototype_model
+ # ]
+ # load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool'
+ # load_balancer_pool_prototype_model['protocol'] = 'http'
+ # load_balancer_pool_prototype_model[
+ # 'session_persistence'] = load_balancer_pool_session_persistence_prototype_model
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
is_public = True
subnets = [subnet_identity_model]
+ # listeners = [
+ # load_balancer_listener_prototype_load_balancer_context_model
+ # ]
name = generate_name('lb')
+ # pools = [load_balancer_pool_prototype_model]
+ # resource_group = resource_group_identity_model
response = service.create_load_balancer(
is_public,
subnets,
+ # listeners=listeners,
name=name,
+ # pools=pools,
+ # resource_group=resource_group,
)
return response
@@ -1907,14 +2429,57 @@ def list_load_balancer_listeners(service, load_balancer_id):
def create_load_balancer_listener(service, load_balancer_id):
+ # Construct a dict representation of a CertificateInstanceIdentityByCRN model
+ # certificate_instance_identity_model = {}
+ # certificate_instance_identity_model[
+ # 'crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
+
+ # Construct a dict representation of a LoadBalancerPoolIdentityById model
+ # load_balancer_pool_identity_model = {}
+ # load_balancer_pool_identity_model[
+ # 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyPrototypeTargetLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
+ # load_balancer_listener_policy_prototype_target_model = {}
+ # load_balancer_listener_policy_prototype_target_model[
+ # 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
+ # load_balancer_listener_policy_rule_prototype_model = {}
+ # load_balancer_listener_policy_rule_prototype_model[
+ # 'condition'] = 'contains'
+ # load_balancer_listener_policy_rule_prototype_model[
+ # 'field'] = 'MY-APP-HEADER'
+ # load_balancer_listener_policy_rule_prototype_model['type'] = 'header'
+ # load_balancer_listener_policy_rule_prototype_model[
+ # 'value'] = 'testString'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model
+ # load_balancer_listener_policy_prototype_model = {}
+ # load_balancer_listener_policy_prototype_model['action'] = 'forward'
+ # load_balancer_listener_policy_prototype_model['name'] = 'my-policy'
+ # load_balancer_listener_policy_prototype_model['priority'] = 5
+ # load_balancer_listener_policy_prototype_model['rules'] = [
+ # load_balancer_listener_policy_rule_prototype_model
+ # ]
+ # load_balancer_listener_policy_prototype_model[
+ # 'target'] = load_balancer_listener_policy_prototype_target_model
port = 443
protocol = 'http'
+ # certificate_instance = certificate_instance_identity_model
+ # connection_limit = 2000
+ # default_pool = load_balancer_pool_identity_model
+ # policies = [load_balancer_listener_policy_prototype_model]
response = service.create_load_balancer_listener(
load_balancer_id,
protocol,
port=port,
+ # certificate_instance=certificate_instance,
+ # connection_limit=connection_limit,
+ # default_pool=default_pool,
+ # policies=policies,
)
return response
@@ -1964,15 +2529,36 @@ def list_load_balancer_listener_policies(service, load_balancer_id, listener_id)
# create_load_balancer_listener_policy()
# --------------------------------------------------------
def create_load_balancer_listener_policy(service, load_balancer_id, listener_id):
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
+ # load_balancer_listener_policy_rule_prototype_model = {}
+ # load_balancer_listener_policy_rule_prototype_model[
+ # 'condition'] = 'contains'
+ # load_balancer_listener_policy_rule_prototype_model[
+ # 'field'] = 'MY-APP-HEADER'
+ # load_balancer_listener_policy_rule_prototype_model['type'] = 'header'
+ # load_balancer_listener_policy_rule_prototype_model[
+ # 'value'] = 'testString'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyPrototypeTargetLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
+ # load_balancer_listener_policy_prototype_target_model = {}
+ # load_balancer_listener_policy_prototype_target_model[
+ # 'id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
action = 'forward'
priority = 5
name = generate_name('list-pol')
+ # rules = [load_balancer_listener_policy_rule_prototype_model]
+ # target = load_balancer_listener_policy_prototype_target_model
+
response = service.create_load_balancer_listener_policy(
load_balancer_id,
listener_id,
action,
priority,
name=name,
+ # rules=rules,
+ # target=target,
)
return response
@@ -2105,7 +2691,7 @@ def list_load_balancer_pools(service, load_balancer_id):
def create_load_balancer_pool(service, load_balancer_id):
- # LoadBalancerPoolHealthMonitorPrototype model
+ # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model
load_balancer_pool_health_monitor_prototype_model = {}
load_balancer_pool_health_monitor_prototype_model['delay'] = 5
load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2
@@ -2114,12 +2700,19 @@ def create_load_balancer_pool(service, load_balancer_id):
load_balancer_pool_health_monitor_prototype_model['type'] = 'http'
load_balancer_pool_health_monitor_prototype_model['url_path'] = '/'
- # LoadBalancerPoolMemberTargetPrototypeByAddress model
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeByAddress model
load_balancer_pool_member_target_prototype_model = {}
load_balancer_pool_member_target_prototype_model[
'address'] = '192.168.3.4'
- # LoadBalancerPoolSessionPersistencePrototype model
+ # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
+ # load_balancer_pool_member_prototype_model = {}
+ # load_balancer_pool_member_prototype_model['port'] = 80
+ # load_balancer_pool_member_prototype_model[
+ # 'target'] = load_balancer_pool_member_target_prototype_model
+ # load_balancer_pool_member_prototype_model['weight'] = 50
+
+ # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model
load_balancer_pool_session_persistence_prototype_model = {}
load_balancer_pool_session_persistence_prototype_model[
'type'] = 'source_ip'
@@ -2127,6 +2720,7 @@ def create_load_balancer_pool(service, load_balancer_id):
algorithm = 'least_connections'
health_monitor = load_balancer_pool_health_monitor_prototype_model
protocol = 'http'
+ # members = [load_balancer_pool_member_prototype_model]
name = generate_name('lb-pool')
session_persistence = load_balancer_pool_session_persistence_prototype_model
@@ -2135,7 +2729,9 @@ def create_load_balancer_pool(service, load_balancer_id):
algorithm,
health_monitor,
protocol,
+ # members=members,
name=name,
+ # session_persistence=session_persistence,
)
return response
# --------------------------------------------------------
@@ -2188,7 +2784,7 @@ def list_load_balancer_pool_members(service, load_balancer_id, pool_id):
def create_load_balancer_pool_member(service, load_balancer_id, pool_id):
- # LoadBalancerPoolMemberTargetPrototypeByAddress model
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeByAddress model
load_balancer_pool_member_target_prototype_model = {}
load_balancer_pool_member_target_prototype_model[
'address'] = '192.168.3.4'
@@ -2212,9 +2808,18 @@ def create_load_balancer_pool_member(service, load_balancer_id, pool_id):
def replace_load_balancer_pool_members(service, load_balancer_id, pool_id):
- # LoadBalancerPoolMemberPrototype model
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeByAddress model
+ # load_balancer_pool_member_target_prototype_model = {}
+ # load_balancer_pool_member_target_prototype_model[
+ # 'address'] = '192.168.3.4'
+
+ # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
load_balancer_pool_member_prototype_model = {}
load_balancer_pool_member_prototype_model['port'] = 82
+ # load_balancer_pool_member_prototype_model[
+ # 'target'] = load_balancer_pool_member_target_prototype_model
+ # load_balancer_pool_member_prototype_model['weight'] = 50
+
members = [load_balancer_pool_member_prototype_model]
response = service.replace_load_balancer_pool_members(
@@ -2277,13 +2882,68 @@ def list_network_acls(service):
def create_network_acl(service, source_nacl_id):
+
+ # # Construct a dict representation of a NetworkACLRuleReference model
+ # network_acl_rule_reference_model = {}
+ # network_acl_rule_reference_model[
+ # 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # network_acl_rule_reference_model[
+ # 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # network_acl_rule_reference_model['name'] = 'my-rule-1'
+
+ # # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP model
+ # network_acl_rule_prototype_network_acl_context_model = {}
+ # network_acl_rule_prototype_network_acl_context_model['action'] = 'allow'
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'before'] = network_acl_rule_reference_model
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'created_at'] = '2020-01-28T18:40:40.123456Z'
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'destination'] = '192.168.3.0/24'
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'direction'] = 'inbound'
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'ip_version'] = 'ipv4'
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'name'] = 'my-rule-2'
+ # network_acl_rule_prototype_network_acl_context_model['protocol'] = 'udp'
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'source'] = '192.168.3.0/24'
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'destination_port_max'] = 22
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'destination_port_min'] = 22
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'source_port_max'] = 65535
+ # network_acl_rule_prototype_network_acl_context_model[
+ # 'source_port_min'] = 49152
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a VPCIdentityById model
+ # vpc_identity_model = {}
+ # vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+
+ # Construct a dict representation of a NetworkACLPrototypeNetworkACLByRules model
network_acl_prototype_model = {}
network_acl_prototype_model['name'] = generate_name('nacl')
+ # network_acl_prototype_model[
+ # 'resource_group'] = resource_group_identity_model
+ # network_acl_prototype_model['vpc'] = vpc_identity_model
+ # network_acl_prototype_model['rules'] = [
+ # network_acl_rule_prototype_network_acl_context_model
+ # ]
network_acl_reference_model = {}
network_acl_reference_model['id'] = source_nacl_id
network_acl_prototype_model['source_network_acl'] = network_acl_reference_model
-
+ # Set up parameter values
network_acl_prototype = network_acl_prototype_model
response = service.create_network_acl(
@@ -2338,11 +2998,26 @@ def list_network_acl_rules(service, network_acl_id):
def create_network_acl_rule(service, network_acl_id):
- # NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model
+
+ # Construct a dict representation of a NetworkACLRuleReference model
+ # network_acl_rule_reference_model = {}
+ # network_acl_rule_reference_model[
+ # 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # network_acl_rule_reference_model[
+ # 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # network_acl_rule_reference_model['name'] = 'my-rule-1'
+
+ # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model
network_acl_rule_prototype_model = {}
network_acl_rule_prototype_model['action'] = 'allow'
+ # network_acl_rule_prototype_model[
+ # 'before'] = network_acl_rule_reference_model
network_acl_rule_prototype_model['destination'] = '192.168.3.0/24'
network_acl_rule_prototype_model['direction'] = 'inbound'
+ # network_acl_rule_prototype_model[
+ # 'href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ # network_acl_rule_prototype_model[
+ # 'id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
network_acl_rule_prototype_model['ip_version'] = 'ipv4'
network_acl_rule_prototype_model['name'] = 'my-rule-2'
network_acl_rule_prototype_model['protocol'] = 'icmp'
@@ -2409,22 +3084,36 @@ def list_public_gateways(service):
def create_public_gateway(service, vpc, zone):
- # VPCIdentityById model
+ # Construct a dict representation of a VPCIdentityById model
vpc_identity_model = {}
vpc_identity_model['id'] = vpc
- # ZoneIdentityByName model
+ # Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = zone
+ # Construct a dict representation of a PublicGatewayPrototypeFloatingIpFloatingIPIdentityFloatingIPIdentityById model
+ # public_gateway_prototype_floating_ip_model = {}
+ # public_gateway_prototype_floating_ip_model[
+ # 'id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Set up parameter values
vpc = vpc_identity_model
zone = zone_identity_model
+ # floating_ip = public_gateway_prototype_floating_ip_model
name = generate_name('pgw')
+ # resource_group = resource_group_identity_model
response = service.create_public_gateway(
vpc,
zone,
+ # floating_ip=floating_ip,
name=name,
+ # resource_group=resource_group,
)
return response
@@ -2475,6 +3164,11 @@ def list_keys(service):
def create_key(service):
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # resource_group = resource_group_identity_model
+
public_key = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCcPJwUpNQr0MplO6UM5mfV4vlvY0RpD6gcXqodzZIjsoG31+hQxoJVU9yQcSjahktHFs7Fk2Mo79jUT3wVC8Pg6A3//IDFkLjVrg/mQVpIf6+GxIYEtVg6Tk4pP3YNoksrugGlpJ4LCR3HMe3fBQTQqTzObbb0cSF6xhW5UBq8vhqIkhYKd3KLGJnnrwsIGcwb5BRk68ZFYhreAomvx4jWjaBFlH98HhE4wUEVvJLRy/qR/0w3XVjTSgOlhXywaAOEkmwye7kgSglegCpHWwYNly+NxLONjqbX9rHbFHUVRShnFKh2+M6XKE3HowT/3Y1lDd2PiVQpJY0oQmebiRxB astha.jain@ibm.com'
name = generate_name('key')
type = 'rsa'
@@ -2482,6 +3176,7 @@ def create_key(service):
response = service.create_key(
public_key,
name=name,
+ # resource_group=resource_group,
type=type,
)
return response
@@ -2533,16 +3228,40 @@ def list_security_groups(service):
def create_security_group(service, vpc):
- # VPCIdentityById model
+ # Construct a dict representation of a VPCIdentityById model
vpc_identity_model = {}
vpc_identity_model['id'] = vpc
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPRemoteIP model
+ # security_group_rule_prototype_security_group_rule_protocol_icmp_remote_model = {}
+ # security_group_rule_prototype_security_group_rule_protocol_icmp_remote_model[
+ # 'address'] = '192.168.3.4'
+
+ # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
+ # security_group_rule_prototype_model = {}
+ # security_group_rule_prototype_model['direction'] = 'inbound'
+ # security_group_rule_prototype_model['ip_version'] = 'ipv4'
+ # security_group_rule_prototype_model['protocol'] = 'icmp'
+ # security_group_rule_prototype_model[
+ # 'remote'] = security_group_rule_prototype_security_group_rule_protocol_icmp_remote_model
+ # security_group_rule_prototype_model['code'] = 0
+ # security_group_rule_prototype_model['type'] = 8
+
+ # Set up parameter values
vpc = vpc_identity_model
name = generate_name('sg')
+ # resource_group = resource_group_identity_model
+ # rules = [security_group_rule_prototype_model]
response = service.create_security_group(
vpc,
name=name,
+ # resource_group=resource_group,
+ # rules=rules,
)
return response
@@ -2633,10 +3352,21 @@ def list_security_group_rules(service, security_group_id):
def create_security_group_rule(service, sg_id):
+ # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMPRemoteIP model
+ # security_group_rule_prototype_security_group_rule_protocol_icmp_remote_model = {}
+ # security_group_rule_prototype_security_group_rule_protocol_icmp_remote_model[
+ # 'address'] = '192.168.3.4'
- # SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
+ # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
security_group_rule_prototype_model = {}
security_group_rule_prototype_model['direction'] = 'inbound'
+ # security_group_rule_prototype_model['ip_version'] = 'ipv4'
+ # security_group_rule_prototype_model['protocol'] = 'icmp'
+ # security_group_rule_prototype_model[
+ # 'remote'] = security_group_rule_prototype_security_group_rule_protocol_icmp_remote_model
+ # security_group_rule_prototype_model['code'] = 0
+ # security_group_rule_prototype_model['type'] = 8
+
security_group_id = sg_id
security_group_rule_prototype = security_group_rule_prototype_model
@@ -2693,20 +3423,37 @@ def list_subnets(service):
def create_subnet(service, vpc, zone):
+ # Construct a dict representation of a NetworkACLIdentityById model
+ # network_acl_identity_model = {}
+ # network_acl_identity_model[
+ # 'id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # VPCIdentityById model
+ # Construct a dict representation of a PublicGatewayIdentityById model
+ # public_gateway_identity_model = {}
+ # public_gateway_identity_model[
+ # 'id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a VPCIdentityById model
vpc_identity_model = {}
vpc_identity_model['id'] = vpc
- # ZoneIdentityByName model
+ # Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = zone
- # SubnetPrototypeSubnetByTotalCount model
+ # Construct a dict representation of a SubnetPrototypeSubnetByTotalCount model
subnet_prototype_model = {}
subnet_prototype_model['ip_version'] = 'both'
subnet_prototype_model['name'] = generate_name('subnet')
+ # subnet_prototype_model['network_acl'] = network_acl_identity_model
+ # subnet_prototype_model['public_gateway'] = public_gateway_identity_model
+ # subnet_prototype_model['resource_group'] = resource_group_identity_model
subnet_prototype_model['vpc'] = vpc_identity_model
+ # subnet_prototype_model['total_ipv4_address_count'] = 256
subnet_prototype_model['ipv4_cidr_block'] = '10.245.0.0/24'
subnet_prototype_model['zone'] = zone_identity_model
@@ -2763,7 +3510,7 @@ def get_subnet_network_acl(service, id):
def replace_subnet_network_acl(service, id, acl):
- # NetworkACLIdentityById model
+ # Construct a dict representation of a NetworkACLIdentityById model
network_acl_identity_model = {}
network_acl_identity_model[
'id'] = acl
@@ -2799,7 +3546,7 @@ def get_subnet_public_gateway(service, id):
def set_subnet_public_gateway(service, id, pgw):
- # PublicGatewayIdentityById model
+ # Construct a dict representation of a PublicGatewayIdentityById model
public_gateway_identity_model = {}
public_gateway_identity_model[
'id'] = pgw
@@ -2877,7 +3624,11 @@ def list_vpcs(service):
def create_vpc(service):
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Set up parameter values
address_prefix_management = 'manual'
classic_access = False
name = generate_name('vpc')
@@ -2887,6 +3638,7 @@ def create_vpc(service):
address_prefix_management=address_prefix_management,
classic_access=classic_access,
name=name,
+ # resource_group=resource_group,
)
return response
@@ -2955,7 +3707,7 @@ def list_vpc_address_prefixes(service, vpc_id):
# --------------------------------------------------------
def create_vpc_address_prefix(service, vpc_id, zone):
- # ZoneIdentityByName model
+ # Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = zone
cidr = '10.0.0.0/24'
@@ -3029,11 +3781,11 @@ def list_vpc_routes(service, vpc_id):
# create_vpc_route()
# --------------------------------------------------------
def create_vpc_route(service, vpc_id, zone):
- # ZoneIdentityByName model
+ # Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = zone
- # RouteNextHopPrototypeRouteNextHopIP model
+ # Construct a dict representation of a RouteNextHopPrototypeRouteNextHopIP model
route_next_hop_prototype_model = {}
route_next_hop_prototype_model['address'] = '10.5.0.25'
@@ -3096,6 +3848,9 @@ def list_ike_policies(service):
def create_ike_policy(service):
+ # # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
authentication_algorithm = 'md5'
dh_group = 5
@@ -3103,6 +3858,7 @@ def create_ike_policy(service):
ike_version = 1
key_lifetime = 28800
name = generate_name('ike')
+ # resource_group = resource_group_identity_model
response = service.create_ike_policy(
authentication_algorithm,
@@ -3111,6 +3867,7 @@ def create_ike_policy(service):
ike_version,
key_lifetime=key_lifetime,
name=name,
+ # resource_group=resource_group,
)
return response
@@ -3174,11 +3931,16 @@ def list_ipsec_policies(service):
def create_ipsec_policy(service):
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
authentication_algorithm = 'md5'
encryption_algorithm = 'triple_des'
pfs = 'disabled'
key_lifetime = 3600
name = generate_name('ipsec')
+ # resource_group = resource_group_identity_model
response = service.create_ipsec_policy(
authentication_algorithm,
@@ -3186,6 +3948,7 @@ def create_ipsec_policy(service):
pfs,
key_lifetime=key_lifetime,
name=name,
+ # resource_group=resource_group,
)
return response
@@ -3260,7 +4023,7 @@ def create_vpn_gateway(service, subnet):
vpn_gateway_prototype_model['subnet'] = subnet_identity_model
vpn_gateway_prototype_model['mode'] = 'route'
-
+ # Set up parameter values
vpn_gateway_prototype = vpn_gateway_prototype_model
response = service.create_vpn_gateway(vpn_gateway_prototype)
@@ -3467,19 +4230,24 @@ def list_volumes(service):
def create_volume(service, zone):
- # VolumeProfileIdentityByName model
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a VolumeProfileIdentityByName model
volume_profile_identity_model = {}
volume_profile_identity_model['name'] = 'general-purpose'
- # ZoneIdentityByName model
+ # Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = zone
- # VolumePrototypeVolumeByCapacity model
+ # Construct a dict representation of a VolumePrototypeVolumeByCapacity model
volume_prototype_model = {}
volume_prototype_model['iops'] = 10000
volume_prototype_model['name'] = 'my-volume'
volume_prototype_model['profile'] = volume_profile_identity_model
+ # volume_prototype_model['resource_group'] = resource_group_identity_model
volume_prototype_model['zone'] = zone_identity_model
volume_prototype_model['capacity'] = 100
@@ -3534,16 +4302,21 @@ def list_flow_log_collectors(service):
def create_flow_log_collector(service, target_id):
- # CloudObjectStorageBucketIdentityByName model
+ # Construct a dict representation of a CloudObjectStorageBucketIdentityByName model
cloud_object_storage_bucket_identity_model = {}
cloud_object_storage_bucket_identity_model[
'name'] = generate_name('cos-bucket')
- # FlowLogCollectorPrototypeTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById model
+ # Construct a dict representation of a FlowLogCollectorPrototypeTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById model
flow_log_collector_prototype_target_model = {}
flow_log_collector_prototype_target_model[
'id'] = target_id
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ # resource_group_identity_model = {}
+ # resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Set up parameter values
storage_bucket = cloud_object_storage_bucket_identity_model
target = flow_log_collector_prototype_target_model
active = False
@@ -3555,6 +4328,7 @@ def create_flow_log_collector(service, target_id):
target,
active=active,
name=name,
+ # resource_group=resource_group,
)
return response
@@ -3604,28 +4378,28 @@ def list_instance_templates(service):
def create_instance_template(service, vpc, profile, zone, image, subnet):
- # SubnetIdentityById model
+ # Construct a dict representation of a SubnetIdentityById model
subnet_identity_model = {}
subnet_identity_model['id'] = subnet
- # ImageIdentityById model
+ # Construct a dict representation of a ImageIdentityById model
image_identity_model = {}
image_identity_model['id'] = image
- # InstanceProfileIdentityByName model
+ # Construct a dict representation of a InstanceProfileIdentityByName model
instance_profile_identity_model = {}
instance_profile_identity_model['name'] = profile
- # NetworkInterfacePrototype model
+ # Construct a dict representation of a NetworkInterfacePrototype model
network_interface_prototype_model = {}
network_interface_prototype_model['subnet'] = subnet_identity_model
- # VPCIdentityById model
+ # Construct a dict representation of a VPCIdentityById model
vpc_identity_model = {}
vpc_identity_model['id'] = vpc
- # ZoneIdentityByName model
+ # Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = zone
@@ -3695,16 +4469,16 @@ def list_instance_groups(service):
def create_instance_group(service, instance_template, subnet):
- # InstanceTemplateIdentityById model
+ # Construct a dict representation of a InstanceTemplateIdentityById model
instance_template_identity_model = {}
instance_template_identity_model[
'id'] = instance_template
- # SubnetIdentityById model
+ # Construct a dict representation of a SubnetIdentityById model
subnet_identity_model = {}
subnet_identity_model['id'] = subnet
-
+ # Set up parameter values
instance_template = instance_template_identity_model
subnets = [subnet_identity_model]
name = generate_name("instance-group")
@@ -3770,7 +4544,7 @@ def list_instance_group_managers(service, instance_group_id):
def create_instance_group_manager(service, id):
- # InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
+ # Construct a dict representation of a InstanceGroupManagerPrototypeInstanceGroupManagerAutoScalePrototype model
instance_group_manager_prototype_model = {}
instance_group_manager_prototype_model[
'name'] = generate_name("manager")
@@ -3781,7 +4555,7 @@ def create_instance_group_manager(service, id):
instance_group_manager_prototype_model['min_membership_count'] = 1
instance_group_manager_prototype_model['manager_type'] = 'autoscale'
-
+ # Set up parameter values
instance_group_id = id
instance_group_manager_prototype = instance_group_manager_prototype_model
@@ -3848,7 +4622,7 @@ def create_instance_group_manager_policy(service, instance_group_id,
instance_group_manager_policy_prototype_model['metric_value'] = 38
instance_group_manager_policy_prototype_model['policy_type'] = 'target'
-
+ # Set up parameter values
instance_group_manager_policy_prototype = instance_group_manager_policy_prototype_model
# Invoke method
@@ -4253,12 +5027,12 @@ def create_dedicated_host(service, profileName, groupId):
dedicated_host_profile_identity_model = {}
dedicated_host_profile_identity_model['name'] = profileName
- # DedicatedHostGroupIdentityById model
+ # Construct a dict representation of a DedicatedHostGroupIdentityById model
dedicated_host_group_identity_model = {
'id': groupId
}
- # DedicatedHostPrototypeDedicatedHostByGroup model
+ # Construct a dict representation of a DedicatedHostPrototypeDedicatedHostByGroup model
dedicated_host_prototype_model = {
'name': 'my-host',
'profile': dedicated_host_profile_identity_model,
@@ -4294,6 +5068,8 @@ def delete_dedicated_host(service, id):
delete_dedicated_host_response = service.delete_dedicated_host(id)
return delete_dedicated_host_response
+
+
# --------------------------------------------------------
# placement groups
# --------------------------------------------------------
diff --git a/test/unit/test_vpc_v1.py b/test/unit/test_vpc_v1.py
index 4f7edb0..45338bf 100644
--- a/test/unit/test_vpc_v1.py
+++ b/test/unit/test_vpc_v1.py
@@ -1,5 +1,5 @@
# -*- coding: utf-8 -*-
-# (C) Copyright IBM Corp. 2021.
+# (C) Copyright IBM Corp. 2021, 2022.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -42,6 +42,33 @@
_base_url = 'https://us-south.iaas.cloud.ibm.com/v1'
_service.set_service_url(_base_url)
+
+def preprocess_url(operation_path: str):
+ """
+ Returns the request url associated with the specified operation path.
+ This will be base_url concatenated with a quoted version of operation_path.
+ The returned request URL is used to register the mock response so it needs
+ to match the request URL that is formed by the requests library.
+ """
+ # First, unquote the path since it might have some quoted/escaped characters in it
+ # due to how the generator inserts the operation paths into the unit test code.
+ operation_path = urllib.parse.unquote(operation_path)
+
+ # Next, quote the path using urllib so that we approximate what will
+ # happen during request processing.
+ operation_path = urllib.parse.quote(operation_path, safe='/')
+
+ # Finally, form the request URL from the base URL and operation path.
+ request_url = _base_url + operation_path
+
+ # If the request url does NOT end with a /, then just return it as-is.
+ # Otherwise, return a regular expression that matches one or more trailing /.
+ if re.fullmatch('.*/+', request_url) is None:
+ return request_url
+ else:
+ return re.compile(request_url.rstrip('/') + '/+')
+
+
##############################################################################
# Start of Service: VPCs
##############################################################################
@@ -73,8 +100,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -88,24 +123,13 @@ class TestListVpcs():
Test Class for list_vpcs
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_vpcs_all_params(self):
"""
list_vpcs()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs')
+ url = preprocess_url('/vpcs')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}]}'
responses.add(responses.GET,
url,
@@ -154,7 +178,7 @@ def test_list_vpcs_required_params(self):
test_list_vpcs_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs')
+ url = preprocess_url('/vpcs')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}]}'
responses.add(responses.GET,
url,
@@ -185,7 +209,7 @@ def test_list_vpcs_value_error(self):
test_list_vpcs_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs')
+ url = preprocess_url('/vpcs')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132, "vpcs": [{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}]}'
responses.add(responses.GET,
url,
@@ -216,24 +240,13 @@ class TestCreateVpc():
Test Class for create_vpc
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_vpc_all_params(self):
"""
create_vpc()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs')
+ url = preprocess_url('/vpcs')
mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}'
responses.add(responses.POST,
url,
@@ -285,7 +298,7 @@ def test_create_vpc_required_params(self):
test_create_vpc_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs')
+ url = preprocess_url('/vpcs')
mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}'
responses.add(responses.POST,
url,
@@ -316,7 +329,7 @@ def test_create_vpc_value_error(self):
test_create_vpc_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs')
+ url = preprocess_url('/vpcs')
mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}'
responses.add(responses.POST,
url,
@@ -347,24 +360,13 @@ class TestDeleteVpc():
Test Class for delete_vpc
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_vpc_all_params(self):
"""
delete_vpc()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString')
+ url = preprocess_url('/vpcs/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -397,7 +399,7 @@ def test_delete_vpc_value_error(self):
test_delete_vpc_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString')
+ url = preprocess_url('/vpcs/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -429,24 +431,13 @@ class TestGetVpc():
Test Class for get_vpc
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_vpc_all_params(self):
"""
get_vpc()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString')
+ url = preprocess_url('/vpcs/testString')
mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}'
responses.add(responses.GET,
url,
@@ -482,7 +473,7 @@ def test_get_vpc_value_error(self):
test_get_vpc_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString')
+ url = preprocess_url('/vpcs/testString')
mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}'
responses.add(responses.GET,
url,
@@ -517,24 +508,13 @@ class TestUpdateVpc():
Test Class for update_vpc
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_vpc_all_params(self):
"""
update_vpc()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString')
+ url = preprocess_url('/vpcs/testString')
mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}'
responses.add(responses.PATCH,
url,
@@ -579,7 +559,7 @@ def test_update_vpc_value_error(self):
test_update_vpc_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString')
+ url = preprocess_url('/vpcs/testString')
mock_response = '{"classic_access": false, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "cse_source_ips": [{"ip": {"address": "192.168.3.4"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "default_network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "default_routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "default_security_group": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available"}'
responses.add(responses.PATCH,
url,
@@ -620,24 +600,13 @@ class TestGetVpcDefaultNetworkAcl():
Test Class for get_vpc_default_network_acl
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_vpc_default_network_acl_all_params(self):
"""
get_vpc_default_network_acl()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/default_network_acl')
+ url = preprocess_url('/vpcs/testString/default_network_acl')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-malaise", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
@@ -673,7 +642,7 @@ def test_get_vpc_default_network_acl_value_error(self):
test_get_vpc_default_network_acl_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/default_network_acl')
+ url = preprocess_url('/vpcs/testString/default_network_acl')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "mnemonic-ersatz-eatery-malaise", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
@@ -708,24 +677,13 @@ class TestGetVpcDefaultRoutingTable():
Test Class for get_vpc_default_routing_table
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_vpc_default_routing_table_all_params(self):
"""
get_vpc_default_routing_table()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/default_routing_table')
+ url = preprocess_url('/vpcs/testString/default_routing_table')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.GET,
url,
@@ -761,7 +719,7 @@ def test_get_vpc_default_routing_table_value_error(self):
test_get_vpc_default_routing_table_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/default_routing_table')
+ url = preprocess_url('/vpcs/testString/default_routing_table')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "milled-easy-equine-machines", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.GET,
url,
@@ -796,24 +754,13 @@ class TestGetVpcDefaultSecurityGroup():
Test Class for get_vpc_default_security_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_vpc_default_security_group_all_params(self):
"""
get_vpc_default_security_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/default_security_group')
+ 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"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
@@ -849,7 +796,7 @@ def test_get_vpc_default_security_group_value_error(self):
test_get_vpc_default_security_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/default_security_group')
+ 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"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
@@ -884,24 +831,13 @@ class TestListVpcAddressPrefixes():
Test Class for list_vpc_address_prefixes
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_vpc_address_prefixes_all_params(self):
"""
list_vpc_address_prefixes()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes')
+ url = preprocess_url('/vpcs/testString/address_prefixes')
mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -946,7 +882,7 @@ def test_list_vpc_address_prefixes_required_params(self):
test_list_vpc_address_prefixes_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes')
+ url = preprocess_url('/vpcs/testString/address_prefixes')
mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -982,7 +918,7 @@ def test_list_vpc_address_prefixes_value_error(self):
test_list_vpc_address_prefixes_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes')
+ url = preprocess_url('/vpcs/testString/address_prefixes')
mock_response = '{"address_prefixes": [{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -1017,24 +953,13 @@ class TestCreateVpcAddressPrefix():
Test Class for create_vpc_address_prefix
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_vpc_address_prefix_all_params(self):
"""
create_vpc_address_prefix()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes')
+ url = preprocess_url('/vpcs/testString/address_prefixes')
mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -1088,7 +1013,7 @@ def test_create_vpc_address_prefix_value_error(self):
test_create_vpc_address_prefix_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes')
+ url = preprocess_url('/vpcs/testString/address_prefixes')
mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -1133,24 +1058,13 @@ class TestDeleteVpcAddressPrefix():
Test Class for delete_vpc_address_prefix
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_vpc_address_prefix_all_params(self):
"""
delete_vpc_address_prefix()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString')
+ url = preprocess_url('/vpcs/testString/address_prefixes/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -1185,7 +1099,7 @@ def test_delete_vpc_address_prefix_value_error(self):
test_delete_vpc_address_prefix_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString')
+ url = preprocess_url('/vpcs/testString/address_prefixes/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -1219,24 +1133,13 @@ class TestGetVpcAddressPrefix():
Test Class for get_vpc_address_prefix
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_vpc_address_prefix_all_params(self):
"""
get_vpc_address_prefix()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString')
+ url = preprocess_url('/vpcs/testString/address_prefixes/testString')
mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -1274,7 +1177,7 @@ def test_get_vpc_address_prefix_value_error(self):
test_get_vpc_address_prefix_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString')
+ url = preprocess_url('/vpcs/testString/address_prefixes/testString')
mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -1311,24 +1214,13 @@ class TestUpdateVpcAddressPrefix():
Test Class for update_vpc_address_prefix
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_vpc_address_prefix_all_params(self):
"""
update_vpc_address_prefix()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString')
+ url = preprocess_url('/vpcs/testString/address_prefixes/testString')
mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -1376,7 +1268,7 @@ def test_update_vpc_address_prefix_value_error(self):
test_update_vpc_address_prefix_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/address_prefixes/testString')
+ url = preprocess_url('/vpcs/testString/address_prefixes/testString')
mock_response = '{"cidr": "192.168.3.0/24", "created_at": "2019-01-01T12:00:00.000Z", "has_subnets": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": false, "name": "my-address-prefix-2", "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -1420,24 +1312,13 @@ class TestListVpcRoutes():
Test Class for list_vpc_routes
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_vpc_routes_all_params(self):
"""
list_vpc_routes()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes')
+ url = preprocess_url('/vpcs/testString/routes')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -1485,7 +1366,7 @@ def test_list_vpc_routes_required_params(self):
test_list_vpc_routes_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes')
+ url = preprocess_url('/vpcs/testString/routes')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -1521,7 +1402,7 @@ def test_list_vpc_routes_value_error(self):
test_list_vpc_routes_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes')
+ url = preprocess_url('/vpcs/testString/routes')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -1556,24 +1437,13 @@ class TestCreateVpcRoute():
Test Class for create_vpc_route
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_vpc_route_all_params(self):
"""
create_vpc_route()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes')
+ url = preprocess_url('/vpcs/testString/routes')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -1634,7 +1504,7 @@ def test_create_vpc_route_value_error(self):
test_create_vpc_route_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes')
+ url = preprocess_url('/vpcs/testString/routes')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -1684,24 +1554,13 @@ class TestDeleteVpcRoute():
Test Class for delete_vpc_route
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_vpc_route_all_params(self):
"""
delete_vpc_route()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routes/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -1736,7 +1595,7 @@ def test_delete_vpc_route_value_error(self):
test_delete_vpc_route_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routes/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -1770,24 +1629,13 @@ class TestGetVpcRoute():
Test Class for get_vpc_route
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_vpc_route_all_params(self):
"""
get_vpc_route()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routes/testString')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -1825,7 +1673,7 @@ def test_get_vpc_route_value_error(self):
test_get_vpc_route_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routes/testString')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -1862,24 +1710,13 @@ class TestUpdateVpcRoute():
Test Class for update_vpc_route
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_vpc_route_all_params(self):
"""
update_vpc_route()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routes/testString')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -1926,7 +1763,7 @@ def test_update_vpc_route_value_error(self):
test_update_vpc_route_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routes/testString')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -1969,24 +1806,13 @@ class TestListVpcRoutingTables():
Test Class for list_vpc_routing_tables
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_vpc_routing_tables_all_params(self):
"""
list_vpc_routing_tables()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables')
+ url = preprocess_url('/vpcs/testString/routing_tables')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -2034,7 +1860,7 @@ def test_list_vpc_routing_tables_required_params(self):
test_list_vpc_routing_tables_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables')
+ url = preprocess_url('/vpcs/testString/routing_tables')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -2070,7 +1896,7 @@ def test_list_vpc_routing_tables_value_error(self):
test_list_vpc_routing_tables_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables')
+ url = preprocess_url('/vpcs/testString/routing_tables')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "routing_tables": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -2105,24 +1931,13 @@ class TestCreateVpcRoutingTable():
Test Class for create_vpc_routing_table
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_vpc_routing_table_all_params(self):
"""
create_vpc_routing_table()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables')
+ url = preprocess_url('/vpcs/testString/routing_tables')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.POST,
url,
@@ -2191,7 +2006,7 @@ def test_create_vpc_routing_table_value_error(self):
test_create_vpc_routing_table_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables')
+ url = preprocess_url('/vpcs/testString/routing_tables')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.POST,
url,
@@ -2247,24 +2062,13 @@ class TestDeleteVpcRoutingTable():
Test Class for delete_vpc_routing_table
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_vpc_routing_table_all_params(self):
"""
delete_vpc_routing_table()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -2299,7 +2103,7 @@ def test_delete_vpc_routing_table_value_error(self):
test_delete_vpc_routing_table_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -2333,24 +2137,13 @@ class TestGetVpcRoutingTable():
Test Class for get_vpc_routing_table
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_vpc_routing_table_all_params(self):
"""
get_vpc_routing_table()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.GET,
url,
@@ -2388,7 +2181,7 @@ def test_get_vpc_routing_table_value_error(self):
test_get_vpc_routing_table_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.GET,
url,
@@ -2425,24 +2218,13 @@ class TestUpdateVpcRoutingTable():
Test Class for update_vpc_routing_table
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_vpc_routing_table_all_params(self):
"""
update_vpc_routing_table()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.PATCH,
url,
@@ -2492,7 +2274,7 @@ def test_update_vpc_routing_table_value_error(self):
test_update_vpc_routing_table_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.PATCH,
url,
@@ -2538,24 +2320,13 @@ class TestListVpcRoutingTableRoutes():
Test Class for list_vpc_routing_table_routes
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_vpc_routing_table_routes_all_params(self):
"""
list_vpc_routing_table_routes()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -2602,7 +2373,7 @@ def test_list_vpc_routing_table_routes_required_params(self):
test_list_vpc_routing_table_routes_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -2640,7 +2411,7 @@ def test_list_vpc_routing_table_routes_value_error(self):
test_list_vpc_routing_table_routes_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20"}, "routes": [{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -2677,24 +2448,13 @@ class TestCreateVpcRoutingTableRoute():
Test Class for create_vpc_routing_table_route
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_vpc_routing_table_route_all_params(self):
"""
create_vpc_routing_table_route()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -2757,7 +2517,7 @@ def test_create_vpc_routing_table_route_value_error(self):
test_create_vpc_routing_table_route_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -2809,24 +2569,13 @@ class TestDeleteVpcRoutingTableRoute():
Test Class for delete_vpc_routing_table_route
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_vpc_routing_table_route_all_params(self):
"""
delete_vpc_routing_table_route()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -2863,7 +2612,7 @@ def test_delete_vpc_routing_table_route_value_error(self):
test_delete_vpc_routing_table_route_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -2899,24 +2648,13 @@ class TestGetVpcRoutingTableRoute():
Test Class for get_vpc_routing_table_route
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_vpc_routing_table_route_all_params(self):
"""
get_vpc_routing_table_route()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -2956,7 +2694,7 @@ def test_get_vpc_routing_table_route_value_error(self):
test_get_vpc_routing_table_route_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -2995,24 +2733,13 @@ class TestUpdateVpcRoutingTableRoute():
Test Class for update_vpc_routing_table_route
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_vpc_routing_table_route_all_params(self):
"""
update_vpc_routing_table_route()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -3061,7 +2788,7 @@ def test_update_vpc_routing_table_route_value_error(self):
test_update_vpc_routing_table_route_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpcs/testString/routing_tables/testString/routes/testString')
+ url = preprocess_url('/vpcs/testString/routing_tables/testString/routes/testString')
mock_response = '{"action": "delegate", "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "lifecycle_state": "stable", "name": "my-route-1", "next_hop": {"address": "192.168.3.4"}, "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,
@@ -3137,8 +2864,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -3152,24 +2887,13 @@ class TestListSubnets():
Test Class for list_subnets
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_subnets_all_params(self):
"""
list_subnets()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets')
+ url = preprocess_url('/subnets')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -3221,7 +2945,7 @@ def test_list_subnets_required_params(self):
test_list_subnets_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets')
+ url = preprocess_url('/subnets')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -3252,7 +2976,7 @@ def test_list_subnets_value_error(self):
test_list_subnets_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets')
+ url = preprocess_url('/subnets')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "subnets": [{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -3283,24 +3007,13 @@ class TestCreateSubnet():
Test Class for create_subnet
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_subnet_all_params(self):
"""
create_subnet()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets')
+ url = preprocess_url('/subnets')
mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -3312,7 +3025,7 @@ def test_create_subnet_all_params(self):
network_acl_identity_model = {}
network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a dict representation of a PublicGatewayIdentityById model
+ # Construct a dict representation of a PublicGatewayIdentityPublicGatewayIdentityById model
public_gateway_identity_model = {}
public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
@@ -3375,7 +3088,7 @@ def test_create_subnet_value_error(self):
test_create_subnet_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets')
+ url = preprocess_url('/subnets')
mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -3387,7 +3100,7 @@ def test_create_subnet_value_error(self):
network_acl_identity_model = {}
network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a dict representation of a PublicGatewayIdentityById model
+ # Construct a dict representation of a PublicGatewayIdentityPublicGatewayIdentityById model
public_gateway_identity_model = {}
public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
@@ -3446,24 +3159,13 @@ class TestDeleteSubnet():
Test Class for delete_subnet
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_subnet_all_params(self):
"""
delete_subnet()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString')
+ url = preprocess_url('/subnets/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -3496,7 +3198,7 @@ def test_delete_subnet_value_error(self):
test_delete_subnet_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString')
+ url = preprocess_url('/subnets/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -3528,24 +3230,13 @@ class TestGetSubnet():
Test Class for get_subnet
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_subnet_all_params(self):
"""
get_subnet()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString')
+ url = preprocess_url('/subnets/testString')
mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -3581,7 +3272,7 @@ def test_get_subnet_value_error(self):
test_get_subnet_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString')
+ url = preprocess_url('/subnets/testString')
mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -3616,24 +3307,13 @@ class TestUpdateSubnet():
Test Class for update_subnet
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_subnet_all_params(self):
"""
update_subnet()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString')
+ url = preprocess_url('/subnets/testString')
mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -3645,9 +3325,9 @@ def test_update_subnet_all_params(self):
network_acl_identity_model = {}
network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a dict representation of a PublicGatewayIdentityById model
- public_gateway_identity_model = {}
- public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ # Construct a dict representation of a SubnetPublicGatewayPatchPublicGatewayIdentityById model
+ subnet_public_gateway_patch_model = {}
+ subnet_public_gateway_patch_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
# Construct a dict representation of a RoutingTableIdentityById model
routing_table_identity_model = {}
@@ -3657,7 +3337,7 @@ def test_update_subnet_all_params(self):
subnet_patch_model = {}
subnet_patch_model['name'] = 'my-subnet'
subnet_patch_model['network_acl'] = network_acl_identity_model
- subnet_patch_model['public_gateway'] = public_gateway_identity_model
+ subnet_patch_model['public_gateway'] = subnet_public_gateway_patch_model
subnet_patch_model['routing_table'] = routing_table_identity_model
# Set up parameter values
@@ -3693,7 +3373,7 @@ def test_update_subnet_value_error(self):
test_update_subnet_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString')
+ url = preprocess_url('/subnets/testString')
mock_response = '{"available_ipv4_address_count": 15, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "ip_version": "ipv4", "ipv4_cidr_block": "10.0.0.0/24", "name": "my-subnet", "network_acl": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl"}, "public_gateway": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_type": "public_gateway"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "routing_table": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-routing-table-1", "resource_type": "routing_table"}, "status": "available", "total_ipv4_address_count": 256, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -3705,9 +3385,9 @@ def test_update_subnet_value_error(self):
network_acl_identity_model = {}
network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a dict representation of a PublicGatewayIdentityById model
- public_gateway_identity_model = {}
- public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ # Construct a dict representation of a SubnetPublicGatewayPatchPublicGatewayIdentityById model
+ subnet_public_gateway_patch_model = {}
+ subnet_public_gateway_patch_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
# Construct a dict representation of a RoutingTableIdentityById model
routing_table_identity_model = {}
@@ -3717,7 +3397,7 @@ def test_update_subnet_value_error(self):
subnet_patch_model = {}
subnet_patch_model['name'] = 'my-subnet'
subnet_patch_model['network_acl'] = network_acl_identity_model
- subnet_patch_model['public_gateway'] = public_gateway_identity_model
+ subnet_patch_model['public_gateway'] = subnet_public_gateway_patch_model
subnet_patch_model['routing_table'] = routing_table_identity_model
# Set up parameter values
@@ -3749,24 +3429,13 @@ class TestGetSubnetNetworkAcl():
Test Class for get_subnet_network_acl
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_subnet_network_acl_all_params(self):
"""
get_subnet_network_acl()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/network_acl')
+ url = preprocess_url('/subnets/testString/network_acl')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
@@ -3802,7 +3471,7 @@ def test_get_subnet_network_acl_value_error(self):
test_get_subnet_network_acl_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/network_acl')
+ url = preprocess_url('/subnets/testString/network_acl')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
@@ -3837,24 +3506,13 @@ class TestReplaceSubnetNetworkAcl():
Test Class for replace_subnet_network_acl
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_replace_subnet_network_acl_all_params(self):
"""
replace_subnet_network_acl()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/network_acl')
+ url = preprocess_url('/subnets/testString/network_acl')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.PUT,
url,
@@ -3899,7 +3557,7 @@ def test_replace_subnet_network_acl_value_error(self):
test_replace_subnet_network_acl_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/network_acl')
+ url = preprocess_url('/subnets/testString/network_acl')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.PUT,
url,
@@ -3940,24 +3598,13 @@ class TestUnsetSubnetPublicGateway():
Test Class for unset_subnet_public_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_unset_subnet_public_gateway_all_params(self):
"""
unset_subnet_public_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway')
+ url = preprocess_url('/subnets/testString/public_gateway')
responses.add(responses.DELETE,
url,
status=204)
@@ -3990,7 +3637,7 @@ def test_unset_subnet_public_gateway_value_error(self):
test_unset_subnet_public_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway')
+ url = preprocess_url('/subnets/testString/public_gateway')
responses.add(responses.DELETE,
url,
status=204)
@@ -4022,24 +3669,13 @@ class TestGetSubnetPublicGateway():
Test Class for get_subnet_public_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_subnet_public_gateway_all_params(self):
"""
get_subnet_public_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway')
+ url = preprocess_url('/subnets/testString/public_gateway')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -4075,7 +3711,7 @@ def test_get_subnet_public_gateway_value_error(self):
test_get_subnet_public_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway')
+ url = preprocess_url('/subnets/testString/public_gateway')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -4110,24 +3746,13 @@ class TestSetSubnetPublicGateway():
Test Class for set_subnet_public_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_set_subnet_public_gateway_all_params(self):
"""
set_subnet_public_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway')
+ url = preprocess_url('/subnets/testString/public_gateway')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -4135,7 +3760,7 @@ def test_set_subnet_public_gateway_all_params(self):
content_type='application/json',
status=201)
- # Construct a dict representation of a PublicGatewayIdentityById model
+ # Construct a dict representation of a PublicGatewayIdentityPublicGatewayIdentityById model
public_gateway_identity_model = {}
public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
@@ -4172,7 +3797,7 @@ def test_set_subnet_public_gateway_value_error(self):
test_set_subnet_public_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/public_gateway')
+ url = preprocess_url('/subnets/testString/public_gateway')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -4180,7 +3805,7 @@ def test_set_subnet_public_gateway_value_error(self):
content_type='application/json',
status=201)
- # Construct a dict representation of a PublicGatewayIdentityById model
+ # Construct a dict representation of a PublicGatewayIdentityPublicGatewayIdentityById model
public_gateway_identity_model = {}
public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
@@ -4213,24 +3838,13 @@ class TestGetSubnetRoutingTable():
Test Class for get_subnet_routing_table
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_subnet_routing_table_all_params(self):
"""
get_subnet_routing_table()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/routing_table')
+ url = preprocess_url('/subnets/testString/routing_table')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.GET,
url,
@@ -4266,7 +3880,7 @@ def test_get_subnet_routing_table_value_error(self):
test_get_subnet_routing_table_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/routing_table')
+ url = preprocess_url('/subnets/testString/routing_table')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.GET,
url,
@@ -4301,24 +3915,13 @@ class TestReplaceSubnetRoutingTable():
Test Class for replace_subnet_routing_table
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_replace_subnet_routing_table_all_params(self):
"""
replace_subnet_routing_table()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/routing_table')
+ url = preprocess_url('/subnets/testString/routing_table')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.PUT,
url,
@@ -4363,7 +3966,7 @@ def test_replace_subnet_routing_table_value_error(self):
test_replace_subnet_routing_table_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/routing_table')
+ url = preprocess_url('/subnets/testString/routing_table')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "is_default": true, "lifecycle_state": "stable", "name": "my-routing-table-1", "resource_type": "routing_table", "route_direct_link_ingress": false, "route_transit_gateway_ingress": false, "route_vpc_zone_ingress": true, "routes": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531", "id": "1a15dca5-7e33-45e1-b7c5-bc690e569531", "name": "my-route-1"}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.PUT,
url,
@@ -4404,24 +4007,13 @@ class TestListSubnetReservedIps():
Test Class for list_subnet_reserved_ips
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_subnet_reserved_ips_all_params(self):
"""
list_subnet_reserved_ips()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips')
+ url = preprocess_url('/subnets/testString/reserved_ips')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -4469,7 +4061,7 @@ def test_list_subnet_reserved_ips_required_params(self):
test_list_subnet_reserved_ips_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips')
+ url = preprocess_url('/subnets/testString/reserved_ips')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -4505,7 +4097,7 @@ def test_list_subnet_reserved_ips_value_error(self):
test_list_subnet_reserved_ips_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips')
+ url = preprocess_url('/subnets/testString/reserved_ips')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "reserved_ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -4540,24 +4132,13 @@ class TestCreateSubnetReservedIp():
Test Class for create_subnet_reserved_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_subnet_reserved_ip_all_params(self):
"""
create_subnet_reserved_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips')
+ url = preprocess_url('/subnets/testString/reserved_ips')
mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
responses.add(responses.POST,
url,
@@ -4608,7 +4189,7 @@ def test_create_subnet_reserved_ip_value_error(self):
test_create_subnet_reserved_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips')
+ url = preprocess_url('/subnets/testString/reserved_ips')
mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
responses.add(responses.POST,
url,
@@ -4650,24 +4231,13 @@ class TestDeleteSubnetReservedIp():
Test Class for delete_subnet_reserved_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_subnet_reserved_ip_all_params(self):
"""
delete_subnet_reserved_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString')
+ url = preprocess_url('/subnets/testString/reserved_ips/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -4702,7 +4272,7 @@ def test_delete_subnet_reserved_ip_value_error(self):
test_delete_subnet_reserved_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString')
+ url = preprocess_url('/subnets/testString/reserved_ips/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -4736,24 +4306,13 @@ class TestGetSubnetReservedIp():
Test Class for get_subnet_reserved_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_subnet_reserved_ip_all_params(self):
"""
get_subnet_reserved_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString')
+ url = preprocess_url('/subnets/testString/reserved_ips/testString')
mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
responses.add(responses.GET,
url,
@@ -4791,7 +4350,7 @@ def test_get_subnet_reserved_ip_value_error(self):
test_get_subnet_reserved_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString')
+ url = preprocess_url('/subnets/testString/reserved_ips/testString')
mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
responses.add(responses.GET,
url,
@@ -4828,24 +4387,13 @@ class TestUpdateSubnetReservedIp():
Test Class for update_subnet_reserved_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_subnet_reserved_ip_all_params(self):
"""
update_subnet_reserved_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString')
+ url = preprocess_url('/subnets/testString/reserved_ips/testString')
mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
responses.add(responses.PATCH,
url,
@@ -4893,7 +4441,7 @@ def test_update_subnet_reserved_ip_value_error(self):
test_update_subnet_reserved_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/subnets/testString/reserved_ips/testString')
+ url = preprocess_url('/subnets/testString/reserved_ips/testString')
mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
responses.add(responses.PATCH,
url,
@@ -4968,8 +4516,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -4983,24 +4539,13 @@ class TestListImages():
Test Class for list_images
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_images_all_params(self):
"""
list_images()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images')
+ url = preprocess_url('/images')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}'
responses.add(responses.GET,
url,
@@ -5052,7 +4597,7 @@ def test_list_images_required_params(self):
test_list_images_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images')
+ url = preprocess_url('/images')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}'
responses.add(responses.GET,
url,
@@ -5083,7 +4628,7 @@ def test_list_images_value_error(self):
test_list_images_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images')
+ url = preprocess_url('/images')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?limit=20"}, "images": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}}'
responses.add(responses.GET,
url,
@@ -5114,24 +4659,13 @@ class TestCreateImage():
Test Class for create_image
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_image_all_params(self):
"""
create_image()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images')
+ url = preprocess_url('/images')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}'
responses.add(responses.POST,
url,
@@ -5195,7 +4729,7 @@ def test_create_image_value_error(self):
test_create_image_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images')
+ url = preprocess_url('/images')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}'
responses.add(responses.POST,
url,
@@ -5255,24 +4789,13 @@ class TestDeleteImage():
Test Class for delete_image
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_image_all_params(self):
"""
delete_image()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images/testString')
+ url = preprocess_url('/images/testString')
responses.add(responses.DELETE,
url,
status=202)
@@ -5305,7 +4828,7 @@ def test_delete_image_value_error(self):
test_delete_image_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images/testString')
+ url = preprocess_url('/images/testString')
responses.add(responses.DELETE,
url,
status=202)
@@ -5337,24 +4860,13 @@ class TestGetImage():
Test Class for get_image
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_image_all_params(self):
"""
get_image()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images/testString')
+ url = preprocess_url('/images/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}'
responses.add(responses.GET,
url,
@@ -5390,7 +4902,7 @@ def test_get_image_value_error(self):
test_get_image_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images/testString')
+ url = preprocess_url('/images/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}'
responses.add(responses.GET,
url,
@@ -5425,24 +4937,13 @@ class TestUpdateImage():
Test Class for update_image
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_image_all_params(self):
"""
update_image()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images/testString')
+ url = preprocess_url('/images/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}'
responses.add(responses.PATCH,
url,
@@ -5487,7 +4988,7 @@ def test_update_image_value_error(self):
test_update_image_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/images/testString')
+ url = preprocess_url('/images/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "encryption": "user_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "file": {"checksums": {"sha256": "e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15"}, "size": 1}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "minimum_provisioned_size": 24, "name": "my-image", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "visibility": "private"}'
responses.add(responses.PATCH,
url,
@@ -5528,24 +5029,13 @@ class TestListOperatingSystems():
Test Class for list_operating_systems
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_operating_systems_all_params(self):
"""
list_operating_systems()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/operating_systems')
+ url = preprocess_url('/operating_systems')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"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"}]}'
responses.add(responses.GET,
url,
@@ -5588,7 +5078,7 @@ def test_list_operating_systems_required_params(self):
test_list_operating_systems_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/operating_systems')
+ url = preprocess_url('/operating_systems')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"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"}]}'
responses.add(responses.GET,
url,
@@ -5619,7 +5109,7 @@ def test_list_operating_systems_value_error(self):
test_list_operating_systems_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/operating_systems')
+ url = preprocess_url('/operating_systems')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "operating_systems": [{"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"}]}'
responses.add(responses.GET,
url,
@@ -5650,24 +5140,13 @@ class TestGetOperatingSystem():
Test Class for get_operating_system
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_operating_system_all_params(self):
"""
get_operating_system()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/operating_systems/testString')
+ url = preprocess_url('/operating_systems/testString')
mock_response = '{"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"}'
responses.add(responses.GET,
url,
@@ -5703,7 +5182,7 @@ def test_get_operating_system_value_error(self):
test_get_operating_system_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/operating_systems/testString')
+ url = preprocess_url('/operating_systems/testString')
mock_response = '{"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"}'
responses.add(responses.GET,
url,
@@ -5769,8 +5248,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -5784,24 +5271,13 @@ class TestListKeys():
Test Class for list_keys
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_keys_all_params(self):
"""
list_keys()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys')
+ url = preprocess_url('/keys')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -5844,7 +5320,7 @@ def test_list_keys_required_params(self):
test_list_keys_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys')
+ url = preprocess_url('/keys')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -5875,7 +5351,7 @@ def test_list_keys_value_error(self):
test_list_keys_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys')
+ url = preprocess_url('/keys')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20"}, "keys": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -5906,24 +5382,13 @@ class TestCreateKey():
Test Class for create_key
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_key_all_params(self):
"""
create_key()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys')
+ url = preprocess_url('/keys')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}'
responses.add(responses.POST,
url,
@@ -5975,7 +5440,7 @@ def test_create_key_value_error(self):
test_create_key_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys')
+ url = preprocess_url('/keys')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}'
responses.add(responses.POST,
url,
@@ -6017,24 +5482,13 @@ class TestDeleteKey():
Test Class for delete_key
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_key_all_params(self):
"""
delete_key()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys/testString')
+ url = preprocess_url('/keys/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -6067,7 +5521,7 @@ def test_delete_key_value_error(self):
test_delete_key_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys/testString')
+ url = preprocess_url('/keys/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -6099,24 +5553,13 @@ class TestGetKey():
Test Class for get_key
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_key_all_params(self):
"""
get_key()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys/testString')
+ url = preprocess_url('/keys/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}'
responses.add(responses.GET,
url,
@@ -6152,7 +5595,7 @@ def test_get_key_value_error(self):
test_get_key_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys/testString')
+ url = preprocess_url('/keys/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}'
responses.add(responses.GET,
url,
@@ -6187,24 +5630,13 @@ class TestUpdateKey():
Test Class for update_key
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_key_all_params(self):
"""
update_key()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys/testString')
+ url = preprocess_url('/keys/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}'
responses.add(responses.PATCH,
url,
@@ -6249,7 +5681,7 @@ def test_update_key_value_error(self):
test_update_key_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/keys/testString')
+ url = preprocess_url('/keys/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "length": 2048, "name": "my-key", "public_key": "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "type": "rsa"}'
responses.add(responses.PATCH,
url,
@@ -6321,8 +5753,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -6336,24 +5776,13 @@ class TestListInstanceProfiles():
Test Class for list_instance_profiles
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_profiles_all_params(self):
"""
list_instance_profiles()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/profiles')
+ url = preprocess_url('/instance/profiles')
mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}'
responses.add(responses.GET,
url,
@@ -6384,7 +5813,7 @@ def test_list_instance_profiles_value_error(self):
test_list_instance_profiles_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/profiles')
+ url = preprocess_url('/instance/profiles')
mock_response = '{"profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}]}'
responses.add(responses.GET,
url,
@@ -6415,24 +5844,13 @@ class TestGetInstanceProfile():
Test Class for get_instance_profile
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_profile_all_params(self):
"""
get_instance_profile()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/profiles/testString')
+ url = preprocess_url('/instance/profiles/testString')
mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}'
responses.add(responses.GET,
url,
@@ -6468,7 +5886,7 @@ def test_get_instance_profile_value_error(self):
test_get_instance_profile_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/profiles/testString')
+ url = preprocess_url('/instance/profiles/testString')
mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "gpu_count": {"type": "fixed", "value": 2}, "gpu_manufacturer": {"type": "enum", "values": ["nvidia"]}, "gpu_memory": {"type": "fixed", "value": 16}, "gpu_model": {"type": "enum", "values": ["Tesla V100"]}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "memory": {"type": "fixed", "value": 16}, "name": "bc1-4x16", "os_architecture": {"default": "default", "type": "enum", "values": ["amd64"]}, "port_speed": {"type": "fixed", "value": 1000}, "total_volume_bandwidth": {"type": "fixed", "value": 20000}, "vcpu_architecture": {"default": "default", "type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}'
responses.add(responses.GET,
url,
@@ -6503,24 +5921,13 @@ class TestListInstanceTemplates():
Test Class for list_instance_templates
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_templates_all_params(self):
"""
list_instance_templates()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates')
+ url = preprocess_url('/instance/templates')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -6551,7 +5958,7 @@ def test_list_instance_templates_value_error(self):
test_list_instance_templates_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates')
+ url = preprocess_url('/instance/templates')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "templates": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -6582,24 +5989,13 @@ class TestCreateInstanceTemplate():
Test Class for create_instance_template
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_template_all_params(self):
"""
create_instance_template()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates')
+ url = preprocess_url('/instance/templates')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -6731,7 +6127,7 @@ def test_create_instance_template_value_error(self):
test_create_instance_template_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates')
+ url = preprocess_url('/instance/templates')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -6859,24 +6255,13 @@ class TestDeleteInstanceTemplate():
Test Class for delete_instance_template
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_template_all_params(self):
"""
delete_instance_template()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates/testString')
+ url = preprocess_url('/instance/templates/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -6909,7 +6294,7 @@ def test_delete_instance_template_value_error(self):
test_delete_instance_template_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates/testString')
+ url = preprocess_url('/instance/templates/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -6941,24 +6326,13 @@ class TestGetInstanceTemplate():
Test Class for get_instance_template
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_template_all_params(self):
"""
get_instance_template()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates/testString')
+ url = preprocess_url('/instance/templates/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -6994,7 +6368,7 @@ def test_get_instance_template_value_error(self):
test_get_instance_template_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates/testString')
+ url = preprocess_url('/instance/templates/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -7029,24 +6403,13 @@ class TestUpdateInstanceTemplate():
Test Class for update_instance_template
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_template_all_params(self):
"""
update_instance_template()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates/testString')
+ url = preprocess_url('/instance/templates/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -7091,7 +6454,7 @@ def test_update_instance_template_value_error(self):
test_update_instance_template_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance/templates/testString')
+ url = preprocess_url('/instance/templates/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "keys": [{"id": "a6b1a881-2ce8-41a3-80fc-36316a73f803"}], "name": "my-instance-template", "network_interfaces": [{"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}], "placement_target": {"id": "1e09281b-f177-46fb-baf1-bc152b2e391a"}, "profile": {"name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "total_volume_bandwidth": 500, "user_data": "user_data", "volume_attachments": [{"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5"}}], "vpc": {"id": "4727d842-f94f-4a2d-824a-9bc9b02c523b"}, "boot_volume_attachment": {"delete_volume_on_instance_delete": true, "name": "my-volume-attachment", "volume": {"capacity": 8, "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "iops": 10000, "name": "my-volume", "profile": {"name": "general-purpose"}}}, "image": {"id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8"}, "primary_network_interface": {"allow_ip_spoofing": true, "name": "my-network-interface", "primary_ipv4_address": "10.0.0.5", "security_groups": [{"id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271"}], "subnet": {"id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e"}}, "zone": {"name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -7132,24 +6495,13 @@ class TestListInstances():
Test Class for list_instances
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instances_all_params(self):
"""
list_instances()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances')
+ url = preprocess_url('/instances')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -7225,7 +6577,7 @@ def test_list_instances_required_params(self):
test_list_instances_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances')
+ url = preprocess_url('/instances')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -7256,7 +6608,7 @@ def test_list_instances_value_error(self):
test_list_instances_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances')
+ url = preprocess_url('/instances')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20"}, "instances": [{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -7287,24 +6639,13 @@ class TestCreateInstance():
Test Class for create_instance
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_all_params(self):
"""
create_instance()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances')
+ url = preprocess_url('/instances')
mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -7440,7 +6781,7 @@ def test_create_instance_value_error(self):
test_create_instance_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances')
+ url = preprocess_url('/instances')
mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -7572,24 +6913,13 @@ class TestDeleteInstance():
Test Class for delete_instance
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_all_params(self):
"""
delete_instance()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString')
+ url = preprocess_url('/instances/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -7622,7 +6952,7 @@ def test_delete_instance_value_error(self):
test_delete_instance_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString')
+ url = preprocess_url('/instances/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -7654,24 +6984,13 @@ class TestGetInstance():
Test Class for get_instance
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_all_params(self):
"""
get_instance()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString')
+ url = preprocess_url('/instances/testString')
mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -7707,7 +7026,7 @@ def test_get_instance_value_error(self):
test_get_instance_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString')
+ url = preprocess_url('/instances/testString')
mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -7742,24 +7061,13 @@ class TestUpdateInstance():
Test Class for update_instance
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_all_params(self):
"""
update_instance()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString')
+ url = preprocess_url('/instances/testString')
mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -7767,6 +7075,10 @@ def test_update_instance_all_params(self):
content_type='application/json',
status=200)
+ # Construct a dict representation of a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById model
+ instance_placement_target_patch_model = {}
+ instance_placement_target_patch_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
# Construct a dict representation of a InstancePatchProfileInstanceProfileIdentityByName model
instance_patch_profile_model = {}
instance_patch_profile_model['name'] = 'bc1-4x16'
@@ -7774,6 +7086,7 @@ def test_update_instance_all_params(self):
# Construct a dict representation of a InstancePatch model
instance_patch_model = {}
instance_patch_model['name'] = 'my-instance'
+ instance_patch_model['placement_target'] = instance_placement_target_patch_model
instance_patch_model['profile'] = instance_patch_profile_model
instance_patch_model['total_volume_bandwidth'] = 500
@@ -7810,7 +7123,7 @@ def test_update_instance_value_error(self):
test_update_instance_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString')
+ url = preprocess_url('/instances/testString')
mock_response = '{"bandwidth": 1000, "boot_volume_attachment": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "dedicated_host": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}, "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}], "gpu": {"count": 1, "manufacturer": "nvidia", "memory": 1, "model": "Tesla V100"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "memory": 8, "name": "my-instance", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "placement_target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "startable": false, "status": "deleting", "status_reasons": [{"code": "cannot_start_storage", "message": "The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "total_network_bandwidth": 500, "total_volume_bandwidth": 500, "vcpu": {"architecture": "amd64", "count": 4}, "volume_attachments": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -7818,6 +7131,10 @@ def test_update_instance_value_error(self):
content_type='application/json',
status=200)
+ # Construct a dict representation of a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById model
+ instance_placement_target_patch_model = {}
+ instance_placement_target_patch_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
# Construct a dict representation of a InstancePatchProfileInstanceProfileIdentityByName model
instance_patch_profile_model = {}
instance_patch_profile_model['name'] = 'bc1-4x16'
@@ -7825,6 +7142,7 @@ def test_update_instance_value_error(self):
# Construct a dict representation of a InstancePatch model
instance_patch_model = {}
instance_patch_model['name'] = 'my-instance'
+ instance_patch_model['placement_target'] = instance_placement_target_patch_model
instance_patch_model['profile'] = instance_patch_profile_model
instance_patch_model['total_volume_bandwidth'] = 500
@@ -7857,24 +7175,13 @@ class TestGetInstanceInitialization():
Test Class for get_instance_initialization
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_initialization_all_params(self):
"""
get_instance_initialization()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/initialization')
+ url = preprocess_url('/instances/testString/initialization')
mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}'
responses.add(responses.GET,
url,
@@ -7910,7 +7217,7 @@ def test_get_instance_initialization_value_error(self):
test_get_instance_initialization_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/initialization')
+ url = preprocess_url('/instances/testString/initialization')
mock_response = '{"keys": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY", "href": "https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-key"}], "password": {"encrypted_password": "VGhpcyBpcyBhbiBlbmNvZGVkIGJ5dGUgYXJyYXku", "encryption_key": {"fingerprint": "SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY"}}}'
responses.add(responses.GET,
url,
@@ -7945,24 +7252,13 @@ class TestCreateInstanceAction():
Test Class for create_instance_action
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_action_all_params(self):
"""
create_instance_action()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/actions')
+ url = preprocess_url('/instances/testString/actions')
mock_response = '{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}'
responses.add(responses.POST,
url,
@@ -8006,7 +7302,7 @@ def test_create_instance_action_value_error(self):
test_create_instance_action_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/actions')
+ url = preprocess_url('/instances/testString/actions')
mock_response = '{"completed_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "force": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed", "id": "109a1b6e-1242-4de1-be44-38705e9474ed", "started_at": "2019-01-01T12:00:00.000Z", "status": "completed", "type": "reboot"}'
responses.add(responses.POST,
url,
@@ -8044,24 +7340,13 @@ class TestCreateInstanceConsoleAccessToken():
Test Class for create_instance_console_access_token
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_console_access_token_all_params(self):
"""
create_instance_console_access_token()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/console_access_token')
+ url = preprocess_url('/instances/testString/console_access_token')
mock_response = '{"access_token": "VGhpcyBJcyBhIHRva2Vu", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu"}'
responses.add(responses.POST,
url,
@@ -8105,7 +7390,7 @@ def test_create_instance_console_access_token_value_error(self):
test_create_instance_console_access_token_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/console_access_token')
+ url = preprocess_url('/instances/testString/console_access_token')
mock_response = '{"access_token": "VGhpcyBJcyBhIHRva2Vu", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu"}'
responses.add(responses.POST,
url,
@@ -8143,24 +7428,13 @@ class TestListInstanceDisks():
Test Class for list_instance_disks
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_disks_all_params(self):
"""
list_instance_disks()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/disks')
+ url = preprocess_url('/instances/testString/disks')
mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}'
responses.add(responses.GET,
url,
@@ -8196,7 +7470,7 @@ def test_list_instance_disks_value_error(self):
test_list_instance_disks_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/disks')
+ url = preprocess_url('/instances/testString/disks')
mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}]}'
responses.add(responses.GET,
url,
@@ -8231,24 +7505,13 @@ class TestGetInstanceDisk():
Test Class for get_instance_disk
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_disk_all_params(self):
"""
get_instance_disk()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/disks/testString')
+ url = preprocess_url('/instances/testString/disks/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}'
responses.add(responses.GET,
url,
@@ -8286,7 +7549,7 @@ def test_get_instance_disk_value_error(self):
test_get_instance_disk_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/disks/testString')
+ url = preprocess_url('/instances/testString/disks/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}'
responses.add(responses.GET,
url,
@@ -8323,24 +7586,13 @@ class TestUpdateInstanceDisk():
Test Class for update_instance_disk
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_disk_all_params(self):
"""
update_instance_disk()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/disks/testString')
+ url = preprocess_url('/instances/testString/disks/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}'
responses.add(responses.PATCH,
url,
@@ -8387,7 +7639,7 @@ def test_update_instance_disk_value_error(self):
test_update_instance_disk_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/disks/testString')
+ url = preprocess_url('/instances/testString/disks/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-instance-disk", "resource_type": "instance_disk", "size": 100}'
responses.add(responses.PATCH,
url,
@@ -8430,24 +7682,13 @@ class TestListInstanceNetworkInterfaces():
Test Class for list_instance_network_interfaces
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_network_interfaces_all_params(self):
"""
list_instance_network_interfaces()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces')
+ url = preprocess_url('/instances/testString/network_interfaces')
mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}]}'
responses.add(responses.GET,
url,
@@ -8483,7 +7724,7 @@ def test_list_instance_network_interfaces_value_error(self):
test_list_instance_network_interfaces_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces')
+ url = preprocess_url('/instances/testString/network_interfaces')
mock_response = '{"network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}]}'
responses.add(responses.GET,
url,
@@ -8518,24 +7759,13 @@ class TestCreateInstanceNetworkInterface():
Test Class for create_instance_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_network_interface_all_params(self):
"""
create_instance_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces')
+ url = preprocess_url('/instances/testString/network_interfaces')
mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
responses.add(responses.POST,
url,
@@ -8596,7 +7826,7 @@ def test_create_instance_network_interface_value_error(self):
test_create_instance_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces')
+ url = preprocess_url('/instances/testString/network_interfaces')
mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
responses.add(responses.POST,
url,
@@ -8645,24 +7875,13 @@ class TestDeleteInstanceNetworkInterface():
Test Class for delete_instance_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_network_interface_all_params(self):
"""
delete_instance_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -8697,7 +7916,7 @@ def test_delete_instance_network_interface_value_error(self):
test_delete_instance_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -8731,24 +7950,13 @@ class TestGetInstanceNetworkInterface():
Test Class for get_instance_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_network_interface_all_params(self):
"""
get_instance_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString')
mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
responses.add(responses.GET,
url,
@@ -8786,7 +7994,7 @@ def test_get_instance_network_interface_value_error(self):
test_get_instance_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString')
mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
responses.add(responses.GET,
url,
@@ -8823,24 +8031,13 @@ class TestUpdateInstanceNetworkInterface():
Test Class for update_instance_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_network_interface_all_params(self):
"""
update_instance_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString')
mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
responses.add(responses.PATCH,
url,
@@ -8888,7 +8085,7 @@ def test_update_instance_network_interface_value_error(self):
test_update_instance_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString')
mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
responses.add(responses.PATCH,
url,
@@ -8932,24 +8129,13 @@ class TestListInstanceNetworkInterfaceFloatingIps():
Test Class for list_instance_network_interface_floating_ips
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_network_interface_floating_ips_all_params(self):
"""
list_instance_network_interface_floating_ips()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips')
+ url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips')
mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(responses.GET,
url,
@@ -8987,7 +8173,7 @@ def test_list_instance_network_interface_floating_ips_value_error(self):
test_list_instance_network_interface_floating_ips_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips')
+ url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips')
mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(responses.GET,
url,
@@ -9024,24 +8210,13 @@ class TestRemoveInstanceNetworkInterfaceFloatingIp():
Test Class for remove_instance_network_interface_floating_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_remove_instance_network_interface_floating_ip_all_params(self):
"""
remove_instance_network_interface_floating_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -9078,7 +8253,7 @@ def test_remove_instance_network_interface_floating_ip_value_error(self):
test_remove_instance_network_interface_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -9114,24 +8289,13 @@ class TestGetInstanceNetworkInterfaceFloatingIp():
Test Class for get_instance_network_interface_floating_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_network_interface_floating_ip_all_params(self):
"""
get_instance_network_interface_floating_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString')
mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -9171,7 +8335,7 @@ def test_get_instance_network_interface_floating_ip_value_error(self):
test_get_instance_network_interface_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString')
mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -9210,24 +8374,13 @@ class TestAddInstanceNetworkInterfaceFloatingIp():
Test Class for add_instance_network_interface_floating_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_add_instance_network_interface_floating_ip_all_params(self):
"""
add_instance_network_interface_floating_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString')
mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PUT,
url,
@@ -9267,7 +8420,7 @@ def test_add_instance_network_interface_floating_ip_value_error(self):
test_add_instance_network_interface_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/network_interfaces/testString/floating_ips/testString')
+ url = preprocess_url('/instances/testString/network_interfaces/testString/floating_ips/testString')
mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PUT,
url,
@@ -9306,24 +8459,13 @@ class TestListInstanceVolumeAttachments():
Test Class for list_instance_volume_attachments
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_volume_attachments_all_params(self):
"""
list_instance_volume_attachments()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments')
+ url = preprocess_url('/instances/testString/volume_attachments')
mock_response = '{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "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"}}]}'
responses.add(responses.GET,
url,
@@ -9359,7 +8501,7 @@ def test_list_instance_volume_attachments_value_error(self):
test_list_instance_volume_attachments_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments')
+ url = preprocess_url('/instances/testString/volume_attachments')
mock_response = '{"volume_attachments": [{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "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"}}]}'
responses.add(responses.GET,
url,
@@ -9394,24 +8536,13 @@ class TestCreateInstanceVolumeAttachment():
Test Class for create_instance_volume_attachment
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_volume_attachment_all_params(self):
"""
create_instance_volume_attachment()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments')
+ url = preprocess_url('/instances/testString/volume_attachments')
mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "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"}}'
responses.add(responses.POST,
url,
@@ -9462,7 +8593,7 @@ def test_create_instance_volume_attachment_value_error(self):
test_create_instance_volume_attachment_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments')
+ url = preprocess_url('/instances/testString/volume_attachments')
mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "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"}}'
responses.add(responses.POST,
url,
@@ -9505,24 +8636,13 @@ class TestDeleteInstanceVolumeAttachment():
Test Class for delete_instance_volume_attachment
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_volume_attachment_all_params(self):
"""
delete_instance_volume_attachment()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString')
+ url = preprocess_url('/instances/testString/volume_attachments/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -9557,7 +8677,7 @@ def test_delete_instance_volume_attachment_value_error(self):
test_delete_instance_volume_attachment_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString')
+ url = preprocess_url('/instances/testString/volume_attachments/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -9591,24 +8711,13 @@ class TestGetInstanceVolumeAttachment():
Test Class for get_instance_volume_attachment
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_volume_attachment_all_params(self):
"""
get_instance_volume_attachment()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString')
+ url = preprocess_url('/instances/testString/volume_attachments/testString')
mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "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"}}'
responses.add(responses.GET,
url,
@@ -9646,7 +8755,7 @@ def test_get_instance_volume_attachment_value_error(self):
test_get_instance_volume_attachment_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString')
+ url = preprocess_url('/instances/testString/volume_attachments/testString')
mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "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"}}'
responses.add(responses.GET,
url,
@@ -9683,24 +8792,13 @@ class TestUpdateInstanceVolumeAttachment():
Test Class for update_instance_volume_attachment
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_volume_attachment_all_params(self):
"""
update_instance_volume_attachment()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString')
+ url = preprocess_url('/instances/testString/volume_attachments/testString')
mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "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"}}'
responses.add(responses.PATCH,
url,
@@ -9748,7 +8846,7 @@ def test_update_instance_volume_attachment_value_error(self):
test_update_instance_volume_attachment_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instances/testString/volume_attachments/testString')
+ url = preprocess_url('/instances/testString/volume_attachments/testString')
mock_response = '{"bandwidth": 250, "created_at": "2019-01-01T12:00:00.000Z", "delete_volume_on_instance_delete": true, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "name": "my-volume-attachment", "status": "attached", "type": "boot", "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"}}'
responses.add(responses.PATCH,
url,
@@ -9823,8 +8921,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -9838,24 +8944,13 @@ class TestListInstanceGroups():
Test Class for list_instance_groups
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_groups_all_params(self):
"""
list_instance_groups()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups')
+ url = preprocess_url('/instance_groups')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -9898,7 +8993,7 @@ def test_list_instance_groups_required_params(self):
test_list_instance_groups_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups')
+ url = preprocess_url('/instance_groups')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -9929,7 +9024,7 @@ def test_list_instance_groups_value_error(self):
test_list_instance_groups_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups')
+ url = preprocess_url('/instance_groups')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20"}, "instance_groups": [{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -9960,24 +9055,13 @@ class TestCreateInstanceGroup():
Test Class for create_instance_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_group_all_params(self):
"""
create_instance_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups')
+ url = preprocess_url('/instance_groups')
mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.POST,
url,
@@ -10057,7 +9141,7 @@ def test_create_instance_group_value_error(self):
test_create_instance_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups')
+ url = preprocess_url('/instance_groups')
mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.POST,
url,
@@ -10120,24 +9204,13 @@ class TestDeleteInstanceGroup():
Test Class for delete_instance_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_group_all_params(self):
"""
delete_instance_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString')
+ url = preprocess_url('/instance_groups/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -10170,7 +9243,7 @@ def test_delete_instance_group_value_error(self):
test_delete_instance_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString')
+ url = preprocess_url('/instance_groups/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -10202,24 +9275,13 @@ class TestGetInstanceGroup():
Test Class for get_instance_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_group_all_params(self):
"""
get_instance_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString')
+ url = preprocess_url('/instance_groups/testString')
mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
@@ -10255,7 +9317,7 @@ def test_get_instance_group_value_error(self):
test_get_instance_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString')
+ url = preprocess_url('/instance_groups/testString')
mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
@@ -10290,24 +9352,13 @@ class TestUpdateInstanceGroup():
Test Class for update_instance_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_group_all_params(self):
"""
update_instance_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString')
+ url = preprocess_url('/instance_groups/testString')
mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.PATCH,
url,
@@ -10374,7 +9425,7 @@ def test_update_instance_group_value_error(self):
test_update_instance_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString')
+ url = preprocess_url('/instance_groups/testString')
mock_response = '{"application_port": 22, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "load_balancer_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "managers": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager"}], "membership_count": 10, "name": "my-instance-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "deleting", "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "updated_at": "2019-01-01T12:00:00.000Z", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.PATCH,
url,
@@ -10437,24 +9488,13 @@ class TestDeleteInstanceGroupLoadBalancer():
Test Class for delete_instance_group_load_balancer
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_group_load_balancer_all_params(self):
"""
delete_instance_group_load_balancer()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/load_balancer')
+ url = preprocess_url('/instance_groups/testString/load_balancer')
responses.add(responses.DELETE,
url,
status=204)
@@ -10487,7 +9527,7 @@ def test_delete_instance_group_load_balancer_value_error(self):
test_delete_instance_group_load_balancer_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/load_balancer')
+ url = preprocess_url('/instance_groups/testString/load_balancer')
responses.add(responses.DELETE,
url,
status=204)
@@ -10519,24 +9559,13 @@ class TestListInstanceGroupManagers():
Test Class for list_instance_group_managers
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_group_managers_all_params(self):
"""
list_instance_group_managers()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers')
+ url = preprocess_url('/instance_groups/testString/managers')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -10581,7 +9610,7 @@ def test_list_instance_group_managers_required_params(self):
test_list_instance_group_managers_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers')
+ url = preprocess_url('/instance_groups/testString/managers')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -10617,7 +9646,7 @@ def test_list_instance_group_managers_value_error(self):
test_list_instance_group_managers_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers')
+ url = preprocess_url('/instance_groups/testString/managers')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20"}, "limit": 20, "managers": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -10652,24 +9681,13 @@ class TestCreateInstanceGroupManager():
Test Class for create_instance_group_manager
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_group_manager_all_params(self):
"""
create_instance_group_manager()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers')
+ url = preprocess_url('/instance_groups/testString/managers')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}'
responses.add(responses.POST,
url,
@@ -10720,7 +9738,7 @@ def test_create_instance_group_manager_value_error(self):
test_create_instance_group_manager_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers')
+ url = preprocess_url('/instance_groups/testString/managers')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}'
responses.add(responses.POST,
url,
@@ -10767,24 +9785,13 @@ class TestDeleteInstanceGroupManager():
Test Class for delete_instance_group_manager
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_group_manager_all_params(self):
"""
delete_instance_group_manager()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -10819,7 +9826,7 @@ def test_delete_instance_group_manager_value_error(self):
test_delete_instance_group_manager_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -10853,24 +9860,13 @@ class TestGetInstanceGroupManager():
Test Class for get_instance_group_manager
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_group_manager_all_params(self):
"""
get_instance_group_manager()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}'
responses.add(responses.GET,
url,
@@ -10908,7 +9904,7 @@ def test_get_instance_group_manager_value_error(self):
test_get_instance_group_manager_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}'
responses.add(responses.GET,
url,
@@ -10945,24 +9941,13 @@ class TestUpdateInstanceGroupManager():
Test Class for update_instance_group_manager
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_group_manager_all_params(self):
"""
update_instance_group_manager()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}'
responses.add(responses.PATCH,
url,
@@ -11014,7 +9999,7 @@ def test_update_instance_group_manager_value_error(self):
test_update_instance_group_manager_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "management_enabled": true, "name": "my-instance-group-manager", "updated_at": "2019-01-01T12:00:00.000Z", "aggregation_window": 120, "cooldown": 210, "manager_type": "autoscale", "max_membership_count": 10, "min_membership_count": 10, "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy"}]}'
responses.add(responses.PATCH,
url,
@@ -11062,24 +10047,13 @@ class TestListInstanceGroupManagerActions():
Test Class for list_instance_group_manager_actions
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_group_manager_actions_all_params(self):
"""
list_instance_group_manager_actions()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions')
mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -11126,7 +10100,7 @@ def test_list_instance_group_manager_actions_required_params(self):
test_list_instance_group_manager_actions_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions')
mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -11164,7 +10138,7 @@ def test_list_instance_group_manager_actions_value_error(self):
test_list_instance_group_manager_actions_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions')
mock_response = '{"actions": [{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -11201,24 +10175,13 @@ class TestCreateInstanceGroupManagerAction():
Test Class for create_instance_group_manager_action
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_group_manager_action_all_params(self):
"""
create_instance_group_manager_action()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions')
mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}'
responses.add(responses.POST,
url,
@@ -11271,7 +10234,7 @@ def test_create_instance_group_manager_action_value_error(self):
test_create_instance_group_manager_action_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions')
mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}'
responses.add(responses.POST,
url,
@@ -11320,24 +10283,13 @@ class TestDeleteInstanceGroupManagerAction():
Test Class for delete_instance_group_manager_action
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_group_manager_action_all_params(self):
"""
delete_instance_group_manager_action()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -11374,7 +10326,7 @@ def test_delete_instance_group_manager_action_value_error(self):
test_delete_instance_group_manager_action_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -11410,24 +10362,13 @@ class TestGetInstanceGroupManagerAction():
Test Class for get_instance_group_manager_action
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_group_manager_action_all_params(self):
"""
get_instance_group_manager_action()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString')
mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}'
responses.add(responses.GET,
url,
@@ -11467,7 +10408,7 @@ def test_get_instance_group_manager_action_value_error(self):
test_get_instance_group_manager_action_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString')
mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}'
responses.add(responses.GET,
url,
@@ -11506,24 +10447,13 @@ class TestUpdateInstanceGroupManagerAction():
Test Class for update_instance_group_manager_action
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_group_manager_action_all_params(self):
"""
update_instance_group_manager_action()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString')
mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}'
responses.add(responses.PATCH,
url,
@@ -11585,7 +10515,7 @@ def test_update_instance_group_manager_action_value_error(self):
test_update_instance_group_manager_action_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/actions/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/actions/testString')
mock_response = '{"auto_delete": true, "auto_delete_timeout": 24, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-action", "resource_type": "instance_group_manager_action", "status": "active", "updated_at": "2019-01-01T12:00:00.000Z", "action_type": "scheduled", "cron_spec": "*/5 1,2,3 * * *", "last_applied_at": "2019-01-01T12:00:00.000Z", "next_run_at": "2019-01-01T12:00:00.000Z", "group": {"membership_count": 10}}'
responses.add(responses.PATCH,
url,
@@ -11643,24 +10573,13 @@ class TestListInstanceGroupManagerPolicies():
Test Class for list_instance_group_manager_policies
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_group_manager_policies_all_params(self):
"""
list_instance_group_manager_policies()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -11707,7 +10626,7 @@ def test_list_instance_group_manager_policies_required_params(self):
test_list_instance_group_manager_policies_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -11745,7 +10664,7 @@ def test_list_instance_group_manager_policies_value_error(self):
test_list_instance_group_manager_policies_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "policies": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -11782,24 +10701,13 @@ class TestCreateInstanceGroupManagerPolicy():
Test Class for create_instance_group_manager_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_instance_group_manager_policy_all_params(self):
"""
create_instance_group_manager_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}'
responses.add(responses.POST,
url,
@@ -11849,7 +10757,7 @@ def test_create_instance_group_manager_policy_value_error(self):
test_create_instance_group_manager_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}'
responses.add(responses.POST,
url,
@@ -11895,24 +10803,13 @@ class TestDeleteInstanceGroupManagerPolicy():
Test Class for delete_instance_group_manager_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_group_manager_policy_all_params(self):
"""
delete_instance_group_manager_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -11949,7 +10846,7 @@ def test_delete_instance_group_manager_policy_value_error(self):
test_delete_instance_group_manager_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -11985,24 +10882,13 @@ class TestGetInstanceGroupManagerPolicy():
Test Class for get_instance_group_manager_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_group_manager_policy_all_params(self):
"""
get_instance_group_manager_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}'
responses.add(responses.GET,
url,
@@ -12042,7 +10928,7 @@ def test_get_instance_group_manager_policy_value_error(self):
test_get_instance_group_manager_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}'
responses.add(responses.GET,
url,
@@ -12081,24 +10967,13 @@ class TestUpdateInstanceGroupManagerPolicy():
Test Class for update_instance_group_manager_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_group_manager_policy_all_params(self):
"""
update_instance_group_manager_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}'
responses.add(responses.PATCH,
url,
@@ -12149,7 +11024,7 @@ def test_update_instance_group_manager_policy_value_error(self):
test_update_instance_group_manager_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/managers/testString/policies/testString')
+ url = preprocess_url('/instance_groups/testString/managers/testString/policies/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group-manager-policy", "updated_at": "2019-01-01T12:00:00.000Z", "metric_type": "cpu", "metric_value": 12, "policy_type": "target"}'
responses.add(responses.PATCH,
url,
@@ -12196,24 +11071,13 @@ class TestDeleteInstanceGroupMemberships():
Test Class for delete_instance_group_memberships
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_group_memberships_all_params(self):
"""
delete_instance_group_memberships()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships')
+ url = preprocess_url('/instance_groups/testString/memberships')
responses.add(responses.DELETE,
url,
status=204)
@@ -12246,7 +11110,7 @@ def test_delete_instance_group_memberships_value_error(self):
test_delete_instance_group_memberships_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships')
+ url = preprocess_url('/instance_groups/testString/memberships')
responses.add(responses.DELETE,
url,
status=204)
@@ -12278,24 +11142,13 @@ class TestListInstanceGroupMemberships():
Test Class for list_instance_group_memberships
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_instance_group_memberships_all_params(self):
"""
list_instance_group_memberships()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships')
+ url = preprocess_url('/instance_groups/testString/memberships')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -12340,7 +11193,7 @@ def test_list_instance_group_memberships_required_params(self):
test_list_instance_group_memberships_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships')
+ url = preprocess_url('/instance_groups/testString/memberships')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -12376,7 +11229,7 @@ def test_list_instance_group_memberships_value_error(self):
test_list_instance_group_memberships_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships')
+ url = preprocess_url('/instance_groups/testString/memberships')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20"}, "limit": 20, "memberships": [{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -12411,24 +11264,13 @@ class TestDeleteInstanceGroupMembership():
Test Class for delete_instance_group_membership
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_instance_group_membership_all_params(self):
"""
delete_instance_group_membership()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString')
+ url = preprocess_url('/instance_groups/testString/memberships/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -12463,7 +11305,7 @@ def test_delete_instance_group_membership_value_error(self):
test_delete_instance_group_membership_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString')
+ url = preprocess_url('/instance_groups/testString/memberships/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -12497,24 +11339,13 @@ class TestGetInstanceGroupMembership():
Test Class for get_instance_group_membership
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_instance_group_membership_all_params(self):
"""
get_instance_group_membership()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString')
+ url = preprocess_url('/instance_groups/testString/memberships/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}'
responses.add(responses.GET,
url,
@@ -12552,7 +11383,7 @@ def test_get_instance_group_membership_value_error(self):
test_get_instance_group_membership_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString')
+ url = preprocess_url('/instance_groups/testString/memberships/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}'
responses.add(responses.GET,
url,
@@ -12589,24 +11420,13 @@ class TestUpdateInstanceGroupMembership():
Test Class for update_instance_group_membership
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_instance_group_membership_all_params(self):
"""
update_instance_group_membership()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString')
+ url = preprocess_url('/instance_groups/testString/memberships/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}'
responses.add(responses.PATCH,
url,
@@ -12653,7 +11473,7 @@ def test_update_instance_group_membership_value_error(self):
test_update_instance_group_membership_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/instance_groups/testString/memberships/testString')
+ url = preprocess_url('/instance_groups/testString/memberships/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "delete_instance_on_membership_delete": true, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "instance_template": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "a6b1a881-2ce8-41a3-80fc-36316a73f803", "name": "my-instance-template"}, "name": "my-instance-group-membership", "pool_member": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "status": "deleting", "updated_at": "2019-01-01T12:00:00.000Z"}'
responses.add(responses.PATCH,
url,
@@ -12727,8 +11547,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -12742,24 +11570,13 @@ class TestListDedicatedHostGroups():
Test Class for list_dedicated_host_groups
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_dedicated_host_groups_all_params(self):
"""
list_dedicated_host_groups()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups')
+ url = preprocess_url('/dedicated_host/groups')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -12811,7 +11628,7 @@ def test_list_dedicated_host_groups_required_params(self):
test_list_dedicated_host_groups_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups')
+ url = preprocess_url('/dedicated_host/groups')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -12842,7 +11659,7 @@ def test_list_dedicated_host_groups_value_error(self):
test_list_dedicated_host_groups_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups')
+ url = preprocess_url('/dedicated_host/groups')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20"}, "groups": [{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -12873,24 +11690,13 @@ class TestCreateDedicatedHostGroup():
Test Class for create_dedicated_host_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_dedicated_host_group_all_params(self):
"""
create_dedicated_host_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups')
+ url = preprocess_url('/dedicated_host/groups')
mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -12949,7 +11755,7 @@ def test_create_dedicated_host_group_required_params(self):
test_create_dedicated_host_group_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups')
+ url = preprocess_url('/dedicated_host/groups')
mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -12980,7 +11786,7 @@ def test_create_dedicated_host_group_value_error(self):
test_create_dedicated_host_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups')
+ url = preprocess_url('/dedicated_host/groups')
mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -13011,24 +11817,13 @@ class TestDeleteDedicatedHostGroup():
Test Class for delete_dedicated_host_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_dedicated_host_group_all_params(self):
"""
delete_dedicated_host_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString')
+ url = preprocess_url('/dedicated_host/groups/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -13061,7 +11856,7 @@ def test_delete_dedicated_host_group_value_error(self):
test_delete_dedicated_host_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString')
+ url = preprocess_url('/dedicated_host/groups/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -13093,24 +11888,13 @@ class TestGetDedicatedHostGroup():
Test Class for get_dedicated_host_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_dedicated_host_group_all_params(self):
"""
get_dedicated_host_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString')
+ url = preprocess_url('/dedicated_host/groups/testString')
mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -13146,7 +11930,7 @@ def test_get_dedicated_host_group_value_error(self):
test_get_dedicated_host_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString')
+ url = preprocess_url('/dedicated_host/groups/testString')
mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -13181,24 +11965,13 @@ class TestUpdateDedicatedHostGroup():
Test Class for update_dedicated_host_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_dedicated_host_group_all_params(self):
"""
update_dedicated_host_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString')
+ url = preprocess_url('/dedicated_host/groups/testString')
mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -13243,7 +12016,7 @@ def test_update_dedicated_host_group_value_error(self):
test_update_dedicated_host_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/groups/testString')
+ url = preprocess_url('/dedicated_host/groups/testString')
mock_response = '{"class": "mx2", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "dedicated_hosts": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-host", "resource_type": "dedicated_host"}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host_group", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -13284,24 +12057,13 @@ class TestListDedicatedHostProfiles():
Test Class for list_dedicated_host_profiles
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_dedicated_host_profiles_all_params(self):
"""
list_dedicated_host_profiles()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/profiles')
+ url = preprocess_url('/dedicated_host/profiles')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -13344,7 +12106,7 @@ def test_list_dedicated_host_profiles_required_params(self):
test_list_dedicated_host_profiles_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/profiles')
+ url = preprocess_url('/dedicated_host/profiles')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -13375,7 +12137,7 @@ def test_list_dedicated_host_profiles_value_error(self):
test_list_dedicated_host_profiles_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/profiles')
+ url = preprocess_url('/dedicated_host/profiles')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20"}, "profiles": [{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -13406,24 +12168,13 @@ class TestGetDedicatedHostProfile():
Test Class for get_dedicated_host_profile
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_dedicated_host_profile_all_params(self):
"""
get_dedicated_host_profile()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/profiles/testString')
+ url = preprocess_url('/dedicated_host/profiles/testString')
mock_response = '{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}'
responses.add(responses.GET,
url,
@@ -13459,7 +12210,7 @@ def test_get_dedicated_host_profile_value_error(self):
test_get_dedicated_host_profile_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_host/profiles/testString')
+ url = preprocess_url('/dedicated_host/profiles/testString')
mock_response = '{"class": "mx2", "disks": [{"interface_type": {"type": "fixed", "value": "nvme"}, "quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 3200}, "supported_instance_interface_types": {"type": "fixed", "value": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": {"type": "fixed", "value": 16}, "name": "mx2-host-152x1216", "socket_count": {"type": "fixed", "value": 2}, "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu_architecture": {"type": "fixed", "value": "amd64"}, "vcpu_count": {"type": "fixed", "value": 16}}'
responses.add(responses.GET,
url,
@@ -13494,24 +12245,13 @@ class TestListDedicatedHosts():
Test Class for list_dedicated_hosts
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_dedicated_hosts_all_params(self):
"""
list_dedicated_hosts()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts')
+ url = preprocess_url('/dedicated_hosts')
mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -13566,7 +12306,7 @@ def test_list_dedicated_hosts_required_params(self):
test_list_dedicated_hosts_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts')
+ url = preprocess_url('/dedicated_hosts')
mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -13597,7 +12337,7 @@ def test_list_dedicated_hosts_value_error(self):
test_list_dedicated_hosts_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts')
+ url = preprocess_url('/dedicated_hosts')
mock_response = '{"dedicated_hosts": [{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
@@ -13628,24 +12368,13 @@ class TestCreateDedicatedHost():
Test Class for create_dedicated_host
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_dedicated_host_all_params(self):
"""
create_dedicated_host()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts')
+ url = preprocess_url('/dedicated_hosts')
mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -13704,7 +12433,7 @@ def test_create_dedicated_host_value_error(self):
test_create_dedicated_host_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts')
+ url = preprocess_url('/dedicated_hosts')
mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
@@ -13759,24 +12488,13 @@ class TestListDedicatedHostDisks():
Test Class for list_dedicated_host_disks
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_dedicated_host_disks_all_params(self):
"""
list_dedicated_host_disks()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks')
+ url = preprocess_url('/dedicated_hosts/testString/disks')
mock_response = '{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}]}'
responses.add(responses.GET,
url,
@@ -13812,7 +12530,7 @@ def test_list_dedicated_host_disks_value_error(self):
test_list_dedicated_host_disks_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks')
+ url = preprocess_url('/dedicated_hosts/testString/disks')
mock_response = '{"disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}]}'
responses.add(responses.GET,
url,
@@ -13847,24 +12565,13 @@ class TestGetDedicatedHostDisk():
Test Class for get_dedicated_host_disk
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_dedicated_host_disk_all_params(self):
"""
get_dedicated_host_disk()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks/testString')
+ url = preprocess_url('/dedicated_hosts/testString/disks/testString')
mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}'
responses.add(responses.GET,
url,
@@ -13902,7 +12609,7 @@ def test_get_dedicated_host_disk_value_error(self):
test_get_dedicated_host_disk_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks/testString')
+ url = preprocess_url('/dedicated_hosts/testString/disks/testString')
mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}'
responses.add(responses.GET,
url,
@@ -13939,24 +12646,13 @@ class TestUpdateDedicatedHostDisk():
Test Class for update_dedicated_host_disk
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_dedicated_host_disk_all_params(self):
"""
update_dedicated_host_disk()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks/testString')
+ url = preprocess_url('/dedicated_hosts/testString/disks/testString')
mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}'
responses.add(responses.PATCH,
url,
@@ -14003,7 +12699,7 @@ def test_update_dedicated_host_disk_value_error(self):
test_update_dedicated_host_disk_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString/disks/testString')
+ url = preprocess_url('/dedicated_hosts/testString/disks/testString')
mock_response = '{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}'
responses.add(responses.PATCH,
url,
@@ -14046,24 +12742,13 @@ class TestDeleteDedicatedHost():
Test Class for delete_dedicated_host
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_dedicated_host_all_params(self):
"""
delete_dedicated_host()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString')
+ url = preprocess_url('/dedicated_hosts/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -14096,7 +12781,7 @@ def test_delete_dedicated_host_value_error(self):
test_delete_dedicated_host_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString')
+ url = preprocess_url('/dedicated_hosts/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -14128,24 +12813,13 @@ class TestGetDedicatedHost():
Test Class for get_dedicated_host
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_dedicated_host_all_params(self):
"""
get_dedicated_host()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString')
+ url = preprocess_url('/dedicated_hosts/testString')
mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -14181,7 +12855,7 @@ def test_get_dedicated_host_value_error(self):
test_get_dedicated_host_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString')
+ url = preprocess_url('/dedicated_hosts/testString')
mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
@@ -14216,24 +12890,13 @@ class TestUpdateDedicatedHost():
Test Class for update_dedicated_host
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_dedicated_host_all_params(self):
"""
update_dedicated_host()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString')
+ url = preprocess_url('/dedicated_hosts/testString')
mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -14279,7 +12942,7 @@ def test_update_dedicated_host_value_error(self):
test_update_dedicated_host_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/dedicated_hosts/testString')
+ url = preprocess_url('/dedicated_hosts/testString')
mock_response = '{"available_memory": 128, "available_vcpu": {"architecture": "amd64", "count": 4}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"available": 9, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "instance_disks": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-instance-disk", "resource_type": "instance_disk"}], "interface_type": "nvme", "lifecycle_state": "stable", "name": "my-dedicated-host-disk", "provisionable": false, "resource_type": "dedicated_host_disk", "size": 4, "supported_instance_interface_types": ["nvme"]}], "group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "id": "bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0", "name": "my-host-group", "resource_type": "dedicated_host_group"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "instance_placement_enabled": true, "instances": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}], "lifecycle_state": "stable", "memory": 128, "name": "my-host", "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "mx2-host-152x1216"}, "provisionable": false, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "dedicated_host", "socket_count": 4, "state": "available", "supported_instance_profiles": [{"href": "https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16", "name": "bc1-4x16"}], "vcpu": {"architecture": "amd64", "count": 4}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
@@ -14352,8 +13015,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -14367,24 +13038,13 @@ class TestListPlacementGroups():
Test Class for list_placement_groups
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_list_placement_groups_all_params(self):
"""
list_placement_groups()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups')
+ url = preprocess_url('/placement_groups')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -14427,7 +13087,7 @@ def test_list_placement_groups_required_params(self):
test_list_placement_groups_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups')
+ url = preprocess_url('/placement_groups')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -14458,7 +13118,7 @@ def test_list_placement_groups_value_error(self):
test_list_placement_groups_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups')
+ url = preprocess_url('/placement_groups')
mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "placement_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}], "total_count": 132}'
responses.add(responses.GET,
url,
@@ -14489,24 +13149,13 @@ class TestCreatePlacementGroup():
Test Class for create_placement_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_create_placement_group_all_params(self):
"""
create_placement_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups')
+ url = preprocess_url('/placement_groups')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}'
responses.add(responses.POST,
url,
@@ -14555,7 +13204,7 @@ def test_create_placement_group_value_error(self):
test_create_placement_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups')
+ url = preprocess_url('/placement_groups')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}'
responses.add(responses.POST,
url,
@@ -14596,24 +13245,13 @@ class TestDeletePlacementGroup():
Test Class for delete_placement_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_delete_placement_group_all_params(self):
"""
delete_placement_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups/testString')
+ url = preprocess_url('/placement_groups/testString')
responses.add(responses.DELETE,
url,
status=202)
@@ -14646,7 +13284,7 @@ def test_delete_placement_group_value_error(self):
test_delete_placement_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups/testString')
+ url = preprocess_url('/placement_groups/testString')
responses.add(responses.DELETE,
url,
status=202)
@@ -14678,24 +13316,13 @@ class TestGetPlacementGroup():
Test Class for get_placement_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_get_placement_group_all_params(self):
"""
get_placement_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups/testString')
+ url = preprocess_url('/placement_groups/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}'
responses.add(responses.GET,
url,
@@ -14731,7 +13358,7 @@ def test_get_placement_group_value_error(self):
test_get_placement_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups/testString')
+ url = preprocess_url('/placement_groups/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}'
responses.add(responses.GET,
url,
@@ -14766,24 +13393,13 @@ class TestUpdatePlacementGroup():
Test Class for update_placement_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
def test_update_placement_group_all_params(self):
"""
update_placement_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups/testString')
+ url = preprocess_url('/placement_groups/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}'
responses.add(responses.PATCH,
url,
@@ -14828,7 +13444,7 @@ def test_update_placement_group_value_error(self):
test_update_placement_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/placement_groups/testString')
+ url = preprocess_url('/placement_groups/testString')
mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "href": "https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "id": "r018-418fe842-a3e9-47b9-a938-1aa5bd632871", "lifecycle_state": "stable", "name": "my-placement-group", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "placement_group", "strategy": "host_spread"}'
responses.add(responses.PATCH,
url,
@@ -14870,7 +13486,7 @@ def test_update_placement_group_value_error_with_retries(self):
##############################################################################
##############################################################################
-# Start of Service: Volumes
+# Start of Service: BareMetalServers
##############################################################################
# region
@@ -14900,8 +13516,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -14910,30 +13534,19 @@ def test_new_instance_required_param_none(self):
service = VpcV1.new_instance(
version=None,
)
-class TestListVolumeProfiles():
+class TestListBareMetalServerProfiles():
"""
- Test Class for list_volume_profiles
+ Test Class for list_bare_metal_server_profiles
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_volume_profiles_all_params(self):
+ def test_list_bare_metal_server_profiles_all_params(self):
"""
- list_volume_profiles()
+ list_bare_metal_server_profiles()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volume/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}], "total_count": 132}'
+ url = preprocess_url('/bare_metal_server/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -14945,7 +13558,7 @@ def test_list_volume_profiles_all_params(self):
limit = 1
# Invoke method
- response = _service.list_volume_profiles(
+ response = _service.list_bare_metal_server_profiles(
start=start,
limit=limit,
headers={}
@@ -14960,23 +13573,23 @@ def test_list_volume_profiles_all_params(self):
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
- def test_list_volume_profiles_all_params_with_retries(self):
- # Enable retries and run test_list_volume_profiles_all_params.
+ def test_list_bare_metal_server_profiles_all_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_profiles_all_params.
_service.enable_retries()
- self.test_list_volume_profiles_all_params()
+ self.test_list_bare_metal_server_profiles_all_params()
- # Disable retries and run test_list_volume_profiles_all_params.
+ # Disable retries and run test_list_bare_metal_server_profiles_all_params.
_service.disable_retries()
- self.test_list_volume_profiles_all_params()
+ self.test_list_bare_metal_server_profiles_all_params()
@responses.activate
- def test_list_volume_profiles_required_params(self):
+ def test_list_bare_metal_server_profiles_required_params(self):
"""
- test_list_volume_profiles_required_params()
+ test_list_bare_metal_server_profiles_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volume/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}], "total_count": 132}'
+ url = preprocess_url('/bare_metal_server/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -14984,30 +13597,30 @@ def test_list_volume_profiles_required_params(self):
status=200)
# Invoke method
- response = _service.list_volume_profiles()
+ response = _service.list_bare_metal_server_profiles()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_volume_profiles_required_params_with_retries(self):
- # Enable retries and run test_list_volume_profiles_required_params.
+ def test_list_bare_metal_server_profiles_required_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_profiles_required_params.
_service.enable_retries()
- self.test_list_volume_profiles_required_params()
+ self.test_list_bare_metal_server_profiles_required_params()
- # Disable retries and run test_list_volume_profiles_required_params.
+ # Disable retries and run test_list_bare_metal_server_profiles_required_params.
_service.disable_retries()
- self.test_list_volume_profiles_required_params()
+ self.test_list_bare_metal_server_profiles_required_params()
@responses.activate
- def test_list_volume_profiles_value_error(self):
+ def test_list_bare_metal_server_profiles_value_error(self):
"""
- test_list_volume_profiles_value_error()
+ test_list_bare_metal_server_profiles_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volume/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}], "total_count": 132}'
+ url = preprocess_url('/bare_metal_server/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -15020,42 +13633,31 @@ def test_list_volume_profiles_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_volume_profiles(**req_copy)
+ _service.list_bare_metal_server_profiles(**req_copy)
- def test_list_volume_profiles_value_error_with_retries(self):
- # Enable retries and run test_list_volume_profiles_value_error.
+ def test_list_bare_metal_server_profiles_value_error_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_profiles_value_error.
_service.enable_retries()
- self.test_list_volume_profiles_value_error()
+ self.test_list_bare_metal_server_profiles_value_error()
- # Disable retries and run test_list_volume_profiles_value_error.
+ # Disable retries and run test_list_bare_metal_server_profiles_value_error.
_service.disable_retries()
- self.test_list_volume_profiles_value_error()
+ self.test_list_bare_metal_server_profiles_value_error()
-class TestGetVolumeProfile():
+class TestGetBareMetalServerProfile():
"""
- Test Class for get_volume_profile
+ Test Class for get_bare_metal_server_profile
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_volume_profile_all_params(self):
+ def test_get_bare_metal_server_profile_all_params(self):
"""
- get_volume_profile()
+ get_bare_metal_server_profile()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volume/profiles/testString')
- mock_response = '{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}'
+ url = preprocess_url('/bare_metal_server/profiles/testString')
+ mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -15066,7 +13668,7 @@ def test_get_volume_profile_all_params(self):
name = 'testString'
# Invoke method
- response = _service.get_volume_profile(
+ response = _service.get_bare_metal_server_profile(
name,
headers={}
)
@@ -15075,23 +13677,23 @@ def test_get_volume_profile_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_volume_profile_all_params_with_retries(self):
- # Enable retries and run test_get_volume_profile_all_params.
+ def test_get_bare_metal_server_profile_all_params_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_profile_all_params.
_service.enable_retries()
- self.test_get_volume_profile_all_params()
+ self.test_get_bare_metal_server_profile_all_params()
- # Disable retries and run test_get_volume_profile_all_params.
+ # Disable retries and run test_get_bare_metal_server_profile_all_params.
_service.disable_retries()
- self.test_get_volume_profile_all_params()
+ self.test_get_bare_metal_server_profile_all_params()
@responses.activate
- def test_get_volume_profile_value_error(self):
+ def test_get_bare_metal_server_profile_value_error(self):
"""
- test_get_volume_profile_value_error()
+ test_get_bare_metal_server_profile_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volume/profiles/testString')
- mock_response = '{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}'
+ url = preprocess_url('/bare_metal_server/profiles/testString')
+ mock_response = '{"bandwidth": {"type": "fixed", "value": 20000}, "cpu_architecture": {"default": "amd64", "type": "fixed", "value": "amd64"}, "cpu_core_count": {"type": "fixed", "value": 80}, "cpu_socket_count": {"type": "fixed", "value": 4}, "disks": [{"quantity": {"type": "fixed", "value": 4}, "size": {"type": "fixed", "value": 100}, "supported_interface_types": {"default": "nvme", "type": "enum", "values": ["nvme"]}}], "family": "balanced", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "memory": {"type": "fixed", "value": 16}, "name": "bx2-metal-192x768", "os_architecture": {"default": "amd64", "type": "enum", "values": ["amd64"]}, "resource_type": "bare_metal_server_profile", "supported_trusted_platform_module_modes": {"type": "enum", "values": ["tpm_2"]}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -15108,42 +13710,31 @@ def test_get_volume_profile_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_volume_profile(**req_copy)
+ _service.get_bare_metal_server_profile(**req_copy)
- def test_get_volume_profile_value_error_with_retries(self):
- # Enable retries and run test_get_volume_profile_value_error.
+ def test_get_bare_metal_server_profile_value_error_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_profile_value_error.
_service.enable_retries()
- self.test_get_volume_profile_value_error()
+ self.test_get_bare_metal_server_profile_value_error()
- # Disable retries and run test_get_volume_profile_value_error.
+ # Disable retries and run test_get_bare_metal_server_profile_value_error.
_service.disable_retries()
- self.test_get_volume_profile_value_error()
+ self.test_get_bare_metal_server_profile_value_error()
-class TestListVolumes():
+class TestListBareMetalServers():
"""
- Test Class for list_volumes
+ Test Class for list_bare_metal_servers
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_volumes_all_params(self):
+ def test_list_bare_metal_servers_all_params(self):
"""
- list_volumes()
+ list_bare_metal_servers()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "failed", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -15153,15 +13744,29 @@ def test_list_volumes_all_params(self):
# Set up parameter values
start = 'testString'
limit = 1
+ resource_group_id = 'testString'
name = 'testString'
- zone_name = 'testString'
+ vpc_id = 'testString'
+ vpc_crn = 'testString'
+ vpc_name = 'testString'
+ network_interfaces_subnet_id = 'testString'
+ network_interfaces_subnet_crn = 'testString'
+ network_interfaces_subnet_name = 'testString'
+ sort = 'name'
# Invoke method
- response = _service.list_volumes(
+ response = _service.list_bare_metal_servers(
start=start,
limit=limit,
+ resource_group_id=resource_group_id,
name=name,
- zone_name=zone_name,
+ vpc_id=vpc_id,
+ vpc_crn=vpc_crn,
+ vpc_name=vpc_name,
+ network_interfaces_subnet_id=network_interfaces_subnet_id,
+ network_interfaces_subnet_crn=network_interfaces_subnet_crn,
+ network_interfaces_subnet_name=network_interfaces_subnet_name,
+ sort=sort,
headers={}
)
@@ -15173,26 +13778,33 @@ def test_list_volumes_all_params(self):
query_string = urllib.parse.unquote_plus(query_string)
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
+ assert 'resource_group.id={}'.format(resource_group_id) in query_string
assert 'name={}'.format(name) in query_string
- assert 'zone.name={}'.format(zone_name) in query_string
+ assert 'vpc.id={}'.format(vpc_id) in query_string
+ assert 'vpc.crn={}'.format(vpc_crn) in query_string
+ assert 'vpc.name={}'.format(vpc_name) in query_string
+ assert 'network_interfaces.subnet.id={}'.format(network_interfaces_subnet_id) in query_string
+ assert 'network_interfaces.subnet.crn={}'.format(network_interfaces_subnet_crn) in query_string
+ assert 'network_interfaces.subnet.name={}'.format(network_interfaces_subnet_name) in query_string
+ assert 'sort={}'.format(sort) in query_string
- def test_list_volumes_all_params_with_retries(self):
- # Enable retries and run test_list_volumes_all_params.
+ def test_list_bare_metal_servers_all_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_servers_all_params.
_service.enable_retries()
- self.test_list_volumes_all_params()
+ self.test_list_bare_metal_servers_all_params()
- # Disable retries and run test_list_volumes_all_params.
+ # Disable retries and run test_list_bare_metal_servers_all_params.
_service.disable_retries()
- self.test_list_volumes_all_params()
+ self.test_list_bare_metal_servers_all_params()
@responses.activate
- def test_list_volumes_required_params(self):
+ def test_list_bare_metal_servers_required_params(self):
"""
- test_list_volumes_required_params()
+ test_list_bare_metal_servers_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "failed", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -15200,30 +13812,30 @@ def test_list_volumes_required_params(self):
status=200)
# Invoke method
- response = _service.list_volumes()
+ response = _service.list_bare_metal_servers()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_volumes_required_params_with_retries(self):
- # Enable retries and run test_list_volumes_required_params.
+ def test_list_bare_metal_servers_required_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_servers_required_params.
_service.enable_retries()
- self.test_list_volumes_required_params()
+ self.test_list_bare_metal_servers_required_params()
- # Disable retries and run test_list_volumes_required_params.
+ # Disable retries and run test_list_bare_metal_servers_required_params.
_service.disable_retries()
- self.test_list_volumes_required_params()
+ self.test_list_bare_metal_servers_required_params()
@responses.activate
- def test_list_volumes_value_error(self):
+ def test_list_bare_metal_servers_value_error(self):
"""
- test_list_volumes_value_error()
+ test_list_bare_metal_servers_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bare_metal_servers": [{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "failed", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -15236,80 +13848,118 @@ def test_list_volumes_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_volumes(**req_copy)
+ _service.list_bare_metal_servers(**req_copy)
- def test_list_volumes_value_error_with_retries(self):
- # Enable retries and run test_list_volumes_value_error.
+ def test_list_bare_metal_servers_value_error_with_retries(self):
+ # Enable retries and run test_list_bare_metal_servers_value_error.
_service.enable_retries()
- self.test_list_volumes_value_error()
+ self.test_list_bare_metal_servers_value_error()
- # Disable retries and run test_list_volumes_value_error.
+ # Disable retries and run test_list_bare_metal_servers_value_error.
_service.disable_retries()
- self.test_list_volumes_value_error()
+ self.test_list_bare_metal_servers_value_error()
-class TestCreateVolume():
+class TestCreateBareMetalServer():
"""
- Test Class for create_volume
+ Test Class for create_bare_metal_server
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_volume_all_params(self):
+ def test_create_bare_metal_server_all_params(self):
"""
- create_volume()
+ create_bare_metal_server()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes')
- mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "failed", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a VolumeProfileIdentityByName model
- volume_profile_identity_model = {}
- volume_profile_identity_model['name'] = '5iops-tier'
+ # Construct a dict representation of a ImageIdentityById model
+ image_identity_model = {}
+ image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a KeyIdentityById model
+ key_identity_model = {}
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ # Construct a dict representation of a BareMetalServerInitializationPrototype model
+ bare_metal_server_initialization_prototype_model = {}
+ bare_metal_server_initialization_prototype_model['image'] = image_identity_model
+ bare_metal_server_initialization_prototype_model['keys'] = [key_identity_model]
+ bare_metal_server_initialization_prototype_model['user_data'] = 'testString'
+
+ # Construct a dict representation of a 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 BareMetalServerPrimaryNetworkInterfacePrototype model
+ bare_metal_server_primary_network_interface_prototype_model = {}
+ bare_metal_server_primary_network_interface_prototype_model['allow_ip_spoofing'] = True
+ 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['primary_ipv4_address'] = '10.0.0.5'
+ 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
+
+ # Construct a dict representation of a BareMetalServerProfileIdentityByName model
+ bare_metal_server_profile_identity_model = {}
+ bare_metal_server_profile_identity_model['name'] = 'bx2-metal-192x768'
# Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
- # 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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model
+ bare_metal_server_network_interface_prototype_model = {}
+ bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan'
+ bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface'
+ bare_metal_server_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5'
+ bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_model['allow_interface_to_float'] = False
+ bare_metal_server_network_interface_prototype_model['vlan'] = 4
- # Construct a dict representation of a VolumePrototypeVolumeByCapacity model
- volume_prototype_model = {}
- volume_prototype_model['iops'] = 10000
- volume_prototype_model['name'] = 'my-volume'
- volume_prototype_model['profile'] = volume_profile_identity_model
- volume_prototype_model['resource_group'] = resource_group_identity_model
- volume_prototype_model['zone'] = zone_identity_model
- volume_prototype_model['capacity'] = 100
- volume_prototype_model['encryption_key'] = encryption_key_identity_model
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
# Set up parameter values
- volume_prototype = volume_prototype_model
+ initialization = bare_metal_server_initialization_prototype_model
+ primary_network_interface = bare_metal_server_primary_network_interface_prototype_model
+ profile = bare_metal_server_profile_identity_model
+ zone = zone_identity_model
+ name = 'my-bare-metal-server'
+ network_interfaces = [bare_metal_server_network_interface_prototype_model]
+ resource_group = resource_group_identity_model
+ vpc = vpc_identity_model
# Invoke method
- response = _service.create_volume(
- volume_prototype,
+ response = _service.create_bare_metal_server(
+ initialization,
+ primary_network_interface,
+ profile,
+ zone,
+ name=name,
+ network_interfaces=network_interfaces,
+ resource_group=resource_group,
+ vpc=vpc,
headers={}
)
@@ -15318,185 +13968,232 @@ def test_create_volume_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == volume_prototype
+ assert req_body['initialization'] == bare_metal_server_initialization_prototype_model
+ assert req_body['primary_network_interface'] == bare_metal_server_primary_network_interface_prototype_model
+ assert req_body['profile'] == bare_metal_server_profile_identity_model
+ assert req_body['zone'] == zone_identity_model
+ assert req_body['name'] == 'my-bare-metal-server'
+ assert req_body['network_interfaces'] == [bare_metal_server_network_interface_prototype_model]
+ assert req_body['resource_group'] == resource_group_identity_model
+ assert req_body['vpc'] == vpc_identity_model
- def test_create_volume_all_params_with_retries(self):
- # Enable retries and run test_create_volume_all_params.
+ def test_create_bare_metal_server_all_params_with_retries(self):
+ # Enable retries and run test_create_bare_metal_server_all_params.
_service.enable_retries()
- self.test_create_volume_all_params()
+ self.test_create_bare_metal_server_all_params()
- # Disable retries and run test_create_volume_all_params.
+ # Disable retries and run test_create_bare_metal_server_all_params.
_service.disable_retries()
- self.test_create_volume_all_params()
+ self.test_create_bare_metal_server_all_params()
@responses.activate
- def test_create_volume_value_error(self):
+ def test_create_bare_metal_server_value_error(self):
"""
- test_create_volume_value_error()
+ test_create_bare_metal_server_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes')
- mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "failed", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a VolumeProfileIdentityByName model
- volume_profile_identity_model = {}
- volume_profile_identity_model['name'] = '5iops-tier'
+ # Construct a dict representation of a ImageIdentityById model
+ image_identity_model = {}
+ image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a KeyIdentityById model
+ key_identity_model = {}
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ # Construct a dict representation of a BareMetalServerInitializationPrototype model
+ bare_metal_server_initialization_prototype_model = {}
+ bare_metal_server_initialization_prototype_model['image'] = image_identity_model
+ bare_metal_server_initialization_prototype_model['keys'] = [key_identity_model]
+ bare_metal_server_initialization_prototype_model['user_data'] = 'testString'
+
+ # Construct a dict representation of a 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 BareMetalServerPrimaryNetworkInterfacePrototype model
+ bare_metal_server_primary_network_interface_prototype_model = {}
+ bare_metal_server_primary_network_interface_prototype_model['allow_ip_spoofing'] = True
+ 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['primary_ipv4_address'] = '10.0.0.5'
+ 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
+
+ # Construct a dict representation of a BareMetalServerProfileIdentityByName model
+ bare_metal_server_profile_identity_model = {}
+ bare_metal_server_profile_identity_model['name'] = 'bx2-metal-192x768'
# Construct a dict representation of a ZoneIdentityByName model
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
- # 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 BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model
+ bare_metal_server_network_interface_prototype_model = {}
+ bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan'
+ bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface'
+ bare_metal_server_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5'
+ bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_model['allow_interface_to_float'] = False
+ bare_metal_server_network_interface_prototype_model['vlan'] = 4
- # Construct a dict representation of a VolumePrototypeVolumeByCapacity model
- volume_prototype_model = {}
- volume_prototype_model['iops'] = 10000
- volume_prototype_model['name'] = 'my-volume'
- volume_prototype_model['profile'] = volume_profile_identity_model
- volume_prototype_model['resource_group'] = resource_group_identity_model
- volume_prototype_model['zone'] = zone_identity_model
- volume_prototype_model['capacity'] = 100
- volume_prototype_model['encryption_key'] = encryption_key_identity_model
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
# Set up parameter values
- volume_prototype = volume_prototype_model
+ initialization = bare_metal_server_initialization_prototype_model
+ primary_network_interface = bare_metal_server_primary_network_interface_prototype_model
+ profile = bare_metal_server_profile_identity_model
+ zone = zone_identity_model
+ name = 'my-bare-metal-server'
+ network_interfaces = [bare_metal_server_network_interface_prototype_model]
+ resource_group = resource_group_identity_model
+ vpc = vpc_identity_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "volume_prototype": volume_prototype,
+ "initialization": initialization,
+ "primary_network_interface": primary_network_interface,
+ "profile": profile,
+ "zone": zone,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_volume(**req_copy)
+ _service.create_bare_metal_server(**req_copy)
- def test_create_volume_value_error_with_retries(self):
- # Enable retries and run test_create_volume_value_error.
+ def test_create_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_create_bare_metal_server_value_error.
_service.enable_retries()
- self.test_create_volume_value_error()
+ self.test_create_bare_metal_server_value_error()
- # Disable retries and run test_create_volume_value_error.
+ # Disable retries and run test_create_bare_metal_server_value_error.
_service.disable_retries()
- self.test_create_volume_value_error()
+ self.test_create_bare_metal_server_value_error()
-class TestDeleteVolume():
+class TestCreateBareMetalServerConsoleAccessToken():
"""
- Test Class for delete_volume
+ Test Class for create_bare_metal_server_console_access_token
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_volume_all_params(self):
+ def test_create_bare_metal_server_console_access_token_all_params(self):
"""
- delete_volume()
+ create_bare_metal_server_console_access_token()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/bare_metal_servers/testString/console_access_token')
+ mock_response = '{"access_token": "VGhpcyBJcyBhIHRva2Vu", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu"}'
+ responses.add(responses.POST,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- id = 'testString'
+ bare_metal_server_id = 'testString'
+ console_type = 'serial'
+ force = False
# Invoke method
- response = _service.delete_volume(
- id,
+ response = _service.create_bare_metal_server_console_access_token(
+ bare_metal_server_id,
+ console_type,
+ force=force,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['console_type'] == 'serial'
+ assert req_body['force'] == False
- def test_delete_volume_all_params_with_retries(self):
- # Enable retries and run test_delete_volume_all_params.
+ def test_create_bare_metal_server_console_access_token_all_params_with_retries(self):
+ # Enable retries and run test_create_bare_metal_server_console_access_token_all_params.
_service.enable_retries()
- self.test_delete_volume_all_params()
+ self.test_create_bare_metal_server_console_access_token_all_params()
- # Disable retries and run test_delete_volume_all_params.
+ # Disable retries and run test_create_bare_metal_server_console_access_token_all_params.
_service.disable_retries()
- self.test_delete_volume_all_params()
+ self.test_create_bare_metal_server_console_access_token_all_params()
@responses.activate
- def test_delete_volume_value_error(self):
+ def test_create_bare_metal_server_console_access_token_value_error(self):
"""
- test_delete_volume_value_error()
+ test_create_bare_metal_server_console_access_token_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/bare_metal_servers/testString/console_access_token')
+ mock_response = '{"access_token": "VGhpcyBJcyBhIHRva2Vu", "console_type": "serial", "created_at": "2020-07-27T21:50:14.000Z", "expires_at": "2020-07-27T21:51:14.000Z", "force": false, "href": "wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu"}'
+ responses.add(responses.POST,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- id = 'testString'
+ bare_metal_server_id = 'testString'
+ console_type = 'serial'
+ force = False
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
+ "bare_metal_server_id": bare_metal_server_id,
+ "console_type": console_type,
}
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_volume(**req_copy)
+ _service.create_bare_metal_server_console_access_token(**req_copy)
- def test_delete_volume_value_error_with_retries(self):
- # Enable retries and run test_delete_volume_value_error.
+ def test_create_bare_metal_server_console_access_token_value_error_with_retries(self):
+ # Enable retries and run test_create_bare_metal_server_console_access_token_value_error.
_service.enable_retries()
- self.test_delete_volume_value_error()
+ self.test_create_bare_metal_server_console_access_token_value_error()
- # Disable retries and run test_delete_volume_value_error.
+ # Disable retries and run test_create_bare_metal_server_console_access_token_value_error.
_service.disable_retries()
- self.test_delete_volume_value_error()
+ self.test_create_bare_metal_server_console_access_token_value_error()
-class TestGetVolume():
+class TestListBareMetalServerDisks():
"""
- Test Class for get_volume
+ Test Class for list_bare_metal_server_disks
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_volume_all_params(self):
+ def test_list_bare_metal_server_disks_all_params(self):
"""
- get_volume()
+ list_bare_metal_server_disks()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes/testString')
- mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/disks')
+ mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -15504,11 +14201,11 @@ def test_get_volume_all_params(self):
status=200)
# Set up parameter values
- id = 'testString'
+ bare_metal_server_id = 'testString'
# Invoke method
- response = _service.get_volume(
- id,
+ response = _service.list_bare_metal_server_disks(
+ bare_metal_server_id,
headers={}
)
@@ -15516,23 +14213,23 @@ def test_get_volume_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_volume_all_params_with_retries(self):
- # Enable retries and run test_get_volume_all_params.
+ def test_list_bare_metal_server_disks_all_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_disks_all_params.
_service.enable_retries()
- self.test_get_volume_all_params()
+ self.test_list_bare_metal_server_disks_all_params()
- # Disable retries and run test_get_volume_all_params.
+ # Disable retries and run test_list_bare_metal_server_disks_all_params.
_service.disable_retries()
- self.test_get_volume_all_params()
+ self.test_list_bare_metal_server_disks_all_params()
@responses.activate
- def test_get_volume_value_error(self):
+ def test_list_bare_metal_server_disks_value_error(self):
"""
- test_get_volume_value_error()
+ test_list_bare_metal_server_disks_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes/testString')
- mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/bare_metal_servers/testString/disks')
+ mock_response = '{"disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -15540,300 +14237,217 @@ def test_get_volume_value_error(self):
status=200)
# Set up parameter values
- id = 'testString'
+ bare_metal_server_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
+ "bare_metal_server_id": bare_metal_server_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_volume(**req_copy)
+ _service.list_bare_metal_server_disks(**req_copy)
- def test_get_volume_value_error_with_retries(self):
- # Enable retries and run test_get_volume_value_error.
+ def test_list_bare_metal_server_disks_value_error_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_disks_value_error.
_service.enable_retries()
- self.test_get_volume_value_error()
+ self.test_list_bare_metal_server_disks_value_error()
- # Disable retries and run test_get_volume_value_error.
+ # Disable retries and run test_list_bare_metal_server_disks_value_error.
_service.disable_retries()
- self.test_get_volume_value_error()
+ self.test_list_bare_metal_server_disks_value_error()
-class TestUpdateVolume():
+class TestGetBareMetalServerDisk():
"""
- Test Class for update_volume
+ Test Class for get_bare_metal_server_disk
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_volume_all_params(self):
+ def test_get_bare_metal_server_disk_all_params(self):
"""
- update_volume()
+ get_bare_metal_server_disk()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes/testString')
- mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/bare_metal_servers/testString/disks/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a VolumeProfileIdentityByName model
- volume_profile_identity_model = {}
- volume_profile_identity_model['name'] = 'general-purpose'
-
- # Construct a dict representation of a VolumePatch model
- volume_patch_model = {}
- volume_patch_model['capacity'] = 100
- volume_patch_model['iops'] = 10000
- volume_patch_model['name'] = 'my-volume'
- volume_patch_model['profile'] = volume_profile_identity_model
-
- # Set up parameter values
- id = 'testString'
- volume_patch = volume_patch_model
+ # Set up parameter values
+ bare_metal_server_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.update_volume(
+ response = _service.get_bare_metal_server_disk(
+ bare_metal_server_id,
id,
- volume_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == volume_patch
- def test_update_volume_all_params_with_retries(self):
- # Enable retries and run test_update_volume_all_params.
+ def test_get_bare_metal_server_disk_all_params_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_disk_all_params.
_service.enable_retries()
- self.test_update_volume_all_params()
+ self.test_get_bare_metal_server_disk_all_params()
- # Disable retries and run test_update_volume_all_params.
+ # Disable retries and run test_get_bare_metal_server_disk_all_params.
_service.disable_retries()
- self.test_update_volume_all_params()
+ self.test_get_bare_metal_server_disk_all_params()
@responses.activate
- def test_update_volume_value_error(self):
+ def test_get_bare_metal_server_disk_value_error(self):
"""
- test_update_volume_value_error()
+ test_get_bare_metal_server_disk_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/volumes/testString')
- mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/bare_metal_servers/testString/disks/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a VolumeProfileIdentityByName model
- volume_profile_identity_model = {}
- volume_profile_identity_model['name'] = 'general-purpose'
-
- # Construct a dict representation of a VolumePatch model
- volume_patch_model = {}
- volume_patch_model['capacity'] = 100
- volume_patch_model['iops'] = 10000
- volume_patch_model['name'] = 'my-volume'
- volume_patch_model['profile'] = volume_profile_identity_model
-
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
- volume_patch = volume_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "bare_metal_server_id": bare_metal_server_id,
"id": id,
- "volume_patch": volume_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_volume(**req_copy)
+ _service.get_bare_metal_server_disk(**req_copy)
- def test_update_volume_value_error_with_retries(self):
- # Enable retries and run test_update_volume_value_error.
+ def test_get_bare_metal_server_disk_value_error_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_disk_value_error.
_service.enable_retries()
- self.test_update_volume_value_error()
+ self.test_get_bare_metal_server_disk_value_error()
- # Disable retries and run test_update_volume_value_error.
+ # Disable retries and run test_get_bare_metal_server_disk_value_error.
_service.disable_retries()
- self.test_update_volume_value_error()
-
-# endregion
-##############################################################################
-# End of Service: Volumes
-##############################################################################
-
-##############################################################################
-# Start of Service: Snapshots
-##############################################################################
-# region
-
-class TestNewInstance():
- """
- Test Class for new_instance
- """
-
- def test_new_instance(self):
- """
- new_instance()
- """
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
+ self.test_get_bare_metal_server_disk_value_error()
- 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,
- )
-
- 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 TestDeleteSnapshots():
+class TestUpdateBareMetalServerDisk():
"""
- Test Class for delete_snapshots
+ Test Class for update_bare_metal_server_disk
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_snapshots_all_params(self):
+ def test_update_bare_metal_server_disk_all_params(self):
"""
- delete_snapshots()
+ update_bare_metal_server_disk()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots')
- responses.add(responses.DELETE,
+ url = preprocess_url('/bare_metal_servers/testString/disks/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
+ responses.add(responses.PATCH,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a BareMetalServerDiskPatch model
+ bare_metal_server_disk_patch_model = {}
+ bare_metal_server_disk_patch_model['name'] = 'my-bare-metal-server-disk-updated'
# Set up parameter values
- source_volume_id = 'testString'
+ bare_metal_server_id = 'testString'
+ id = 'testString'
+ bare_metal_server_disk_patch = bare_metal_server_disk_patch_model
# Invoke method
- response = _service.delete_snapshots(
- source_volume_id,
+ response = _service.update_bare_metal_server_disk(
+ bare_metal_server_id,
+ id,
+ bare_metal_server_disk_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
- # Validate query params
- query_string = responses.calls[0].request.url.split('?',1)[1]
- query_string = urllib.parse.unquote_plus(query_string)
- assert 'source_volume.id={}'.format(source_volume_id) in query_string
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == bare_metal_server_disk_patch
- def test_delete_snapshots_all_params_with_retries(self):
- # Enable retries and run test_delete_snapshots_all_params.
+ def test_update_bare_metal_server_disk_all_params_with_retries(self):
+ # Enable retries and run test_update_bare_metal_server_disk_all_params.
_service.enable_retries()
- self.test_delete_snapshots_all_params()
+ self.test_update_bare_metal_server_disk_all_params()
- # Disable retries and run test_delete_snapshots_all_params.
+ # Disable retries and run test_update_bare_metal_server_disk_all_params.
_service.disable_retries()
- self.test_delete_snapshots_all_params()
+ self.test_update_bare_metal_server_disk_all_params()
@responses.activate
- def test_delete_snapshots_value_error(self):
+ def test_update_bare_metal_server_disk_value_error(self):
"""
- test_delete_snapshots_value_error()
+ test_update_bare_metal_server_disk_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots')
- responses.add(responses.DELETE,
+ url = preprocess_url('/bare_metal_servers/testString/disks/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}'
+ responses.add(responses.PATCH,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a BareMetalServerDiskPatch model
+ bare_metal_server_disk_patch_model = {}
+ bare_metal_server_disk_patch_model['name'] = 'my-bare-metal-server-disk-updated'
# Set up parameter values
- source_volume_id = 'testString'
+ bare_metal_server_id = 'testString'
+ id = 'testString'
+ bare_metal_server_disk_patch = bare_metal_server_disk_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "source_volume_id": source_volume_id,
+ "bare_metal_server_id": bare_metal_server_id,
+ "id": id,
+ "bare_metal_server_disk_patch": bare_metal_server_disk_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_snapshots(**req_copy)
+ _service.update_bare_metal_server_disk(**req_copy)
- def test_delete_snapshots_value_error_with_retries(self):
- # Enable retries and run test_delete_snapshots_value_error.
+ def test_update_bare_metal_server_disk_value_error_with_retries(self):
+ # Enable retries and run test_update_bare_metal_server_disk_value_error.
_service.enable_retries()
- self.test_delete_snapshots_value_error()
+ self.test_update_bare_metal_server_disk_value_error()
- # Disable retries and run test_delete_snapshots_value_error.
+ # Disable retries and run test_update_bare_metal_server_disk_value_error.
_service.disable_retries()
- self.test_delete_snapshots_value_error()
+ self.test_update_bare_metal_server_disk_value_error()
-class TestListSnapshots():
+class TestListBareMetalServerNetworkInterfaces():
"""
- Test Class for list_snapshots
+ Test Class for list_bare_metal_server_network_interfaces
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_snapshots_all_params(self):
+ def test_list_bare_metal_server_network_interfaces_all_params(self):
"""
- list_snapshots()
+ list_bare_metal_server_network_interfaces()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshots": [{"bootable": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -15841,27 +14455,15 @@ def test_list_snapshots_all_params(self):
status=200)
# Set up parameter values
+ bare_metal_server_id = 'testString'
start = 'testString'
limit = 1
- resource_group_id = 'testString'
- name = 'testString'
- source_volume_id = 'testString'
- source_volume_crn = 'testString'
- source_image_id = 'testString'
- source_image_crn = 'testString'
- sort = 'name'
# Invoke method
- response = _service.list_snapshots(
+ response = _service.list_bare_metal_server_network_interfaces(
+ bare_metal_server_id,
start=start,
limit=limit,
- resource_group_id=resource_group_id,
- name=name,
- source_volume_id=source_volume_id,
- source_volume_crn=source_volume_crn,
- source_image_id=source_image_id,
- source_image_crn=source_image_crn,
- sort=sort,
headers={}
)
@@ -15873,134 +14475,135 @@ def test_list_snapshots_all_params(self):
query_string = urllib.parse.unquote_plus(query_string)
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
- assert 'resource_group.id={}'.format(resource_group_id) in query_string
- assert 'name={}'.format(name) in query_string
- assert 'source_volume.id={}'.format(source_volume_id) in query_string
- assert 'source_volume.crn={}'.format(source_volume_crn) in query_string
- assert 'source_image.id={}'.format(source_image_id) in query_string
- assert 'source_image.crn={}'.format(source_image_crn) in query_string
- assert 'sort={}'.format(sort) in query_string
- def test_list_snapshots_all_params_with_retries(self):
- # Enable retries and run test_list_snapshots_all_params.
+ def test_list_bare_metal_server_network_interfaces_all_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_interfaces_all_params.
_service.enable_retries()
- self.test_list_snapshots_all_params()
+ self.test_list_bare_metal_server_network_interfaces_all_params()
- # Disable retries and run test_list_snapshots_all_params.
+ # Disable retries and run test_list_bare_metal_server_network_interfaces_all_params.
_service.disable_retries()
- self.test_list_snapshots_all_params()
+ self.test_list_bare_metal_server_network_interfaces_all_params()
@responses.activate
- def test_list_snapshots_required_params(self):
+ def test_list_bare_metal_server_network_interfaces_required_params(self):
"""
- test_list_snapshots_required_params()
+ test_list_bare_metal_server_network_interfaces_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshots": [{"bootable": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Invoke method
- response = _service.list_snapshots()
+ # Set up parameter values
+ bare_metal_server_id = 'testString'
+ # Invoke method
+ response = _service.list_bare_metal_server_network_interfaces(
+ bare_metal_server_id,
+ headers={}
+ )
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_snapshots_required_params_with_retries(self):
- # Enable retries and run test_list_snapshots_required_params.
+ def test_list_bare_metal_server_network_interfaces_required_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_interfaces_required_params.
_service.enable_retries()
- self.test_list_snapshots_required_params()
+ self.test_list_bare_metal_server_network_interfaces_required_params()
- # Disable retries and run test_list_snapshots_required_params.
+ # Disable retries and run test_list_bare_metal_server_network_interfaces_required_params.
_service.disable_retries()
- self.test_list_snapshots_required_params()
+ self.test_list_bare_metal_server_network_interfaces_required_params()
@responses.activate
- def test_list_snapshots_value_error(self):
+ def test_list_bare_metal_server_network_interfaces_value_error(self):
"""
- test_list_snapshots_value_error()
+ test_list_bare_metal_server_network_interfaces_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshots": [{"bootable": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
+ # Set up parameter values
+ bare_metal_server_id = 'testString'
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "bare_metal_server_id": bare_metal_server_id,
}
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_snapshots(**req_copy)
+ _service.list_bare_metal_server_network_interfaces(**req_copy)
- def test_list_snapshots_value_error_with_retries(self):
- # Enable retries and run test_list_snapshots_value_error.
+ def test_list_bare_metal_server_network_interfaces_value_error_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_interfaces_value_error.
_service.enable_retries()
- self.test_list_snapshots_value_error()
+ self.test_list_bare_metal_server_network_interfaces_value_error()
- # Disable retries and run test_list_snapshots_value_error.
+ # Disable retries and run test_list_bare_metal_server_network_interfaces_value_error.
_service.disable_retries()
- self.test_list_snapshots_value_error()
+ self.test_list_bare_metal_server_network_interfaces_value_error()
-class TestCreateSnapshot():
+class TestCreateBareMetalServerNetworkInterface():
"""
- Test Class for create_snapshot
+ Test Class for create_bare_metal_server_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_snapshot_all_params(self):
+ def test_create_bare_metal_server_network_interface_all_params(self):
"""
- create_snapshot()
+ create_bare_metal_server_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots')
- mock_response = '{"bootable": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a VolumeIdentityById model
- volume_identity_model = {}
- volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model
+ bare_metal_server_network_interface_prototype_model = {}
+ bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan'
+ bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface'
+ bare_metal_server_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5'
+ bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_model['allow_interface_to_float'] = False
+ bare_metal_server_network_interface_prototype_model['vlan'] = 4
# Set up parameter values
- source_volume = volume_identity_model
- name = 'my-snapshot'
- resource_group = resource_group_identity_model
+ bare_metal_server_id = 'testString'
+ bare_metal_server_network_interface_prototype = bare_metal_server_network_interface_prototype_model
# Invoke method
- response = _service.create_snapshot(
- source_volume,
- name=name,
- resource_group=resource_group,
+ response = _service.create_bare_metal_server_network_interface(
+ bare_metal_server_id,
+ bare_metal_server_network_interface_prototype,
headers={}
)
@@ -16009,97 +14612,98 @@ def test_create_snapshot_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['source_volume'] == volume_identity_model
- assert req_body['name'] == 'my-snapshot'
- assert req_body['resource_group'] == resource_group_identity_model
+ assert req_body == bare_metal_server_network_interface_prototype
- def test_create_snapshot_all_params_with_retries(self):
- # Enable retries and run test_create_snapshot_all_params.
+ def test_create_bare_metal_server_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_create_bare_metal_server_network_interface_all_params.
_service.enable_retries()
- self.test_create_snapshot_all_params()
+ self.test_create_bare_metal_server_network_interface_all_params()
- # Disable retries and run test_create_snapshot_all_params.
+ # Disable retries and run test_create_bare_metal_server_network_interface_all_params.
_service.disable_retries()
- self.test_create_snapshot_all_params()
+ self.test_create_bare_metal_server_network_interface_all_params()
@responses.activate
- def test_create_snapshot_value_error(self):
+ def test_create_bare_metal_server_network_interface_value_error(self):
"""
- test_create_snapshot_value_error()
+ test_create_bare_metal_server_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots')
- mock_response = '{"bootable": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a VolumeIdentityById model
- volume_identity_model = {}
- volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model
+ bare_metal_server_network_interface_prototype_model = {}
+ bare_metal_server_network_interface_prototype_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_prototype_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_prototype_model['interface_type'] = 'vlan'
+ bare_metal_server_network_interface_prototype_model['name'] = 'my-network-interface'
+ bare_metal_server_network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5'
+ bare_metal_server_network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_model['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_model['allow_interface_to_float'] = False
+ bare_metal_server_network_interface_prototype_model['vlan'] = 4
# Set up parameter values
- source_volume = volume_identity_model
- name = 'my-snapshot'
- resource_group = resource_group_identity_model
+ bare_metal_server_id = 'testString'
+ bare_metal_server_network_interface_prototype = bare_metal_server_network_interface_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "source_volume": source_volume,
+ "bare_metal_server_id": bare_metal_server_id,
+ "bare_metal_server_network_interface_prototype": bare_metal_server_network_interface_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_snapshot(**req_copy)
+ _service.create_bare_metal_server_network_interface(**req_copy)
- def test_create_snapshot_value_error_with_retries(self):
- # Enable retries and run test_create_snapshot_value_error.
+ def test_create_bare_metal_server_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_create_bare_metal_server_network_interface_value_error.
_service.enable_retries()
- self.test_create_snapshot_value_error()
+ self.test_create_bare_metal_server_network_interface_value_error()
- # Disable retries and run test_create_snapshot_value_error.
+ # Disable retries and run test_create_bare_metal_server_network_interface_value_error.
_service.disable_retries()
- self.test_create_snapshot_value_error()
+ self.test_create_bare_metal_server_network_interface_value_error()
-class TestDeleteSnapshot():
+class TestDeleteBareMetalServerNetworkInterface():
"""
- Test Class for delete_snapshot
+ Test Class for delete_bare_metal_server_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_snapshot_all_params(self):
+ def test_delete_bare_metal_server_network_interface_all_params(self):
"""
- delete_snapshot()
+ delete_bare_metal_server_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots/testString')
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_snapshot(
+ response = _service.delete_bare_metal_server_network_interface(
+ bare_metal_server_id,
id,
headers={}
)
@@ -16108,72 +14712,63 @@ def test_delete_snapshot_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_snapshot_all_params_with_retries(self):
- # Enable retries and run test_delete_snapshot_all_params.
+ def test_delete_bare_metal_server_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_delete_bare_metal_server_network_interface_all_params.
_service.enable_retries()
- self.test_delete_snapshot_all_params()
+ self.test_delete_bare_metal_server_network_interface_all_params()
- # Disable retries and run test_delete_snapshot_all_params.
+ # Disable retries and run test_delete_bare_metal_server_network_interface_all_params.
_service.disable_retries()
- self.test_delete_snapshot_all_params()
+ self.test_delete_bare_metal_server_network_interface_all_params()
@responses.activate
- def test_delete_snapshot_value_error(self):
+ def test_delete_bare_metal_server_network_interface_value_error(self):
"""
- test_delete_snapshot_value_error()
+ test_delete_bare_metal_server_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots/testString')
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "bare_metal_server_id": bare_metal_server_id,
"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_snapshot(**req_copy)
+ _service.delete_bare_metal_server_network_interface(**req_copy)
- def test_delete_snapshot_value_error_with_retries(self):
- # Enable retries and run test_delete_snapshot_value_error.
+ def test_delete_bare_metal_server_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_delete_bare_metal_server_network_interface_value_error.
_service.enable_retries()
- self.test_delete_snapshot_value_error()
+ self.test_delete_bare_metal_server_network_interface_value_error()
- # Disable retries and run test_delete_snapshot_value_error.
+ # Disable retries and run test_delete_bare_metal_server_network_interface_value_error.
_service.disable_retries()
- self.test_delete_snapshot_value_error()
+ self.test_delete_bare_metal_server_network_interface_value_error()
-class TestGetSnapshot():
+class TestGetBareMetalServerNetworkInterface():
"""
- Test Class for get_snapshot
+ Test Class for get_bare_metal_server_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_snapshot_all_params(self):
+ def test_get_bare_metal_server_network_interface_all_params(self):
"""
- get_snapshot()
+ get_bare_metal_server_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots/testString')
- mock_response = '{"bootable": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -16181,10 +14776,12 @@ def test_get_snapshot_all_params(self):
status=200)
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_snapshot(
+ response = _service.get_bare_metal_server_network_interface(
+ bare_metal_server_id,
id,
headers={}
)
@@ -16193,23 +14790,23 @@ def test_get_snapshot_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_snapshot_all_params_with_retries(self):
- # Enable retries and run test_get_snapshot_all_params.
+ def test_get_bare_metal_server_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_network_interface_all_params.
_service.enable_retries()
- self.test_get_snapshot_all_params()
+ self.test_get_bare_metal_server_network_interface_all_params()
- # Disable retries and run test_get_snapshot_all_params.
+ # Disable retries and run test_get_bare_metal_server_network_interface_all_params.
_service.disable_retries()
- self.test_get_snapshot_all_params()
+ self.test_get_bare_metal_server_network_interface_all_params()
@responses.activate
- def test_get_snapshot_value_error(self):
+ def test_get_bare_metal_server_network_interface_value_error(self):
"""
- test_get_snapshot_value_error()
+ test_get_bare_metal_server_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots/testString')
- mock_response = '{"bootable": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -16217,69 +14814,65 @@ def test_get_snapshot_value_error(self):
status=200)
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "bare_metal_server_id": bare_metal_server_id,
"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_snapshot(**req_copy)
+ _service.get_bare_metal_server_network_interface(**req_copy)
- def test_get_snapshot_value_error_with_retries(self):
- # Enable retries and run test_get_snapshot_value_error.
+ def test_get_bare_metal_server_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_network_interface_value_error.
_service.enable_retries()
- self.test_get_snapshot_value_error()
+ self.test_get_bare_metal_server_network_interface_value_error()
- # Disable retries and run test_get_snapshot_value_error.
+ # Disable retries and run test_get_bare_metal_server_network_interface_value_error.
_service.disable_retries()
- self.test_get_snapshot_value_error()
+ self.test_get_bare_metal_server_network_interface_value_error()
-class TestUpdateSnapshot():
+class TestUpdateBareMetalServerNetworkInterface():
"""
- Test Class for update_snapshot
+ Test Class for update_bare_metal_server_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_snapshot_all_params(self):
+ def test_update_bare_metal_server_network_interface_all_params(self):
"""
- update_snapshot()
+ update_bare_metal_server_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots/testString')
- mock_response = '{"bootable": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a SnapshotPatch model
- snapshot_patch_model = {}
- snapshot_patch_model['name'] = 'my-snapshot'
+ # Construct a dict representation of a BareMetalServerNetworkInterfacePatch model
+ bare_metal_server_network_interface_patch_model = {}
+ 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'
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
- snapshot_patch = snapshot_patch_model
+ bare_metal_server_network_interface_patch = bare_metal_server_network_interface_patch_model
# Invoke method
- response = _service.update_snapshot(
+ response = _service.update_bare_metal_server_network_interface(
+ bare_metal_server_id,
id,
- snapshot_patch,
+ bare_metal_server_network_interface_patch,
headers={}
)
@@ -16288,296 +14881,237 @@ def test_update_snapshot_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == snapshot_patch
+ assert req_body == bare_metal_server_network_interface_patch
- def test_update_snapshot_all_params_with_retries(self):
- # Enable retries and run test_update_snapshot_all_params.
+ def test_update_bare_metal_server_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_update_bare_metal_server_network_interface_all_params.
_service.enable_retries()
- self.test_update_snapshot_all_params()
+ self.test_update_bare_metal_server_network_interface_all_params()
- # Disable retries and run test_update_snapshot_all_params.
+ # Disable retries and run test_update_bare_metal_server_network_interface_all_params.
_service.disable_retries()
- self.test_update_snapshot_all_params()
+ self.test_update_bare_metal_server_network_interface_all_params()
@responses.activate
- def test_update_snapshot_value_error(self):
+ def test_update_bare_metal_server_network_interface_value_error(self):
"""
- test_update_snapshot_value_error()
+ test_update_bare_metal_server_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/snapshots/testString')
- mock_response = '{"bootable": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
+ url = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "enable_infrastructure_nat": true, "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "pci", "mac_address": "02:00:0a:00:23:94", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary", "allowed_vlans": [4]}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a SnapshotPatch model
- snapshot_patch_model = {}
- snapshot_patch_model['name'] = 'my-snapshot'
+ # Construct a dict representation of a BareMetalServerNetworkInterfacePatch model
+ bare_metal_server_network_interface_patch_model = {}
+ 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'
# Set up parameter values
+ bare_metal_server_id = 'testString'
id = 'testString'
- snapshot_patch = snapshot_patch_model
+ bare_metal_server_network_interface_patch = bare_metal_server_network_interface_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "bare_metal_server_id": bare_metal_server_id,
"id": id,
- "snapshot_patch": snapshot_patch,
+ "bare_metal_server_network_interface_patch": bare_metal_server_network_interface_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_snapshot(**req_copy)
+ _service.update_bare_metal_server_network_interface(**req_copy)
- def test_update_snapshot_value_error_with_retries(self):
- # Enable retries and run test_update_snapshot_value_error.
+ def test_update_bare_metal_server_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_update_bare_metal_server_network_interface_value_error.
_service.enable_retries()
- self.test_update_snapshot_value_error()
+ self.test_update_bare_metal_server_network_interface_value_error()
- # Disable retries and run test_update_snapshot_value_error.
+ # Disable retries and run test_update_bare_metal_server_network_interface_value_error.
_service.disable_retries()
- self.test_update_snapshot_value_error()
-
-# endregion
-##############################################################################
-# End of Service: Snapshots
-##############################################################################
-
-##############################################################################
-# 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'
+ self.test_update_bare_metal_server_network_interface_value_error()
- 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,
- )
-
- 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():
+class TestListBareMetalServerNetworkInterfaceFloatingIps():
"""
- Test Class for list_regions
+ Test Class for list_bare_metal_server_network_interface_floating_ips
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_regions_all_params(self):
+ def test_list_bare_metal_server_network_interface_floating_ips_all_params(self):
"""
- list_regions()
+ list_bare_metal_server_network_interface_floating_ips()
"""
# Set up mock
- url = self.preprocess_url(_base_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('/bare_metal_servers/testString/network_interfaces/testString/floating_ips')
+ mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Invoke method
- response = _service.list_regions()
+ # Set up parameter values
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ # Invoke method
+ response = _service.list_bare_metal_server_network_interface_floating_ips(
+ bare_metal_server_id,
+ network_interface_id,
+ headers={}
+ )
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_regions_all_params_with_retries(self):
- # Enable retries and run test_list_regions_all_params.
+ def test_list_bare_metal_server_network_interface_floating_ips_all_params_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_interface_floating_ips_all_params.
_service.enable_retries()
- self.test_list_regions_all_params()
+ self.test_list_bare_metal_server_network_interface_floating_ips_all_params()
- # Disable retries and run test_list_regions_all_params.
+ # Disable retries and run test_list_bare_metal_server_network_interface_floating_ips_all_params.
_service.disable_retries()
- self.test_list_regions_all_params()
+ self.test_list_bare_metal_server_network_interface_floating_ips_all_params()
@responses.activate
- def test_list_regions_value_error(self):
+ def test_list_bare_metal_server_network_interface_floating_ips_value_error(self):
"""
- test_list_regions_value_error()
+ test_list_bare_metal_server_network_interface_floating_ips_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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('/bare_metal_servers/testString/network_interfaces/testString/floating_ips')
+ mock_response = '{"floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
+ # Set up parameter values
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "bare_metal_server_id": bare_metal_server_id,
+ "network_interface_id": network_interface_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_regions(**req_copy)
+ _service.list_bare_metal_server_network_interface_floating_ips(**req_copy)
- def test_list_regions_value_error_with_retries(self):
- # Enable retries and run test_list_regions_value_error.
+ def test_list_bare_metal_server_network_interface_floating_ips_value_error_with_retries(self):
+ # Enable retries and run test_list_bare_metal_server_network_interface_floating_ips_value_error.
_service.enable_retries()
- self.test_list_regions_value_error()
+ self.test_list_bare_metal_server_network_interface_floating_ips_value_error()
- # Disable retries and run test_list_regions_value_error.
+ # Disable retries and run test_list_bare_metal_server_network_interface_floating_ips_value_error.
_service.disable_retries()
- self.test_list_regions_value_error()
+ self.test_list_bare_metal_server_network_interface_floating_ips_value_error()
-class TestGetRegion():
+class TestRemoveBareMetalServerNetworkInterfaceFloatingIp():
"""
- Test Class for get_region
+ Test Class for remove_bare_metal_server_network_interface_floating_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_region_all_params(self):
+ def test_remove_bare_metal_server_network_interface_floating_ip_all_params(self):
"""
- get_region()
+ remove_bare_metal_server_network_interface_floating_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_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 = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- name = 'testString'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.get_region(
- name,
+ response = _service.remove_bare_metal_server_network_interface_floating_ip(
+ bare_metal_server_id,
+ network_interface_id,
+ id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_get_region_all_params_with_retries(self):
- # Enable retries and run test_get_region_all_params.
+ def test_remove_bare_metal_server_network_interface_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_remove_bare_metal_server_network_interface_floating_ip_all_params.
_service.enable_retries()
- self.test_get_region_all_params()
+ self.test_remove_bare_metal_server_network_interface_floating_ip_all_params()
- # Disable retries and run test_get_region_all_params.
+ # Disable retries and run test_remove_bare_metal_server_network_interface_floating_ip_all_params.
_service.disable_retries()
- self.test_get_region_all_params()
+ self.test_remove_bare_metal_server_network_interface_floating_ip_all_params()
@responses.activate
- def test_get_region_value_error(self):
+ def test_remove_bare_metal_server_network_interface_floating_ip_value_error(self):
"""
- test_get_region_value_error()
+ test_remove_bare_metal_server_network_interface_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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 = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- name = 'testString'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "name": name,
+ "bare_metal_server_id": bare_metal_server_id,
+ "network_interface_id": network_interface_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_region(**req_copy)
+ _service.remove_bare_metal_server_network_interface_floating_ip(**req_copy)
- def test_get_region_value_error_with_retries(self):
- # Enable retries and run test_get_region_value_error.
+ def test_remove_bare_metal_server_network_interface_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_remove_bare_metal_server_network_interface_floating_ip_value_error.
_service.enable_retries()
- self.test_get_region_value_error()
+ self.test_remove_bare_metal_server_network_interface_floating_ip_value_error()
- # Disable retries and run test_get_region_value_error.
+ # Disable retries and run test_remove_bare_metal_server_network_interface_floating_ip_value_error.
_service.disable_retries()
- self.test_get_region_value_error()
+ self.test_remove_bare_metal_server_network_interface_floating_ip_value_error()
-class TestListRegionZones():
+class TestGetBareMetalServerNetworkInterfaceFloatingIp():
"""
- Test Class for list_region_zones
+ Test Class for get_bare_metal_server_network_interface_floating_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_region_zones_all_params(self):
+ def test_get_bare_metal_server_network_interface_floating_ip_all_params(self):
"""
- list_region_zones()
+ get_bare_metal_server_network_interface_floating_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_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('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -16585,11 +15119,15 @@ def test_list_region_zones_all_params(self):
status=200)
# Set up parameter values
- region_name = 'testString'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_region_zones(
- region_name,
+ response = _service.get_bare_metal_server_network_interface_floating_ip(
+ bare_metal_server_id,
+ network_interface_id,
+ id,
headers={}
)
@@ -16597,23 +15135,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_bare_metal_server_network_interface_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_network_interface_floating_ip_all_params.
_service.enable_retries()
- self.test_list_region_zones_all_params()
+ self.test_get_bare_metal_server_network_interface_floating_ip_all_params()
- # Disable retries and run test_list_region_zones_all_params.
+ # Disable retries and run test_get_bare_metal_server_network_interface_floating_ip_all_params.
_service.disable_retries()
- self.test_list_region_zones_all_params()
+ self.test_get_bare_metal_server_network_interface_floating_ip_all_params()
@responses.activate
- def test_list_region_zones_value_error(self):
+ def test_get_bare_metal_server_network_interface_floating_ip_value_error(self):
"""
- test_list_region_zones_value_error()
+ test_get_bare_metal_server_network_interface_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -16621,189 +15159,200 @@ def test_list_region_zones_value_error(self):
status=200)
# Set up parameter values
- region_name = 'testString'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "region_name": region_name,
+ "bare_metal_server_id": bare_metal_server_id,
+ "network_interface_id": network_interface_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_region_zones(**req_copy)
+ _service.get_bare_metal_server_network_interface_floating_ip(**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_bare_metal_server_network_interface_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_network_interface_floating_ip_value_error.
_service.enable_retries()
- self.test_list_region_zones_value_error()
+ self.test_get_bare_metal_server_network_interface_floating_ip_value_error()
- # Disable retries and run test_list_region_zones_value_error.
+ # Disable retries and run test_get_bare_metal_server_network_interface_floating_ip_value_error.
_service.disable_retries()
- self.test_list_region_zones_value_error()
+ self.test_get_bare_metal_server_network_interface_floating_ip_value_error()
-class TestGetRegionZone():
+class TestAddBareMetalServerNetworkInterfaceFloatingIp():
"""
- Test Class for get_region_zone
+ Test Class for add_bare_metal_server_network_interface_floating_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_region_zone_all_params(self):
+ def test_add_bare_metal_server_network_interface_floating_ip_all_params(self):
"""
- get_region_zone()
+ add_bare_metal_server_network_interface_floating_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_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 = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.PUT,
url,
body=mock_response,
content_type='application/json',
- status=200)
+ status=201)
# Set up parameter values
- region_name = 'testString'
- name = 'testString'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.get_region_zone(
- region_name,
- name,
+ response = _service.add_bare_metal_server_network_interface_floating_ip(
+ bare_metal_server_id,
+ network_interface_id,
+ id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 201
- def test_get_region_zone_all_params_with_retries(self):
- # Enable retries and run test_get_region_zone_all_params.
+ def test_add_bare_metal_server_network_interface_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_add_bare_metal_server_network_interface_floating_ip_all_params.
_service.enable_retries()
- self.test_get_region_zone_all_params()
+ self.test_add_bare_metal_server_network_interface_floating_ip_all_params()
- # Disable retries and run test_get_region_zone_all_params.
+ # Disable retries and run test_add_bare_metal_server_network_interface_floating_ip_all_params.
_service.disable_retries()
- self.test_get_region_zone_all_params()
+ self.test_add_bare_metal_server_network_interface_floating_ip_all_params()
@responses.activate
- def test_get_region_zone_value_error(self):
+ def test_add_bare_metal_server_network_interface_floating_ip_value_error(self):
"""
- test_get_region_zone_value_error()
+ test_add_bare_metal_server_network_interface_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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 = preprocess_url('/bare_metal_servers/testString/network_interfaces/testString/floating_ips/testString')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.PUT,
url,
body=mock_response,
content_type='application/json',
- status=200)
+ status=201)
# Set up parameter values
- region_name = 'testString'
- name = 'testString'
+ bare_metal_server_id = 'testString'
+ network_interface_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "region_name": region_name,
- "name": name,
+ "bare_metal_server_id": bare_metal_server_id,
+ "network_interface_id": network_interface_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_region_zone(**req_copy)
+ _service.add_bare_metal_server_network_interface_floating_ip(**req_copy)
- def test_get_region_zone_value_error_with_retries(self):
- # Enable retries and run test_get_region_zone_value_error.
+ def test_add_bare_metal_server_network_interface_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_add_bare_metal_server_network_interface_floating_ip_value_error.
_service.enable_retries()
- self.test_get_region_zone_value_error()
+ self.test_add_bare_metal_server_network_interface_floating_ip_value_error()
- # Disable retries and run test_get_region_zone_value_error.
+ # Disable retries and run test_add_bare_metal_server_network_interface_floating_ip_value_error.
_service.disable_retries()
- self.test_get_region_zone_value_error()
-
-# endregion
-##############################################################################
-# End of Service: Geography
-##############################################################################
-
-##############################################################################
-# Start of Service: PublicGateways
-##############################################################################
-# region
+ self.test_add_bare_metal_server_network_interface_floating_ip_value_error()
-class TestNewInstance():
+class TestDeleteBareMetalServer():
"""
- Test Class for new_instance
+ Test Class for delete_bare_metal_server
"""
- def test_new_instance(self):
+ @responses.activate
+ def test_delete_bare_metal_server_all_params(self):
"""
- new_instance()
+ delete_bare_metal_server()
"""
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.delete_bare_metal_server(
+ id,
+ headers={}
)
- assert service is not None
- assert isinstance(service, VpcV1)
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 204
- 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,
- )
+ def test_delete_bare_metal_server_all_params_with_retries(self):
+ # Enable retries and run test_delete_bare_metal_server_all_params.
+ _service.enable_retries()
+ self.test_delete_bare_metal_server_all_params()
- def test_new_instance_required_param_none(self):
+ # Disable retries and run test_delete_bare_metal_server_all_params.
+ _service.disable_retries()
+ self.test_delete_bare_metal_server_all_params()
+
+ @responses.activate
+ def test_delete_bare_metal_server_value_error(self):
"""
- new_instance_required_param_none()
+ test_delete_bare_metal_server_value_error()
"""
- with pytest.raises(ValueError, match='version must be provided'):
- service = VpcV1.new_instance(
- version=None,
- )
-class TestListPublicGateways():
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.delete_bare_metal_server(**req_copy)
+
+
+ def test_delete_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_delete_bare_metal_server_value_error.
+ _service.enable_retries()
+ self.test_delete_bare_metal_server_value_error()
+
+ # Disable retries and run test_delete_bare_metal_server_value_error.
+ _service.disable_retries()
+ self.test_delete_bare_metal_server_value_error()
+
+class TestGetBareMetalServer():
"""
- Test Class for list_public_gateways
+ Test Class for get_bare_metal_server
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_public_gateways_all_params(self):
+ def test_get_bare_metal_server_all_params(self):
"""
- list_public_gateways()
+ get_bare_metal_server()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers/testString')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "failed", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -16811,264 +15360,245 @@ def test_list_public_gateways_all_params(self):
status=200)
# Set up parameter values
- start = 'testString'
- limit = 1
- resource_group_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_public_gateways(
- start=start,
- limit=limit,
- resource_group_id=resource_group_id,
+ response = _service.get_bare_metal_server(
+ 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_public_gateways_all_params_with_retries(self):
- # Enable retries and run test_list_public_gateways_all_params.
+ def test_get_bare_metal_server_all_params_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_all_params.
_service.enable_retries()
- self.test_list_public_gateways_all_params()
+ self.test_get_bare_metal_server_all_params()
- # Disable retries and run test_list_public_gateways_all_params.
+ # Disable retries and run test_get_bare_metal_server_all_params.
_service.disable_retries()
- self.test_list_public_gateways_all_params()
+ self.test_get_bare_metal_server_all_params()
@responses.activate
- def test_list_public_gateways_required_params(self):
+ def test_get_bare_metal_server_value_error(self):
"""
- test_list_public_gateways_required_params()
+ test_get_bare_metal_server_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "total_count": 132}'
+ url = preprocess_url('/bare_metal_servers/testString')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "failed", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Invoke method
- response = _service.list_public_gateways()
+ # 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_bare_metal_server(**req_copy)
+
+
+ def test_get_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_value_error.
+ _service.enable_retries()
+ self.test_get_bare_metal_server_value_error()
+
+ # Disable retries and run test_get_bare_metal_server_value_error.
+ _service.disable_retries()
+ self.test_get_bare_metal_server_value_error()
+
+class TestUpdateBareMetalServer():
+ """
+ Test Class for update_bare_metal_server
+ """
+
+ @responses.activate
+ def test_update_bare_metal_server_all_params(self):
+ """
+ update_bare_metal_server()
+ """
+ # Set up mock
+ url = preprocess_url('/bare_metal_servers/testString')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "failed", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a BareMetalServerPatch model
+ bare_metal_server_patch_model = {}
+ bare_metal_server_patch_model['name'] = 'my-bare-metal-server'
+
+ # Set up parameter values
+ id = 'testString'
+ bare_metal_server_patch = bare_metal_server_patch_model
+ # Invoke method
+ response = _service.update_bare_metal_server(
+ id,
+ bare_metal_server_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 == bare_metal_server_patch
- def test_list_public_gateways_required_params_with_retries(self):
- # Enable retries and run test_list_public_gateways_required_params.
+ def test_update_bare_metal_server_all_params_with_retries(self):
+ # Enable retries and run test_update_bare_metal_server_all_params.
_service.enable_retries()
- self.test_list_public_gateways_required_params()
+ self.test_update_bare_metal_server_all_params()
- # Disable retries and run test_list_public_gateways_required_params.
+ # Disable retries and run test_update_bare_metal_server_all_params.
_service.disable_retries()
- self.test_list_public_gateways_required_params()
+ self.test_update_bare_metal_server_all_params()
@responses.activate
- def test_list_public_gateways_value_error(self):
+ def test_update_bare_metal_server_value_error(self):
"""
- test_list_public_gateways_value_error()
+ test_update_bare_metal_server_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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 = preprocess_url('/bare_metal_servers/testString')
+ mock_response = '{"bandwidth": 20000, "boot_target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk"}, "cpu": {"architecture": "amd64", "core_count": 80, "socket_count": 4, "threads_per_core": 2}, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a", "disks": [{"created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "interface_type": "nvme", "name": "my-bare-metal-disk", "resource_type": "bare_metal_server_disk", "size": 100}], "enable_secure_boot": false, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "memory": 1536, "name": "my-bare-metal-server", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}], "primary_network_interface": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768", "name": "bx2-metal-192x768", "resource_type": "bare_metal_server_profile"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "bare_metal_server", "status": "failed", "status_reasons": [{"code": "cannot_start_capacity", "message": "The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.", "more_info": "https://console.bluemix.net/docs/iaas/bare_metal_server.html"}], "trusted_platform_module": {"enabled": true, "mode": "tpm_2"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
+ # Construct a dict representation of a BareMetalServerPatch model
+ bare_metal_server_patch_model = {}
+ bare_metal_server_patch_model['name'] = 'my-bare-metal-server'
+
+ # Set up parameter values
+ id = 'testString'
+ bare_metal_server_patch = bare_metal_server_patch_model
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "id": id,
+ "bare_metal_server_patch": bare_metal_server_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_public_gateways(**req_copy)
+ _service.update_bare_metal_server(**req_copy)
- def test_list_public_gateways_value_error_with_retries(self):
- # Enable retries and run test_list_public_gateways_value_error.
+ def test_update_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_update_bare_metal_server_value_error.
_service.enable_retries()
- self.test_list_public_gateways_value_error()
+ self.test_update_bare_metal_server_value_error()
- # Disable retries and run test_list_public_gateways_value_error.
+ # Disable retries and run test_update_bare_metal_server_value_error.
_service.disable_retries()
- self.test_list_public_gateways_value_error()
+ self.test_update_bare_metal_server_value_error()
-class TestCreatePublicGateway():
+class TestGetBareMetalServerInitialization():
"""
- Test Class for create_public_gateway
+ Test Class for get_bare_metal_server_initialization
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_public_gateway_all_params(self):
+ def test_get_bare_metal_server_initialization_all_params(self):
"""
- create_public_gateway()
+ get_bare_metal_server_initialization()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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 = 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"}, "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"}]}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # Construct a dict representation of a VPCIdentityById model
- vpc_identity_model = {}
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model
- public_gateway_floating_ip_prototype_model = {}
- public_gateway_floating_ip_prototype_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ status=200)
# Set up parameter values
- vpc = vpc_identity_model
- zone = zone_identity_model
- floating_ip = public_gateway_floating_ip_prototype_model
- name = 'my-public-gateway'
- resource_group = resource_group_identity_model
+ id = 'testString'
# Invoke method
- response = _service.create_public_gateway(
- vpc,
- zone,
- floating_ip=floating_ip,
- name=name,
- resource_group=resource_group,
+ response = _service.get_bare_metal_server_initialization(
+ id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['vpc'] == vpc_identity_model
- assert req_body['zone'] == zone_identity_model
- assert req_body['floating_ip'] == public_gateway_floating_ip_prototype_model
- assert req_body['name'] == 'my-public-gateway'
- assert req_body['resource_group'] == resource_group_identity_model
+ assert response.status_code == 200
- def test_create_public_gateway_all_params_with_retries(self):
- # Enable retries and run test_create_public_gateway_all_params.
+ def test_get_bare_metal_server_initialization_all_params_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_initialization_all_params.
_service.enable_retries()
- self.test_create_public_gateway_all_params()
+ self.test_get_bare_metal_server_initialization_all_params()
- # Disable retries and run test_create_public_gateway_all_params.
+ # Disable retries and run test_get_bare_metal_server_initialization_all_params.
_service.disable_retries()
- self.test_create_public_gateway_all_params()
+ self.test_get_bare_metal_server_initialization_all_params()
@responses.activate
- def test_create_public_gateway_value_error(self):
+ def test_get_bare_metal_server_initialization_value_error(self):
"""
- test_create_public_gateway_value_error()
+ test_get_bare_metal_server_initialization_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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 = 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"}, "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"}]}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # Construct a dict representation of a VPCIdentityById model
- vpc_identity_model = {}
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
-
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
-
- # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model
- public_gateway_floating_ip_prototype_model = {}
- public_gateway_floating_ip_prototype_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ status=200)
# Set up parameter values
- vpc = vpc_identity_model
- zone = zone_identity_model
- floating_ip = public_gateway_floating_ip_prototype_model
- name = 'my-public-gateway'
- resource_group = resource_group_identity_model
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpc": vpc,
- "zone": zone,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_public_gateway(**req_copy)
+ _service.get_bare_metal_server_initialization(**req_copy)
- def test_create_public_gateway_value_error_with_retries(self):
- # Enable retries and run test_create_public_gateway_value_error.
+ def test_get_bare_metal_server_initialization_value_error_with_retries(self):
+ # Enable retries and run test_get_bare_metal_server_initialization_value_error.
_service.enable_retries()
- self.test_create_public_gateway_value_error()
+ self.test_get_bare_metal_server_initialization_value_error()
- # Disable retries and run test_create_public_gateway_value_error.
+ # Disable retries and run test_get_bare_metal_server_initialization_value_error.
_service.disable_retries()
- self.test_create_public_gateway_value_error()
+ self.test_get_bare_metal_server_initialization_value_error()
-class TestDeletePublicGateway():
+class TestRestartBareMetalServer():
"""
- Test Class for delete_public_gateway
+ Test Class for restart_bare_metal_server
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_public_gateway_all_params(self):
+ def test_restart_bare_metal_server_all_params(self):
"""
- delete_public_gateway()
+ restart_bare_metal_server()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/bare_metal_servers/testString/restart')
+ responses.add(responses.POST,
url,
status=204)
@@ -17076,7 +15606,7 @@ def test_delete_public_gateway_all_params(self):
id = 'testString'
# Invoke method
- response = _service.delete_public_gateway(
+ response = _service.restart_bare_metal_server(
id,
headers={}
)
@@ -17085,23 +15615,23 @@ def test_delete_public_gateway_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_public_gateway_all_params_with_retries(self):
- # Enable retries and run test_delete_public_gateway_all_params.
+ def test_restart_bare_metal_server_all_params_with_retries(self):
+ # Enable retries and run test_restart_bare_metal_server_all_params.
_service.enable_retries()
- self.test_delete_public_gateway_all_params()
+ self.test_restart_bare_metal_server_all_params()
- # Disable retries and run test_delete_public_gateway_all_params.
+ # Disable retries and run test_restart_bare_metal_server_all_params.
_service.disable_retries()
- self.test_delete_public_gateway_all_params()
+ self.test_restart_bare_metal_server_all_params()
@responses.activate
- def test_delete_public_gateway_value_error(self):
+ def test_restart_bare_metal_server_value_error(self):
"""
- test_delete_public_gateway_value_error()
+ test_restart_bare_metal_server_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/bare_metal_servers/testString/restart')
+ responses.add(responses.POST,
url,
status=204)
@@ -17115,83 +15645,66 @@ def test_delete_public_gateway_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_public_gateway(**req_copy)
+ _service.restart_bare_metal_server(**req_copy)
- def test_delete_public_gateway_value_error_with_retries(self):
- # Enable retries and run test_delete_public_gateway_value_error.
+ def test_restart_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_restart_bare_metal_server_value_error.
_service.enable_retries()
- self.test_delete_public_gateway_value_error()
+ self.test_restart_bare_metal_server_value_error()
- # Disable retries and run test_delete_public_gateway_value_error.
+ # Disable retries and run test_restart_bare_metal_server_value_error.
_service.disable_retries()
- self.test_delete_public_gateway_value_error()
+ self.test_restart_bare_metal_server_value_error()
-class TestGetPublicGateway():
+class TestStartBareMetalServer():
"""
- Test Class for get_public_gateway
+ Test Class for start_bare_metal_server
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_public_gateway_all_params(self):
+ def test_start_bare_metal_server_all_params(self):
"""
- get_public_gateway()
+ start_bare_metal_server()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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 = preprocess_url('/bare_metal_servers/testString/start')
+ responses.add(responses.POST,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
id = 'testString'
# Invoke method
- response = _service.get_public_gateway(
+ response = _service.start_bare_metal_server(
id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_get_public_gateway_all_params_with_retries(self):
- # Enable retries and run test_get_public_gateway_all_params.
+ def test_start_bare_metal_server_all_params_with_retries(self):
+ # Enable retries and run test_start_bare_metal_server_all_params.
_service.enable_retries()
- self.test_get_public_gateway_all_params()
+ self.test_start_bare_metal_server_all_params()
- # Disable retries and run test_get_public_gateway_all_params.
+ # Disable retries and run test_start_bare_metal_server_all_params.
_service.disable_retries()
- self.test_get_public_gateway_all_params()
+ self.test_start_bare_metal_server_all_params()
@responses.activate
- def test_get_public_gateway_value_error(self):
+ def test_start_bare_metal_server_value_error(self):
"""
- test_get_public_gateway_value_error()
+ test_start_bare_metal_server_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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 = preprocess_url('/bare_metal_servers/testString/start')
+ responses.add(responses.POST,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
id = 'testString'
@@ -17203,128 +15716,103 @@ def test_get_public_gateway_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_public_gateway(**req_copy)
+ _service.start_bare_metal_server(**req_copy)
- def test_get_public_gateway_value_error_with_retries(self):
- # Enable retries and run test_get_public_gateway_value_error.
+ def test_start_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_start_bare_metal_server_value_error.
_service.enable_retries()
- self.test_get_public_gateway_value_error()
+ self.test_start_bare_metal_server_value_error()
- # Disable retries and run test_get_public_gateway_value_error.
+ # Disable retries and run test_start_bare_metal_server_value_error.
_service.disable_retries()
- self.test_get_public_gateway_value_error()
+ self.test_start_bare_metal_server_value_error()
-class TestUpdatePublicGateway():
+class TestStopBareMetalServer():
"""
- Test Class for update_public_gateway
+ Test Class for stop_bare_metal_server
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_public_gateway_all_params(self):
+ def test_stop_bare_metal_server_all_params(self):
"""
- update_public_gateway()
+ stop_bare_metal_server()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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 = preprocess_url('/bare_metal_servers/testString/stop')
+ responses.add(responses.POST,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
-
- # Construct a dict representation of a PublicGatewayPatch model
- public_gateway_patch_model = {}
- public_gateway_patch_model['name'] = 'my-public-gateway'
+ status=204)
# Set up parameter values
id = 'testString'
- public_gateway_patch = public_gateway_patch_model
+ type = 'hard'
# Invoke method
- response = _service.update_public_gateway(
+ response = _service.stop_bare_metal_server(
id,
- public_gateway_patch,
+ type,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == public_gateway_patch
+ assert req_body['type'] == 'hard'
- def test_update_public_gateway_all_params_with_retries(self):
- # Enable retries and run test_update_public_gateway_all_params.
+ def test_stop_bare_metal_server_all_params_with_retries(self):
+ # Enable retries and run test_stop_bare_metal_server_all_params.
_service.enable_retries()
- self.test_update_public_gateway_all_params()
+ self.test_stop_bare_metal_server_all_params()
- # Disable retries and run test_update_public_gateway_all_params.
+ # Disable retries and run test_stop_bare_metal_server_all_params.
_service.disable_retries()
- self.test_update_public_gateway_all_params()
+ self.test_stop_bare_metal_server_all_params()
@responses.activate
- def test_update_public_gateway_value_error(self):
+ def test_stop_bare_metal_server_value_error(self):
"""
- test_update_public_gateway_value_error()
+ test_stop_bare_metal_server_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/public_gateways/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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 = preprocess_url('/bare_metal_servers/testString/stop')
+ responses.add(responses.POST,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
-
- # Construct a dict representation of a PublicGatewayPatch model
- public_gateway_patch_model = {}
- public_gateway_patch_model['name'] = 'my-public-gateway'
+ status=204)
# Set up parameter values
id = 'testString'
- public_gateway_patch = public_gateway_patch_model
+ type = 'hard'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "public_gateway_patch": public_gateway_patch,
+ "type": type,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_public_gateway(**req_copy)
+ _service.stop_bare_metal_server(**req_copy)
- def test_update_public_gateway_value_error_with_retries(self):
- # Enable retries and run test_update_public_gateway_value_error.
+ def test_stop_bare_metal_server_value_error_with_retries(self):
+ # Enable retries and run test_stop_bare_metal_server_value_error.
_service.enable_retries()
- self.test_update_public_gateway_value_error()
+ self.test_stop_bare_metal_server_value_error()
- # Disable retries and run test_update_public_gateway_value_error.
+ # Disable retries and run test_stop_bare_metal_server_value_error.
_service.disable_retries()
- self.test_update_public_gateway_value_error()
+ self.test_stop_bare_metal_server_value_error()
# endregion
##############################################################################
-# End of Service: PublicGateways
+# End of Service: BareMetalServers
##############################################################################
##############################################################################
-# Start of Service: FloatingIPs
+# Start of Service: Volumes
##############################################################################
# region
@@ -17354,8 +15842,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -17364,30 +15860,19 @@ def test_new_instance_required_param_none(self):
service = VpcV1.new_instance(
version=None,
)
-class TestListFloatingIps():
+class TestListVolumeProfiles():
"""
- Test Class for list_floating_ips
+ Test Class for list_volume_profiles
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_floating_ips_all_params(self):
+ def test_list_volume_profiles_all_params(self):
"""
- list_floating_ips()
+ list_volume_profiles()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/volume/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -17397,13 +15882,11 @@ def test_list_floating_ips_all_params(self):
# Set up parameter values
start = 'testString'
limit = 1
- resource_group_id = 'testString'
# Invoke method
- response = _service.list_floating_ips(
+ response = _service.list_volume_profiles(
start=start,
limit=limit,
- resource_group_id=resource_group_id,
headers={}
)
@@ -17415,25 +15898,24 @@ def test_list_floating_ips_all_params(self):
query_string = urllib.parse.unquote_plus(query_string)
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
- assert 'resource_group.id={}'.format(resource_group_id) in query_string
- def test_list_floating_ips_all_params_with_retries(self):
- # Enable retries and run test_list_floating_ips_all_params.
+ def test_list_volume_profiles_all_params_with_retries(self):
+ # Enable retries and run test_list_volume_profiles_all_params.
_service.enable_retries()
- self.test_list_floating_ips_all_params()
+ self.test_list_volume_profiles_all_params()
- # Disable retries and run test_list_floating_ips_all_params.
+ # Disable retries and run test_list_volume_profiles_all_params.
_service.disable_retries()
- self.test_list_floating_ips_all_params()
+ self.test_list_volume_profiles_all_params()
@responses.activate
- def test_list_floating_ips_required_params(self):
+ def test_list_volume_profiles_required_params(self):
"""
- test_list_floating_ips_required_params()
+ test_list_volume_profiles_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/volume/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -17441,30 +15923,30 @@ def test_list_floating_ips_required_params(self):
status=200)
# Invoke method
- response = _service.list_floating_ips()
+ response = _service.list_volume_profiles()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_floating_ips_required_params_with_retries(self):
- # Enable retries and run test_list_floating_ips_required_params.
+ def test_list_volume_profiles_required_params_with_retries(self):
+ # Enable retries and run test_list_volume_profiles_required_params.
_service.enable_retries()
- self.test_list_floating_ips_required_params()
+ self.test_list_volume_profiles_required_params()
- # Disable retries and run test_list_floating_ips_required_params.
+ # Disable retries and run test_list_volume_profiles_required_params.
_service.disable_retries()
- self.test_list_floating_ips_required_params()
+ self.test_list_volume_profiles_required_params()
@responses.activate
- def test_list_floating_ips_value_error(self):
+ def test_list_volume_profiles_value_error(self):
"""
- test_list_floating_ips_value_error()
+ test_list_volume_profiles_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/volume/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -17477,68 +15959,263 @@ def test_list_floating_ips_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_floating_ips(**req_copy)
+ _service.list_volume_profiles(**req_copy)
- def test_list_floating_ips_value_error_with_retries(self):
- # Enable retries and run test_list_floating_ips_value_error.
+ def test_list_volume_profiles_value_error_with_retries(self):
+ # Enable retries and run test_list_volume_profiles_value_error.
_service.enable_retries()
- self.test_list_floating_ips_value_error()
+ self.test_list_volume_profiles_value_error()
- # Disable retries and run test_list_floating_ips_value_error.
+ # Disable retries and run test_list_volume_profiles_value_error.
_service.disable_retries()
- self.test_list_floating_ips_value_error()
+ self.test_list_volume_profiles_value_error()
-class TestCreateFloatingIp():
+class TestGetVolumeProfile():
"""
- Test Class for create_floating_ip
+ Test Class for get_volume_profile
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_floating_ip_all_params(self):
+ def test_get_volume_profile_all_params(self):
"""
- create_floating_ip()
+ get_volume_profile()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
- responses.add(responses.POST,
+ url = preprocess_url('/volume/profiles/testString')
+ mock_response = '{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
+ status=200)
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Set up parameter values
+ name = 'testString'
- # Construct a dict representation of a ZoneIdentityByName model
- zone_identity_model = {}
- zone_identity_model['name'] = 'us-south-1'
+ # Invoke method
+ response = _service.get_volume_profile(
+ name,
+ headers={}
+ )
- # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model
- floating_ip_prototype_model = {}
- floating_ip_prototype_model['name'] = 'my-floating-ip'
- floating_ip_prototype_model['resource_group'] = resource_group_identity_model
- floating_ip_prototype_model['zone'] = zone_identity_model
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_get_volume_profile_all_params_with_retries(self):
+ # Enable retries and run test_get_volume_profile_all_params.
+ _service.enable_retries()
+ self.test_get_volume_profile_all_params()
+
+ # Disable retries and run test_get_volume_profile_all_params.
+ _service.disable_retries()
+ self.test_get_volume_profile_all_params()
+
+ @responses.activate
+ def test_get_volume_profile_value_error(self):
+ """
+ test_get_volume_profile_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/volume/profiles/testString')
+ mock_response = '{"family": "tiered", "href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- floating_ip_prototype = floating_ip_prototype_model
+ 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_volume_profile(**req_copy)
+
+
+ def test_get_volume_profile_value_error_with_retries(self):
+ # Enable retries and run test_get_volume_profile_value_error.
+ _service.enable_retries()
+ self.test_get_volume_profile_value_error()
+
+ # Disable retries and run test_get_volume_profile_value_error.
+ _service.disable_retries()
+ self.test_get_volume_profile_value_error()
+
+class TestListVolumes():
+ """
+ Test Class for list_volumes
+ """
+
+ @responses.activate
+ def test_list_volumes_all_params(self):
+ """
+ list_volumes()
+ """
+ # Set up mock
+ url = preprocess_url('/volumes')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ start = 'testString'
+ limit = 1
+ name = 'testString'
+ zone_name = 'testString'
# Invoke method
- response = _service.create_floating_ip(
- floating_ip_prototype,
+ response = _service.list_volumes(
+ start=start,
+ limit=limit,
+ name=name,
+ zone_name=zone_name,
+ 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 'name={}'.format(name) in query_string
+ assert 'zone.name={}'.format(zone_name) in query_string
+
+ def test_list_volumes_all_params_with_retries(self):
+ # Enable retries and run test_list_volumes_all_params.
+ _service.enable_retries()
+ self.test_list_volumes_all_params()
+
+ # Disable retries and run test_list_volumes_all_params.
+ _service.disable_retries()
+ self.test_list_volumes_all_params()
+
+ @responses.activate
+ def test_list_volumes_required_params(self):
+ """
+ test_list_volumes_required_params()
+ """
+ # Set up mock
+ url = preprocess_url('/volumes')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Invoke method
+ response = _service.list_volumes()
+
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_volumes_required_params_with_retries(self):
+ # Enable retries and run test_list_volumes_required_params.
+ _service.enable_retries()
+ self.test_list_volumes_required_params()
+
+ # Disable retries and run test_list_volumes_required_params.
+ _service.disable_retries()
+ self.test_list_volumes_required_params()
+
+ @responses.activate
+ def test_list_volumes_value_error(self):
+ """
+ test_list_volumes_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/volumes')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "volumes": [{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}]}'
+ 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_volumes(**req_copy)
+
+
+ def test_list_volumes_value_error_with_retries(self):
+ # Enable retries and run test_list_volumes_value_error.
+ _service.enable_retries()
+ self.test_list_volumes_value_error()
+
+ # Disable retries and run test_list_volumes_value_error.
+ _service.disable_retries()
+ self.test_list_volumes_value_error()
+
+class TestCreateVolume():
+ """
+ Test Class for create_volume
+ """
+
+ @responses.activate
+ def test_create_volume_all_params(self):
+ """
+ create_volume()
+ """
+ # Set up mock
+ url = preprocess_url('/volumes')
+ mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a VolumeProfileIdentityByName model
+ volume_profile_identity_model = {}
+ volume_profile_identity_model['name'] = '5iops-tier'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a 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 VolumePrototypeVolumeByCapacity model
+ volume_prototype_model = {}
+ volume_prototype_model['iops'] = 10000
+ volume_prototype_model['name'] = 'my-volume'
+ volume_prototype_model['profile'] = volume_profile_identity_model
+ volume_prototype_model['resource_group'] = resource_group_identity_model
+ volume_prototype_model['zone'] = zone_identity_model
+ volume_prototype_model['capacity'] = 100
+ volume_prototype_model['encryption_key'] = encryption_key_identity_model
+
+ # Set up parameter values
+ volume_prototype = volume_prototype_model
+
+ # Invoke method
+ response = _service.create_volume(
+ volume_prototype,
headers={}
)
@@ -17547,31 +16224,35 @@ def test_create_floating_ip_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == floating_ip_prototype
+ assert req_body == volume_prototype
- def test_create_floating_ip_all_params_with_retries(self):
- # Enable retries and run test_create_floating_ip_all_params.
+ def test_create_volume_all_params_with_retries(self):
+ # Enable retries and run test_create_volume_all_params.
_service.enable_retries()
- self.test_create_floating_ip_all_params()
+ self.test_create_volume_all_params()
- # Disable retries and run test_create_floating_ip_all_params.
+ # Disable retries and run test_create_volume_all_params.
_service.disable_retries()
- self.test_create_floating_ip_all_params()
+ self.test_create_volume_all_params()
@responses.activate
- def test_create_floating_ip_value_error(self):
+ def test_create_volume_value_error(self):
"""
- test_create_floating_ip_value_error()
+ test_create_volume_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/volumes')
+ mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
+ # Construct a dict representation of a VolumeProfileIdentityByName model
+ volume_profile_identity_model = {}
+ volume_profile_identity_model['name'] = '5iops-tier'
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
@@ -17580,57 +16261,54 @@ def test_create_floating_ip_value_error(self):
zone_identity_model = {}
zone_identity_model['name'] = 'us-south-1'
- # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model
- floating_ip_prototype_model = {}
- floating_ip_prototype_model['name'] = 'my-floating-ip'
- floating_ip_prototype_model['resource_group'] = resource_group_identity_model
- floating_ip_prototype_model['zone'] = zone_identity_model
+ # Construct a dict representation of a 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 VolumePrototypeVolumeByCapacity model
+ volume_prototype_model = {}
+ volume_prototype_model['iops'] = 10000
+ volume_prototype_model['name'] = 'my-volume'
+ volume_prototype_model['profile'] = volume_profile_identity_model
+ volume_prototype_model['resource_group'] = resource_group_identity_model
+ volume_prototype_model['zone'] = zone_identity_model
+ volume_prototype_model['capacity'] = 100
+ volume_prototype_model['encryption_key'] = encryption_key_identity_model
# Set up parameter values
- floating_ip_prototype = floating_ip_prototype_model
+ volume_prototype = volume_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "floating_ip_prototype": floating_ip_prototype,
+ "volume_prototype": volume_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_floating_ip(**req_copy)
+ _service.create_volume(**req_copy)
- def test_create_floating_ip_value_error_with_retries(self):
- # Enable retries and run test_create_floating_ip_value_error.
+ def test_create_volume_value_error_with_retries(self):
+ # Enable retries and run test_create_volume_value_error.
_service.enable_retries()
- self.test_create_floating_ip_value_error()
+ self.test_create_volume_value_error()
- # Disable retries and run test_create_floating_ip_value_error.
+ # Disable retries and run test_create_volume_value_error.
_service.disable_retries()
- self.test_create_floating_ip_value_error()
+ self.test_create_volume_value_error()
-class TestDeleteFloatingIp():
+class TestDeleteVolume():
"""
- Test Class for delete_floating_ip
+ Test Class for delete_volume
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_floating_ip_all_params(self):
+ def test_delete_volume_all_params(self):
"""
- delete_floating_ip()
+ delete_volume()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips/testString')
+ url = preprocess_url('/volumes/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -17639,7 +16317,7 @@ def test_delete_floating_ip_all_params(self):
id = 'testString'
# Invoke method
- response = _service.delete_floating_ip(
+ response = _service.delete_volume(
id,
headers={}
)
@@ -17648,22 +16326,22 @@ def test_delete_floating_ip_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_floating_ip_all_params_with_retries(self):
- # Enable retries and run test_delete_floating_ip_all_params.
+ def test_delete_volume_all_params_with_retries(self):
+ # Enable retries and run test_delete_volume_all_params.
_service.enable_retries()
- self.test_delete_floating_ip_all_params()
+ self.test_delete_volume_all_params()
- # Disable retries and run test_delete_floating_ip_all_params.
+ # Disable retries and run test_delete_volume_all_params.
_service.disable_retries()
- self.test_delete_floating_ip_all_params()
+ self.test_delete_volume_all_params()
@responses.activate
- def test_delete_floating_ip_value_error(self):
+ def test_delete_volume_value_error(self):
"""
- test_delete_floating_ip_value_error()
+ test_delete_volume_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips/testString')
+ url = preprocess_url('/volumes/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -17678,42 +16356,31 @@ def test_delete_floating_ip_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_floating_ip(**req_copy)
+ _service.delete_volume(**req_copy)
- def test_delete_floating_ip_value_error_with_retries(self):
- # Enable retries and run test_delete_floating_ip_value_error.
+ def test_delete_volume_value_error_with_retries(self):
+ # Enable retries and run test_delete_volume_value_error.
_service.enable_retries()
- self.test_delete_floating_ip_value_error()
+ self.test_delete_volume_value_error()
- # Disable retries and run test_delete_floating_ip_value_error.
+ # Disable retries and run test_delete_volume_value_error.
_service.disable_retries()
- self.test_delete_floating_ip_value_error()
+ self.test_delete_volume_value_error()
-class TestGetFloatingIp():
+class TestGetVolume():
"""
- Test Class for get_floating_ip
+ Test Class for get_volume
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_floating_ip_all_params(self):
+ def test_get_volume_all_params(self):
"""
- get_floating_ip()
+ get_volume()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips/testString')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/volumes/testString')
+ mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -17724,7 +16391,7 @@ def test_get_floating_ip_all_params(self):
id = 'testString'
# Invoke method
- response = _service.get_floating_ip(
+ response = _service.get_volume(
id,
headers={}
)
@@ -17733,23 +16400,23 @@ def test_get_floating_ip_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_floating_ip_all_params_with_retries(self):
- # Enable retries and run test_get_floating_ip_all_params.
+ def test_get_volume_all_params_with_retries(self):
+ # Enable retries and run test_get_volume_all_params.
_service.enable_retries()
- self.test_get_floating_ip_all_params()
+ self.test_get_volume_all_params()
- # Disable retries and run test_get_floating_ip_all_params.
+ # Disable retries and run test_get_volume_all_params.
_service.disable_retries()
- self.test_get_floating_ip_all_params()
+ self.test_get_volume_all_params()
@responses.activate
- def test_get_floating_ip_value_error(self):
+ def test_get_volume_value_error(self):
"""
- test_get_floating_ip_value_error()
+ test_get_volume_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips/testString')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/volumes/testString')
+ mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -17766,65 +16433,56 @@ def test_get_floating_ip_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_floating_ip(**req_copy)
+ _service.get_volume(**req_copy)
- def test_get_floating_ip_value_error_with_retries(self):
- # Enable retries and run test_get_floating_ip_value_error.
+ def test_get_volume_value_error_with_retries(self):
+ # Enable retries and run test_get_volume_value_error.
_service.enable_retries()
- self.test_get_floating_ip_value_error()
+ self.test_get_volume_value_error()
- # Disable retries and run test_get_floating_ip_value_error.
+ # Disable retries and run test_get_volume_value_error.
_service.disable_retries()
- self.test_get_floating_ip_value_error()
+ self.test_get_volume_value_error()
-class TestUpdateFloatingIp():
+class TestUpdateVolume():
"""
- Test Class for update_floating_ip
+ Test Class for update_volume
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_floating_ip_all_params(self):
+ def test_update_volume_all_params(self):
"""
- update_floating_ip()
+ update_volume()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips/testString')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/volumes/testString')
+ mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById model
- floating_ip_patch_target_network_interface_identity_model = {}
- floating_ip_patch_target_network_interface_identity_model['id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793'
+ # Construct a dict representation of a VolumeProfileIdentityByName model
+ volume_profile_identity_model = {}
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a dict representation of a FloatingIPPatch model
- floating_ip_patch_model = {}
- floating_ip_patch_model['name'] = 'my-floating-ip'
- floating_ip_patch_model['target'] = floating_ip_patch_target_network_interface_identity_model
+ # Construct a dict representation of a VolumePatch model
+ volume_patch_model = {}
+ volume_patch_model['capacity'] = 100
+ volume_patch_model['iops'] = 10000
+ volume_patch_model['name'] = 'my-volume'
+ volume_patch_model['profile'] = volume_profile_identity_model
# Set up parameter values
id = 'testString'
- floating_ip_patch = floating_ip_patch_model
+ volume_patch = volume_patch_model
# Invoke method
- response = _service.update_floating_ip(
+ response = _service.update_volume(
id,
- floating_ip_patch,
+ volume_patch,
headers={}
)
@@ -17833,71 +16491,73 @@ def test_update_floating_ip_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == floating_ip_patch
+ assert req_body == volume_patch
- def test_update_floating_ip_all_params_with_retries(self):
- # Enable retries and run test_update_floating_ip_all_params.
+ def test_update_volume_all_params_with_retries(self):
+ # Enable retries and run test_update_volume_all_params.
_service.enable_retries()
- self.test_update_floating_ip_all_params()
+ self.test_update_volume_all_params()
- # Disable retries and run test_update_floating_ip_all_params.
+ # Disable retries and run test_update_volume_all_params.
_service.disable_retries()
- self.test_update_floating_ip_all_params()
+ self.test_update_volume_all_params()
@responses.activate
- def test_update_floating_ip_value_error(self):
+ def test_update_volume_value_error(self):
"""
- test_update_floating_ip_value_error()
+ test_update_volume_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/floating_ips/testString')
- mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ url = preprocess_url('/volumes/testString')
+ mock_response = '{"active": true, "bandwidth": 1000, "busy": true, "capacity": 1000, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "iops": 10000, "name": "my-volume", "operating_system": {"href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64"}, "profile": {"href": "https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose", "name": "general-purpose"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_snapshot": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "name": "my-snapshot", "resource_type": "snapshot"}, "status": "available", "status_reasons": [{"code": "encryption_key_deleted", "message": "message", "more_info": "https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys"}], "volume_attachments": [{"delete_volume_on_instance_delete": true, "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "device": {"id": "80b3e36e-41f4-40e9-bd56-beae81792a68"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a", "id": "82cbf856-9cbb-45fb-b62f-d7bcef32399a", "instance": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "name": "my-volume-attachment", "type": "boot"}], "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById model
- floating_ip_patch_target_network_interface_identity_model = {}
- floating_ip_patch_target_network_interface_identity_model['id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793'
+ # Construct a dict representation of a VolumeProfileIdentityByName model
+ volume_profile_identity_model = {}
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a dict representation of a FloatingIPPatch model
- floating_ip_patch_model = {}
- floating_ip_patch_model['name'] = 'my-floating-ip'
- floating_ip_patch_model['target'] = floating_ip_patch_target_network_interface_identity_model
+ # Construct a dict representation of a VolumePatch model
+ volume_patch_model = {}
+ volume_patch_model['capacity'] = 100
+ volume_patch_model['iops'] = 10000
+ volume_patch_model['name'] = 'my-volume'
+ volume_patch_model['profile'] = volume_profile_identity_model
# Set up parameter values
id = 'testString'
- floating_ip_patch = floating_ip_patch_model
+ volume_patch = volume_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "floating_ip_patch": floating_ip_patch,
+ "volume_patch": volume_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_floating_ip(**req_copy)
+ _service.update_volume(**req_copy)
- def test_update_floating_ip_value_error_with_retries(self):
- # Enable retries and run test_update_floating_ip_value_error.
+ def test_update_volume_value_error_with_retries(self):
+ # Enable retries and run test_update_volume_value_error.
_service.enable_retries()
- self.test_update_floating_ip_value_error()
+ self.test_update_volume_value_error()
- # Disable retries and run test_update_floating_ip_value_error.
+ # Disable retries and run test_update_volume_value_error.
_service.disable_retries()
- self.test_update_floating_ip_value_error()
+ self.test_update_volume_value_error()
# endregion
##############################################################################
-# End of Service: FloatingIPs
+# End of Service: Volumes
##############################################################################
##############################################################################
-# Start of Service: NetworkACLs
+# Start of Service: Snapshots
##############################################################################
# region
@@ -17927,8 +16587,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -17937,107 +16605,189 @@ def test_new_instance_required_param_none(self):
service = VpcV1.new_instance(
version=None,
)
-class TestListNetworkAcls():
+class TestDeleteSnapshots():
"""
- Test Class for list_network_acls
+ Test Class for delete_snapshots
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_network_acls_all_params(self):
+ def test_delete_snapshots_all_params(self):
"""
- list_network_acls()
+ delete_snapshots()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
- responses.add(responses.GET,
+ url = preprocess_url('/snapshots')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- start = 'testString'
- limit = 1
- resource_group_id = 'testString'
+ source_volume_id = 'testString'
# Invoke method
- response = _service.list_network_acls(
- start=start,
- limit=limit,
- resource_group_id=resource_group_id,
+ response = _service.delete_snapshots(
+ source_volume_id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
# 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 'source_volume.id={}'.format(source_volume_id) in query_string
- def test_list_network_acls_all_params_with_retries(self):
- # Enable retries and run test_list_network_acls_all_params.
+ def test_delete_snapshots_all_params_with_retries(self):
+ # Enable retries and run test_delete_snapshots_all_params.
_service.enable_retries()
- self.test_list_network_acls_all_params()
+ self.test_delete_snapshots_all_params()
- # Disable retries and run test_list_network_acls_all_params.
+ # Disable retries and run test_delete_snapshots_all_params.
_service.disable_retries()
- self.test_list_network_acls_all_params()
+ self.test_delete_snapshots_all_params()
@responses.activate
- def test_list_network_acls_required_params(self):
+ def test_delete_snapshots_value_error(self):
"""
- test_list_network_acls_required_params()
+ test_delete_snapshots_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
- responses.add(responses.GET,
+ url = preprocess_url('/snapshots')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
- # Invoke method
- response = _service.list_network_acls()
+ # Set up parameter values
+ source_volume_id = 'testString'
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "source_volume_id": source_volume_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_snapshots(**req_copy)
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
- def test_list_network_acls_required_params_with_retries(self):
- # Enable retries and run test_list_network_acls_required_params.
+ def test_delete_snapshots_value_error_with_retries(self):
+ # Enable retries and run test_delete_snapshots_value_error.
_service.enable_retries()
- self.test_list_network_acls_required_params()
+ self.test_delete_snapshots_value_error()
- # Disable retries and run test_list_network_acls_required_params.
+ # Disable retries and run test_delete_snapshots_value_error.
_service.disable_retries()
- self.test_list_network_acls_required_params()
+ self.test_delete_snapshots_value_error()
+
+class TestListSnapshots():
+ """
+ Test Class for list_snapshots
+ """
@responses.activate
- def test_list_network_acls_value_error(self):
+ def test_list_snapshots_all_params(self):
"""
- test_list_network_acls_value_error()
+ list_snapshots()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/snapshots')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshots": [{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "total_count": 132}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ start = 'testString'
+ limit = 1
+ resource_group_id = 'testString'
+ name = 'testString'
+ source_volume_id = 'testString'
+ source_volume_crn = 'testString'
+ source_image_id = 'testString'
+ source_image_crn = 'testString'
+ sort = 'name'
+
+ # Invoke method
+ response = _service.list_snapshots(
+ start=start,
+ limit=limit,
+ resource_group_id=resource_group_id,
+ name=name,
+ source_volume_id=source_volume_id,
+ source_volume_crn=source_volume_crn,
+ source_image_id=source_image_id,
+ source_image_crn=source_image_crn,
+ 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 'resource_group.id={}'.format(resource_group_id) in query_string
+ assert 'name={}'.format(name) in query_string
+ assert 'source_volume.id={}'.format(source_volume_id) in query_string
+ assert 'source_volume.crn={}'.format(source_volume_crn) in query_string
+ assert 'source_image.id={}'.format(source_image_id) in query_string
+ assert 'source_image.crn={}'.format(source_image_crn) in query_string
+ assert 'sort={}'.format(sort) in query_string
+
+ def test_list_snapshots_all_params_with_retries(self):
+ # Enable retries and run test_list_snapshots_all_params.
+ _service.enable_retries()
+ self.test_list_snapshots_all_params()
+
+ # Disable retries and run test_list_snapshots_all_params.
+ _service.disable_retries()
+ self.test_list_snapshots_all_params()
+
+ @responses.activate
+ def test_list_snapshots_required_params(self):
+ """
+ test_list_snapshots_required_params()
+ """
+ # Set up mock
+ url = preprocess_url('/snapshots')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshots": [{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "total_count": 132}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Invoke method
+ response = _service.list_snapshots()
+
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_snapshots_required_params_with_retries(self):
+ # Enable retries and run test_list_snapshots_required_params.
+ _service.enable_retries()
+ self.test_list_snapshots_required_params()
+
+ # Disable retries and run test_list_snapshots_required_params.
+ _service.disable_retries()
+ self.test_list_snapshots_required_params()
+
+ @responses.activate
+ def test_list_snapshots_value_error(self):
+ """
+ test_list_snapshots_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/snapshots')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "snapshots": [{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -18050,82 +16800,55 @@ def test_list_network_acls_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_network_acls(**req_copy)
+ _service.list_snapshots(**req_copy)
- def test_list_network_acls_value_error_with_retries(self):
- # Enable retries and run test_list_network_acls_value_error.
+ def test_list_snapshots_value_error_with_retries(self):
+ # Enable retries and run test_list_snapshots_value_error.
_service.enable_retries()
- self.test_list_network_acls_value_error()
+ self.test_list_snapshots_value_error()
- # Disable retries and run test_list_network_acls_value_error.
+ # Disable retries and run test_list_snapshots_value_error.
_service.disable_retries()
- self.test_list_network_acls_value_error()
+ self.test_list_snapshots_value_error()
-class TestCreateNetworkAcl():
+class TestCreateSnapshot():
"""
- Test Class for create_network_acl
+ Test Class for create_snapshot
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_network_acl_all_params(self):
+ def test_create_snapshot_all_params(self):
"""
- create_network_acl()
+ create_snapshot()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/snapshots')
+ mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
+ # Construct a dict representation of a VolumeIdentityById model
+ volume_identity_model = {}
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a VPCIdentityById model
- vpc_identity_model = {}
- vpc_identity_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f'
-
- # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP model
- network_acl_rule_prototype_network_acl_context_model = {}
- network_acl_rule_prototype_network_acl_context_model['action'] = 'allow'
- network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound'
- network_acl_rule_prototype_network_acl_context_model['name'] = 'my-rule-2'
- network_acl_rule_prototype_network_acl_context_model['source'] = '192.168.3.2/32'
- network_acl_rule_prototype_network_acl_context_model['destination_port_max'] = 22
- network_acl_rule_prototype_network_acl_context_model['destination_port_min'] = 22
- network_acl_rule_prototype_network_acl_context_model['protocol'] = 'udp'
- network_acl_rule_prototype_network_acl_context_model['source_port_max'] = 65535
- network_acl_rule_prototype_network_acl_context_model['source_port_min'] = 49152
-
- # Construct a dict representation of a NetworkACLPrototypeNetworkACLByRules model
- network_acl_prototype_model = {}
- network_acl_prototype_model['name'] = 'my-network-acl'
- network_acl_prototype_model['resource_group'] = resource_group_identity_model
- network_acl_prototype_model['vpc'] = vpc_identity_model
- network_acl_prototype_model['rules'] = [network_acl_rule_prototype_network_acl_context_model]
-
# Set up parameter values
- network_acl_prototype = network_acl_prototype_model
+ source_volume = volume_identity_model
+ name = 'my-snapshot'
+ resource_group = resource_group_identity_model
# Invoke method
- response = _service.create_network_acl(
- network_acl_prototype=network_acl_prototype,
+ response = _service.create_snapshot(
+ source_volume,
+ name=name,
+ resource_group=resource_group,
headers={}
)
@@ -18134,103 +16857,77 @@ def test_create_network_acl_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == network_acl_prototype
+ assert req_body['source_volume'] == volume_identity_model
+ assert req_body['name'] == 'my-snapshot'
+ assert req_body['resource_group'] == resource_group_identity_model
- def test_create_network_acl_all_params_with_retries(self):
- # Enable retries and run test_create_network_acl_all_params.
+ def test_create_snapshot_all_params_with_retries(self):
+ # Enable retries and run test_create_snapshot_all_params.
_service.enable_retries()
- self.test_create_network_acl_all_params()
+ self.test_create_snapshot_all_params()
- # Disable retries and run test_create_network_acl_all_params.
+ # Disable retries and run test_create_snapshot_all_params.
_service.disable_retries()
- self.test_create_network_acl_all_params()
+ self.test_create_snapshot_all_params()
@responses.activate
- def test_create_network_acl_required_params(self):
+ def test_create_snapshot_value_error(self):
"""
- test_create_network_acl_required_params()
+ test_create_snapshot_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/snapshots')
+ mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Invoke method
- response = _service.create_network_acl()
-
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 201
-
- def test_create_network_acl_required_params_with_retries(self):
- # Enable retries and run test_create_network_acl_required_params.
- _service.enable_retries()
- self.test_create_network_acl_required_params()
+ # Construct a dict representation of a VolumeIdentityById model
+ volume_identity_model = {}
+ volume_identity_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Disable retries and run test_create_network_acl_required_params.
- _service.disable_retries()
- self.test_create_network_acl_required_params()
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- @responses.activate
- def test_create_network_acl_value_error(self):
- """
- test_create_network_acl_value_error()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/network_acls')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
- responses.add(responses.POST,
- url,
- body=mock_response,
- content_type='application/json',
- status=201)
+ # Set up parameter values
+ source_volume = volume_identity_model
+ name = 'my-snapshot'
+ resource_group = resource_group_identity_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "source_volume": source_volume,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_network_acl(**req_copy)
+ _service.create_snapshot(**req_copy)
- def test_create_network_acl_value_error_with_retries(self):
- # Enable retries and run test_create_network_acl_value_error.
+ def test_create_snapshot_value_error_with_retries(self):
+ # Enable retries and run test_create_snapshot_value_error.
_service.enable_retries()
- self.test_create_network_acl_value_error()
+ self.test_create_snapshot_value_error()
- # Disable retries and run test_create_network_acl_value_error.
+ # Disable retries and run test_create_snapshot_value_error.
_service.disable_retries()
- self.test_create_network_acl_value_error()
+ self.test_create_snapshot_value_error()
-class TestDeleteNetworkAcl():
+class TestDeleteSnapshot():
"""
- Test Class for delete_network_acl
+ Test Class for delete_snapshot
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_network_acl_all_params(self):
+ def test_delete_snapshot_all_params(self):
"""
- delete_network_acl()
+ delete_snapshot()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString')
+ url = preprocess_url('/snapshots/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -18239,7 +16936,7 @@ def test_delete_network_acl_all_params(self):
id = 'testString'
# Invoke method
- response = _service.delete_network_acl(
+ response = _service.delete_snapshot(
id,
headers={}
)
@@ -18248,22 +16945,22 @@ def test_delete_network_acl_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_network_acl_all_params_with_retries(self):
- # Enable retries and run test_delete_network_acl_all_params.
+ def test_delete_snapshot_all_params_with_retries(self):
+ # Enable retries and run test_delete_snapshot_all_params.
_service.enable_retries()
- self.test_delete_network_acl_all_params()
+ self.test_delete_snapshot_all_params()
- # Disable retries and run test_delete_network_acl_all_params.
+ # Disable retries and run test_delete_snapshot_all_params.
_service.disable_retries()
- self.test_delete_network_acl_all_params()
+ self.test_delete_snapshot_all_params()
@responses.activate
- def test_delete_network_acl_value_error(self):
+ def test_delete_snapshot_value_error(self):
"""
- test_delete_network_acl_value_error()
+ test_delete_snapshot_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString')
+ url = preprocess_url('/snapshots/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -18278,42 +16975,31 @@ def test_delete_network_acl_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_network_acl(**req_copy)
+ _service.delete_snapshot(**req_copy)
- def test_delete_network_acl_value_error_with_retries(self):
- # Enable retries and run test_delete_network_acl_value_error.
+ def test_delete_snapshot_value_error_with_retries(self):
+ # Enable retries and run test_delete_snapshot_value_error.
_service.enable_retries()
- self.test_delete_network_acl_value_error()
+ self.test_delete_snapshot_value_error()
- # Disable retries and run test_delete_network_acl_value_error.
+ # Disable retries and run test_delete_snapshot_value_error.
_service.disable_retries()
- self.test_delete_network_acl_value_error()
+ self.test_delete_snapshot_value_error()
-class TestGetNetworkAcl():
+class TestGetSnapshot():
"""
- Test Class for get_network_acl
+ Test Class for get_snapshot
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_network_acl_all_params(self):
+ def test_get_snapshot_all_params(self):
"""
- get_network_acl()
+ get_snapshot()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/snapshots/testString')
+ mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -18324,7 +17010,7 @@ def test_get_network_acl_all_params(self):
id = 'testString'
# Invoke method
- response = _service.get_network_acl(
+ response = _service.get_snapshot(
id,
headers={}
)
@@ -18333,23 +17019,23 @@ def test_get_network_acl_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_network_acl_all_params_with_retries(self):
- # Enable retries and run test_get_network_acl_all_params.
+ def test_get_snapshot_all_params_with_retries(self):
+ # Enable retries and run test_get_snapshot_all_params.
_service.enable_retries()
- self.test_get_network_acl_all_params()
+ self.test_get_snapshot_all_params()
- # Disable retries and run test_get_network_acl_all_params.
+ # Disable retries and run test_get_snapshot_all_params.
_service.disable_retries()
- self.test_get_network_acl_all_params()
+ self.test_get_snapshot_all_params()
@responses.activate
- def test_get_network_acl_value_error(self):
+ def test_get_snapshot_value_error(self):
"""
- test_get_network_acl_value_error()
+ test_get_snapshot_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/snapshots/testString')
+ mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -18366,60 +17052,49 @@ def test_get_network_acl_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_network_acl(**req_copy)
+ _service.get_snapshot(**req_copy)
- def test_get_network_acl_value_error_with_retries(self):
- # Enable retries and run test_get_network_acl_value_error.
+ def test_get_snapshot_value_error_with_retries(self):
+ # Enable retries and run test_get_snapshot_value_error.
_service.enable_retries()
- self.test_get_network_acl_value_error()
+ self.test_get_snapshot_value_error()
- # Disable retries and run test_get_network_acl_value_error.
+ # Disable retries and run test_get_snapshot_value_error.
_service.disable_retries()
- self.test_get_network_acl_value_error()
+ self.test_get_snapshot_value_error()
-class TestUpdateNetworkAcl():
+class TestUpdateSnapshot():
"""
- Test Class for update_network_acl
+ Test Class for update_snapshot
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_network_acl_all_params(self):
+ def test_update_snapshot_all_params(self):
"""
- update_network_acl()
+ update_snapshot()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/snapshots/testString')
+ mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a NetworkACLPatch model
- network_acl_patch_model = {}
- network_acl_patch_model['name'] = 'my-network-acl'
+ # Construct a dict representation of a SnapshotPatch model
+ snapshot_patch_model = {}
+ snapshot_patch_model['name'] = 'my-snapshot'
# Set up parameter values
id = 'testString'
- network_acl_patch = network_acl_patch_model
+ snapshot_patch = snapshot_patch_model
# Invoke method
- response = _service.update_network_acl(
+ response = _service.update_snapshot(
id,
- network_acl_patch,
+ snapshot_patch,
headers={}
)
@@ -18428,167 +17103,194 @@ def test_update_network_acl_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == network_acl_patch
+ assert req_body == snapshot_patch
- def test_update_network_acl_all_params_with_retries(self):
- # Enable retries and run test_update_network_acl_all_params.
+ def test_update_snapshot_all_params_with_retries(self):
+ # Enable retries and run test_update_snapshot_all_params.
_service.enable_retries()
- self.test_update_network_acl_all_params()
+ self.test_update_snapshot_all_params()
- # Disable retries and run test_update_network_acl_all_params.
+ # Disable retries and run test_update_snapshot_all_params.
_service.disable_retries()
- self.test_update_network_acl_all_params()
+ self.test_update_snapshot_all_params()
@responses.activate
- def test_update_network_acl_value_error(self):
+ def test_update_snapshot_value_error(self):
"""
- test_update_network_acl_value_error()
+ test_update_snapshot_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/snapshots/testString')
+ mock_response = '{"bootable": true, "captured_at": "2019-01-01T12:00:00.000Z", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "deletable": false, "encryption": "provider_managed", "encryption_key": {"crn": "crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "id": "r134-f6bfa329-0e36-433f-a3bb-0df632e79263", "lifecycle_state": "stable", "minimum_capacity": 1, "name": "my-snapshot", "operating_system": {"architecture": "amd64", "dedicated_host_only": false, "display_name": "Ubuntu Server 16.04 LTS amd64", "family": "Ubuntu Server", "href": "https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64", "name": "ubuntu-16-amd64", "vendor": "Canonical", "version": "16.04 LTS"}, "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "snapshot", "size": 1, "source_image": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "id": "72b27b5c-f4b0-48bb-b954-5becc7c1dcb8", "name": "my-image"}, "source_volume": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "id": "1a6b7274-678d-4dfb-8981-c71dd9d4daa5", "name": "my-volume"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a NetworkACLPatch model
- network_acl_patch_model = {}
- network_acl_patch_model['name'] = 'my-network-acl'
+ # Construct a dict representation of a SnapshotPatch model
+ snapshot_patch_model = {}
+ snapshot_patch_model['name'] = 'my-snapshot'
# Set up parameter values
id = 'testString'
- network_acl_patch = network_acl_patch_model
+ snapshot_patch = snapshot_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "network_acl_patch": network_acl_patch,
+ "snapshot_patch": snapshot_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_network_acl(**req_copy)
+ _service.update_snapshot(**req_copy)
- def test_update_network_acl_value_error_with_retries(self):
- # Enable retries and run test_update_network_acl_value_error.
+ def test_update_snapshot_value_error_with_retries(self):
+ # Enable retries and run test_update_snapshot_value_error.
_service.enable_retries()
- self.test_update_network_acl_value_error()
+ self.test_update_snapshot_value_error()
- # Disable retries and run test_update_network_acl_value_error.
+ # Disable retries and run test_update_snapshot_value_error.
_service.disable_retries()
- self.test_update_network_acl_value_error()
+ self.test_update_snapshot_value_error()
-class TestListNetworkAclRules():
+# endregion
+##############################################################################
+# End of Service: Snapshots
+##############################################################################
+
+##############################################################################
+# Start of Service: Geography
+##############################################################################
+# region
+
+class TestNewInstance():
"""
- Test Class for list_network_acl_rules
+ Test Class for new_instance
"""
- def preprocess_url(self, request_url: str):
+ 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):
"""
- Preprocess the request URL to ensure the mock response will be found.
+ new_instance_without_required_params()
"""
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ 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_network_acl_rules_all_params(self):
+ def test_list_regions_all_params(self):
"""
- list_network_acl_rules()
+ list_regions()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "total_count": 132}'
+ 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)
- # Set up parameter values
- network_acl_id = 'testString'
- start = 'testString'
- limit = 1
- direction = 'inbound'
-
# Invoke method
- response = _service.list_network_acl_rules(
- network_acl_id,
- start=start,
- limit=limit,
- direction=direction,
- headers={}
- )
+ response = _service.list_regions()
+
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate query params
- query_string = responses.calls[0].request.url.split('?',1)[1]
- query_string = urllib.parse.unquote_plus(query_string)
- assert 'start={}'.format(start) in query_string
- assert 'limit={}'.format(limit) in query_string
- assert 'direction={}'.format(direction) in query_string
- def test_list_network_acl_rules_all_params_with_retries(self):
- # Enable retries and run test_list_network_acl_rules_all_params.
+ def test_list_regions_all_params_with_retries(self):
+ # Enable retries and run test_list_regions_all_params.
_service.enable_retries()
- self.test_list_network_acl_rules_all_params()
+ self.test_list_regions_all_params()
- # Disable retries and run test_list_network_acl_rules_all_params.
+ # Disable retries and run test_list_regions_all_params.
_service.disable_retries()
- self.test_list_network_acl_rules_all_params()
+ self.test_list_regions_all_params()
@responses.activate
- def test_list_network_acl_rules_required_params(self):
+ def test_list_regions_value_error(self):
"""
- test_list_network_acl_rules_required_params()
+ test_list_regions_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "total_count": 132}'
+ 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)
- # Set up parameter values
- network_acl_id = 'testString'
-
- # Invoke method
- response = _service.list_network_acl_rules(
- network_acl_id,
- headers={}
- )
+ # 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)
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
- def test_list_network_acl_rules_required_params_with_retries(self):
- # Enable retries and run test_list_network_acl_rules_required_params.
+ def test_list_regions_value_error_with_retries(self):
+ # Enable retries and run test_list_regions_value_error.
_service.enable_retries()
- self.test_list_network_acl_rules_required_params()
+ self.test_list_regions_value_error()
- # Disable retries and run test_list_network_acl_rules_required_params.
+ # Disable retries and run test_list_regions_value_error.
_service.disable_retries()
- self.test_list_network_acl_rules_required_params()
+ self.test_list_regions_value_error()
+
+class TestGetRegion():
+ """
+ Test Class for get_region
+ """
@responses.activate
- def test_list_network_acl_rules_value_error(self):
+ def test_get_region_all_params(self):
"""
- test_list_network_acl_rules_value_error()
+ get_region()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "total_count": 132}'
+ 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,
@@ -18596,264 +17298,76 @@ def test_list_network_acl_rules_value_error(self):
status=200)
# Set up parameter values
- network_acl_id = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "network_acl_id": network_acl_id,
- }
- for param in req_param_dict.keys():
- req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.list_network_acl_rules(**req_copy)
-
-
- def test_list_network_acl_rules_value_error_with_retries(self):
- # Enable retries and run test_list_network_acl_rules_value_error.
- _service.enable_retries()
- self.test_list_network_acl_rules_value_error()
-
- # Disable retries and run test_list_network_acl_rules_value_error.
- _service.disable_retries()
- self.test_list_network_acl_rules_value_error()
-
-class TestCreateNetworkAclRule():
- """
- Test Class for create_network_acl_rule
- """
-
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
- @responses.activate
- def test_create_network_acl_rule_all_params(self):
- """
- create_network_acl_rule()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
- responses.add(responses.POST,
- url,
- body=mock_response,
- content_type='application/json',
- status=201)
-
- # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model
- network_acl_rule_before_prototype_model = {}
- network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
-
- # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model
- network_acl_rule_prototype_model = {}
- network_acl_rule_prototype_model['action'] = 'allow'
- network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model
- network_acl_rule_prototype_model['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_model['direction'] = 'inbound'
- network_acl_rule_prototype_model['name'] = 'my-rule-2'
- network_acl_rule_prototype_model['source'] = '192.168.3.2/32'
- network_acl_rule_prototype_model['code'] = 0
- network_acl_rule_prototype_model['protocol'] = 'icmp'
- network_acl_rule_prototype_model['type'] = 8
-
- # Set up parameter values
- network_acl_id = 'testString'
- network_acl_rule_prototype = network_acl_rule_prototype_model
+ name = 'testString'
# Invoke method
- response = _service.create_network_acl_rule(
- network_acl_id,
- network_acl_rule_prototype,
+ response = _service.get_region(
+ name,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == network_acl_rule_prototype
+ assert response.status_code == 200
- def test_create_network_acl_rule_all_params_with_retries(self):
- # Enable retries and run test_create_network_acl_rule_all_params.
+ def test_get_region_all_params_with_retries(self):
+ # Enable retries and run test_get_region_all_params.
_service.enable_retries()
- self.test_create_network_acl_rule_all_params()
+ self.test_get_region_all_params()
- # Disable retries and run test_create_network_acl_rule_all_params.
+ # Disable retries and run test_get_region_all_params.
_service.disable_retries()
- self.test_create_network_acl_rule_all_params()
+ self.test_get_region_all_params()
@responses.activate
- def test_create_network_acl_rule_value_error(self):
+ def test_get_region_value_error(self):
"""
- test_create_network_acl_rule_value_error()
+ test_get_region_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
- responses.add(responses.POST,
+ 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=201)
-
- # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model
- network_acl_rule_before_prototype_model = {}
- network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
-
- # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model
- network_acl_rule_prototype_model = {}
- network_acl_rule_prototype_model['action'] = 'allow'
- network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model
- network_acl_rule_prototype_model['destination'] = '192.168.3.2/32'
- network_acl_rule_prototype_model['direction'] = 'inbound'
- network_acl_rule_prototype_model['name'] = 'my-rule-2'
- network_acl_rule_prototype_model['source'] = '192.168.3.2/32'
- network_acl_rule_prototype_model['code'] = 0
- network_acl_rule_prototype_model['protocol'] = 'icmp'
- network_acl_rule_prototype_model['type'] = 8
-
- # Set up parameter values
- network_acl_id = 'testString'
- network_acl_rule_prototype = network_acl_rule_prototype_model
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "network_acl_id": network_acl_id,
- "network_acl_rule_prototype": network_acl_rule_prototype,
- }
- for param in req_param_dict.keys():
- req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.create_network_acl_rule(**req_copy)
-
-
- def test_create_network_acl_rule_value_error_with_retries(self):
- # Enable retries and run test_create_network_acl_rule_value_error.
- _service.enable_retries()
- self.test_create_network_acl_rule_value_error()
-
- # Disable retries and run test_create_network_acl_rule_value_error.
- _service.disable_retries()
- self.test_create_network_acl_rule_value_error()
-
-class TestDeleteNetworkAclRule():
- """
- Test Class for delete_network_acl_rule
- """
-
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
- @responses.activate
- def test_delete_network_acl_rule_all_params(self):
- """
- delete_network_acl_rule()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString')
- responses.add(responses.DELETE,
- url,
- status=204)
-
- # Set up parameter values
- network_acl_id = 'testString'
- id = 'testString'
-
- # Invoke method
- response = _service.delete_network_acl_rule(
- network_acl_id,
- id,
- headers={}
- )
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 204
-
- def test_delete_network_acl_rule_all_params_with_retries(self):
- # Enable retries and run test_delete_network_acl_rule_all_params.
- _service.enable_retries()
- self.test_delete_network_acl_rule_all_params()
-
- # Disable retries and run test_delete_network_acl_rule_all_params.
- _service.disable_retries()
- self.test_delete_network_acl_rule_all_params()
-
- @responses.activate
- def test_delete_network_acl_rule_value_error(self):
- """
- test_delete_network_acl_rule_value_error()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString')
- responses.add(responses.DELETE,
- url,
- status=204)
+ status=200)
# Set up parameter values
- network_acl_id = 'testString'
- id = 'testString'
+ name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "network_acl_id": network_acl_id,
- "id": id,
+ "name": name,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_network_acl_rule(**req_copy)
+ _service.get_region(**req_copy)
- def test_delete_network_acl_rule_value_error_with_retries(self):
- # Enable retries and run test_delete_network_acl_rule_value_error.
+ def test_get_region_value_error_with_retries(self):
+ # Enable retries and run test_get_region_value_error.
_service.enable_retries()
- self.test_delete_network_acl_rule_value_error()
+ self.test_get_region_value_error()
- # Disable retries and run test_delete_network_acl_rule_value_error.
+ # Disable retries and run test_get_region_value_error.
_service.disable_retries()
- self.test_delete_network_acl_rule_value_error()
+ self.test_get_region_value_error()
-class TestGetNetworkAclRule():
+class TestListRegionZones():
"""
- Test Class for get_network_acl_rule
+ Test Class for list_region_zones
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_network_acl_rule_all_params(self):
+ def test_list_region_zones_all_params(self):
"""
- get_network_acl_rule()
+ list_region_zones()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
+ 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,
@@ -18861,13 +17375,11 @@ def test_get_network_acl_rule_all_params(self):
status=200)
# Set up parameter values
- network_acl_id = 'testString'
- id = 'testString'
+ region_name = 'testString'
# Invoke method
- response = _service.get_network_acl_rule(
- network_acl_id,
- id,
+ response = _service.list_region_zones(
+ region_name,
headers={}
)
@@ -18875,23 +17387,23 @@ def test_get_network_acl_rule_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_network_acl_rule_all_params_with_retries(self):
- # Enable retries and run test_get_network_acl_rule_all_params.
+ def test_list_region_zones_all_params_with_retries(self):
+ # Enable retries and run test_list_region_zones_all_params.
_service.enable_retries()
- self.test_get_network_acl_rule_all_params()
+ self.test_list_region_zones_all_params()
- # Disable retries and run test_get_network_acl_rule_all_params.
+ # Disable retries and run test_list_region_zones_all_params.
_service.disable_retries()
- self.test_get_network_acl_rule_all_params()
+ self.test_list_region_zones_all_params()
@responses.activate
- def test_get_network_acl_rule_value_error(self):
+ def test_list_region_zones_value_error(self):
"""
- test_get_network_acl_rule_value_error()
+ test_list_region_zones_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
+ 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,
@@ -18899,173 +17411,115 @@ def test_get_network_acl_rule_value_error(self):
status=200)
# Set up parameter values
- network_acl_id = 'testString'
- id = 'testString'
+ region_name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "network_acl_id": network_acl_id,
- "id": id,
+ "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.get_network_acl_rule(**req_copy)
+ _service.list_region_zones(**req_copy)
- def test_get_network_acl_rule_value_error_with_retries(self):
- # Enable retries and run test_get_network_acl_rule_value_error.
+ def test_list_region_zones_value_error_with_retries(self):
+ # Enable retries and run test_list_region_zones_value_error.
_service.enable_retries()
- self.test_get_network_acl_rule_value_error()
+ self.test_list_region_zones_value_error()
- # Disable retries and run test_get_network_acl_rule_value_error.
+ # Disable retries and run test_list_region_zones_value_error.
_service.disable_retries()
- self.test_get_network_acl_rule_value_error()
+ self.test_list_region_zones_value_error()
-class TestUpdateNetworkAclRule():
+class TestGetRegionZone():
"""
- Test Class for update_network_acl_rule
+ Test Class for get_region_zone
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_network_acl_rule_all_params(self):
+ def test_get_region_zone_all_params(self):
"""
- update_network_acl_rule()
+ get_region_zone()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
- responses.add(responses.PATCH,
+ 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)
- # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model
- network_acl_rule_before_patch_model = {}
- network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
-
- # Construct a dict representation of a NetworkACLRulePatch model
- network_acl_rule_patch_model = {}
- network_acl_rule_patch_model['action'] = 'allow'
- network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model
- network_acl_rule_patch_model['code'] = 0
- network_acl_rule_patch_model['destination'] = '192.168.3.2/32'
- network_acl_rule_patch_model['destination_port_max'] = 22
- network_acl_rule_patch_model['destination_port_min'] = 22
- network_acl_rule_patch_model['direction'] = 'inbound'
- network_acl_rule_patch_model['name'] = 'my-rule-2'
- network_acl_rule_patch_model['source'] = '192.168.3.2/32'
- network_acl_rule_patch_model['source_port_max'] = 65535
- network_acl_rule_patch_model['source_port_min'] = 49152
- network_acl_rule_patch_model['type'] = 8
-
# Set up parameter values
- network_acl_id = 'testString'
- id = 'testString'
- network_acl_rule_patch = network_acl_rule_patch_model
+ region_name = 'testString'
+ name = 'testString'
# Invoke method
- response = _service.update_network_acl_rule(
- network_acl_id,
- id,
- network_acl_rule_patch,
+ response = _service.get_region_zone(
+ region_name,
+ name,
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 == network_acl_rule_patch
- def test_update_network_acl_rule_all_params_with_retries(self):
- # Enable retries and run test_update_network_acl_rule_all_params.
+ def test_get_region_zone_all_params_with_retries(self):
+ # Enable retries and run test_get_region_zone_all_params.
_service.enable_retries()
- self.test_update_network_acl_rule_all_params()
+ self.test_get_region_zone_all_params()
- # Disable retries and run test_update_network_acl_rule_all_params.
+ # Disable retries and run test_get_region_zone_all_params.
_service.disable_retries()
- self.test_update_network_acl_rule_all_params()
+ self.test_get_region_zone_all_params()
@responses.activate
- def test_update_network_acl_rule_value_error(self):
+ def test_get_region_zone_value_error(self):
"""
- test_update_network_acl_rule_value_error()
+ test_get_region_zone_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/network_acls/testString/rules/testString')
- mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
- responses.add(responses.PATCH,
+ 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)
- # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model
- network_acl_rule_before_patch_model = {}
- network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
-
- # Construct a dict representation of a NetworkACLRulePatch model
- network_acl_rule_patch_model = {}
- network_acl_rule_patch_model['action'] = 'allow'
- network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model
- network_acl_rule_patch_model['code'] = 0
- network_acl_rule_patch_model['destination'] = '192.168.3.2/32'
- network_acl_rule_patch_model['destination_port_max'] = 22
- network_acl_rule_patch_model['destination_port_min'] = 22
- network_acl_rule_patch_model['direction'] = 'inbound'
- network_acl_rule_patch_model['name'] = 'my-rule-2'
- network_acl_rule_patch_model['source'] = '192.168.3.2/32'
- network_acl_rule_patch_model['source_port_max'] = 65535
- network_acl_rule_patch_model['source_port_min'] = 49152
- network_acl_rule_patch_model['type'] = 8
-
# Set up parameter values
- network_acl_id = 'testString'
- id = 'testString'
- network_acl_rule_patch = network_acl_rule_patch_model
+ region_name = 'testString'
+ name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "network_acl_id": network_acl_id,
- "id": id,
- "network_acl_rule_patch": network_acl_rule_patch,
+ "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.update_network_acl_rule(**req_copy)
+ _service.get_region_zone(**req_copy)
- def test_update_network_acl_rule_value_error_with_retries(self):
- # Enable retries and run test_update_network_acl_rule_value_error.
+ def test_get_region_zone_value_error_with_retries(self):
+ # Enable retries and run test_get_region_zone_value_error.
_service.enable_retries()
- self.test_update_network_acl_rule_value_error()
+ self.test_get_region_zone_value_error()
- # Disable retries and run test_update_network_acl_rule_value_error.
+ # Disable retries and run test_get_region_zone_value_error.
_service.disable_retries()
- self.test_update_network_acl_rule_value_error()
+ self.test_get_region_zone_value_error()
# endregion
##############################################################################
-# End of Service: NetworkACLs
+# End of Service: Geography
##############################################################################
##############################################################################
-# Start of Service: SecurityGroups
+# Start of Service: PublicGateways
##############################################################################
# region
@@ -19095,8 +17549,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -19105,30 +17567,19 @@ def test_new_instance_required_param_none(self):
service = VpcV1.new_instance(
version=None,
)
-class TestListSecurityGroups():
+class TestListPublicGateways():
"""
- Test Class for list_security_groups
+ Test Class for list_public_gateways
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_security_groups_all_params(self):
+ def test_list_public_gateways_all_params(self):
"""
- list_security_groups()
+ list_public_gateways()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}'
+ url = preprocess_url('/public_gateways')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -19139,18 +17590,12 @@ def test_list_security_groups_all_params(self):
start = 'testString'
limit = 1
resource_group_id = 'testString'
- vpc_id = 'testString'
- vpc_crn = 'testString'
- vpc_name = 'testString'
# Invoke method
- response = _service.list_security_groups(
+ response = _service.list_public_gateways(
start=start,
limit=limit,
resource_group_id=resource_group_id,
- vpc_id=vpc_id,
- vpc_crn=vpc_crn,
- vpc_name=vpc_name,
headers={}
)
@@ -19163,27 +17608,24 @@ def test_list_security_groups_all_params(self):
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
assert 'resource_group.id={}'.format(resource_group_id) in query_string
- assert 'vpc.id={}'.format(vpc_id) in query_string
- assert 'vpc.crn={}'.format(vpc_crn) in query_string
- assert 'vpc.name={}'.format(vpc_name) in query_string
- def test_list_security_groups_all_params_with_retries(self):
- # Enable retries and run test_list_security_groups_all_params.
+ def test_list_public_gateways_all_params_with_retries(self):
+ # Enable retries and run test_list_public_gateways_all_params.
_service.enable_retries()
- self.test_list_security_groups_all_params()
+ self.test_list_public_gateways_all_params()
- # Disable retries and run test_list_security_groups_all_params.
+ # Disable retries and run test_list_public_gateways_all_params.
_service.disable_retries()
- self.test_list_security_groups_all_params()
+ self.test_list_public_gateways_all_params()
@responses.activate
- def test_list_security_groups_required_params(self):
+ def test_list_public_gateways_required_params(self):
"""
- test_list_security_groups_required_params()
+ test_list_public_gateways_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}'
+ url = preprocess_url('/public_gateways')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -19191,30 +17633,30 @@ def test_list_security_groups_required_params(self):
status=200)
# Invoke method
- response = _service.list_security_groups()
+ response = _service.list_public_gateways()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_security_groups_required_params_with_retries(self):
- # Enable retries and run test_list_security_groups_required_params.
+ def test_list_public_gateways_required_params_with_retries(self):
+ # Enable retries and run test_list_public_gateways_required_params.
_service.enable_retries()
- self.test_list_security_groups_required_params()
+ self.test_list_public_gateways_required_params()
- # Disable retries and run test_list_security_groups_required_params.
+ # Disable retries and run test_list_public_gateways_required_params.
_service.disable_retries()
- self.test_list_security_groups_required_params()
+ self.test_list_public_gateways_required_params()
@responses.activate
- def test_list_security_groups_value_error(self):
+ def test_list_public_gateways_value_error(self):
"""
- test_list_security_groups_value_error()
+ test_list_public_gateways_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}'
+ url = preprocess_url('/public_gateways')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "public_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -19227,42 +17669,31 @@ def test_list_security_groups_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_security_groups(**req_copy)
+ _service.list_public_gateways(**req_copy)
- def test_list_security_groups_value_error_with_retries(self):
- # Enable retries and run test_list_security_groups_value_error.
+ def test_list_public_gateways_value_error_with_retries(self):
+ # Enable retries and run test_list_public_gateways_value_error.
_service.enable_retries()
- self.test_list_security_groups_value_error()
+ self.test_list_public_gateways_value_error()
- # Disable retries and run test_list_security_groups_value_error.
+ # Disable retries and run test_list_public_gateways_value_error.
_service.disable_retries()
- self.test_list_security_groups_value_error()
+ self.test_list_public_gateways_value_error()
-class TestCreateSecurityGroup():
+class TestCreatePublicGateway():
"""
- Test Class for create_security_group
+ Test Class for create_public_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_security_group_all_params(self):
+ def test_create_public_gateway_all_params(self):
"""
- create_security_group()
+ create_public_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/public_gateways')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -19273,35 +17704,32 @@ def test_create_security_group_all_params(self):
vpc_identity_model = {}
vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model
+ public_gateway_floating_ip_prototype_model = {}
+ public_gateway_floating_ip_prototype_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model
- security_group_rule_remote_prototype_model = {}
- security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
-
- # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
- security_group_rule_prototype_model = {}
- security_group_rule_prototype_model['code'] = 0
- security_group_rule_prototype_model['direction'] = 'inbound'
- security_group_rule_prototype_model['ip_version'] = 'ipv4'
- security_group_rule_prototype_model['protocol'] = 'icmp'
- security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
- security_group_rule_prototype_model['type'] = 8
-
# Set up parameter values
vpc = vpc_identity_model
- name = 'my-security-group'
+ zone = zone_identity_model
+ floating_ip = public_gateway_floating_ip_prototype_model
+ name = 'my-public-gateway'
resource_group = resource_group_identity_model
- rules = [security_group_rule_prototype_model]
# Invoke method
- response = _service.create_security_group(
+ response = _service.create_public_gateway(
vpc,
+ zone,
+ floating_ip=floating_ip,
name=name,
resource_group=resource_group,
- rules=rules,
headers={}
)
@@ -19311,27 +17739,28 @@ def test_create_security_group_all_params(self):
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
assert req_body['vpc'] == vpc_identity_model
- assert req_body['name'] == 'my-security-group'
+ assert req_body['zone'] == zone_identity_model
+ assert req_body['floating_ip'] == public_gateway_floating_ip_prototype_model
+ assert req_body['name'] == 'my-public-gateway'
assert req_body['resource_group'] == resource_group_identity_model
- assert req_body['rules'] == [security_group_rule_prototype_model]
- def test_create_security_group_all_params_with_retries(self):
- # Enable retries and run test_create_security_group_all_params.
+ def test_create_public_gateway_all_params_with_retries(self):
+ # Enable retries and run test_create_public_gateway_all_params.
_service.enable_retries()
- self.test_create_security_group_all_params()
+ self.test_create_public_gateway_all_params()
- # Disable retries and run test_create_security_group_all_params.
+ # Disable retries and run test_create_public_gateway_all_params.
_service.disable_retries()
- self.test_create_security_group_all_params()
+ self.test_create_public_gateway_all_params()
@responses.activate
- def test_create_security_group_value_error(self):
+ def test_create_public_gateway_value_error(self):
"""
- test_create_security_group_value_error()
+ test_create_public_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/public_gateways')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -19342,71 +17771,57 @@ def test_create_security_group_value_error(self):
vpc_identity_model = {}
vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
- # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model
- security_group_rule_remote_prototype_model = {}
- security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
+ # Construct a dict representation of a PublicGatewayFloatingIPPrototypeFloatingIPIdentityFloatingIPIdentityById model
+ public_gateway_floating_ip_prototype_model = {}
+ public_gateway_floating_ip_prototype_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
- security_group_rule_prototype_model = {}
- security_group_rule_prototype_model['code'] = 0
- security_group_rule_prototype_model['direction'] = 'inbound'
- security_group_rule_prototype_model['ip_version'] = 'ipv4'
- security_group_rule_prototype_model['protocol'] = 'icmp'
- security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
- security_group_rule_prototype_model['type'] = 8
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
# Set up parameter values
vpc = vpc_identity_model
- name = 'my-security-group'
+ zone = zone_identity_model
+ floating_ip = public_gateway_floating_ip_prototype_model
+ name = 'my-public-gateway'
resource_group = resource_group_identity_model
- rules = [security_group_rule_prototype_model]
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"vpc": vpc,
+ "zone": zone,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_security_group(**req_copy)
+ _service.create_public_gateway(**req_copy)
- def test_create_security_group_value_error_with_retries(self):
- # Enable retries and run test_create_security_group_value_error.
+ def test_create_public_gateway_value_error_with_retries(self):
+ # Enable retries and run test_create_public_gateway_value_error.
_service.enable_retries()
- self.test_create_security_group_value_error()
+ self.test_create_public_gateway_value_error()
- # Disable retries and run test_create_security_group_value_error.
+ # Disable retries and run test_create_public_gateway_value_error.
_service.disable_retries()
- self.test_create_security_group_value_error()
+ self.test_create_public_gateway_value_error()
-class TestDeleteSecurityGroup():
+class TestDeletePublicGateway():
"""
- Test Class for delete_security_group
+ Test Class for delete_public_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_security_group_all_params(self):
+ def test_delete_public_gateway_all_params(self):
"""
- delete_security_group()
+ delete_public_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString')
+ url = preprocess_url('/public_gateways/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -19415,7 +17830,7 @@ def test_delete_security_group_all_params(self):
id = 'testString'
# Invoke method
- response = _service.delete_security_group(
+ response = _service.delete_public_gateway(
id,
headers={}
)
@@ -19424,22 +17839,22 @@ def test_delete_security_group_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_security_group_all_params_with_retries(self):
- # Enable retries and run test_delete_security_group_all_params.
+ def test_delete_public_gateway_all_params_with_retries(self):
+ # Enable retries and run test_delete_public_gateway_all_params.
_service.enable_retries()
- self.test_delete_security_group_all_params()
+ self.test_delete_public_gateway_all_params()
- # Disable retries and run test_delete_security_group_all_params.
+ # Disable retries and run test_delete_public_gateway_all_params.
_service.disable_retries()
- self.test_delete_security_group_all_params()
+ self.test_delete_public_gateway_all_params()
@responses.activate
- def test_delete_security_group_value_error(self):
+ def test_delete_public_gateway_value_error(self):
"""
- test_delete_security_group_value_error()
+ test_delete_public_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString')
+ url = preprocess_url('/public_gateways/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -19454,42 +17869,31 @@ def test_delete_security_group_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_security_group(**req_copy)
+ _service.delete_public_gateway(**req_copy)
- def test_delete_security_group_value_error_with_retries(self):
- # Enable retries and run test_delete_security_group_value_error.
+ def test_delete_public_gateway_value_error_with_retries(self):
+ # Enable retries and run test_delete_public_gateway_value_error.
_service.enable_retries()
- self.test_delete_security_group_value_error()
+ self.test_delete_public_gateway_value_error()
- # Disable retries and run test_delete_security_group_value_error.
+ # Disable retries and run test_delete_public_gateway_value_error.
_service.disable_retries()
- self.test_delete_security_group_value_error()
+ self.test_delete_public_gateway_value_error()
-class TestGetSecurityGroup():
+class TestGetPublicGateway():
"""
- Test Class for get_security_group
+ Test Class for get_public_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_security_group_all_params(self):
+ def test_get_public_gateway_all_params(self):
"""
- get_security_group()
+ get_public_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/public_gateways/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -19500,7 +17904,7 @@ def test_get_security_group_all_params(self):
id = 'testString'
# Invoke method
- response = _service.get_security_group(
+ response = _service.get_public_gateway(
id,
headers={}
)
@@ -19509,23 +17913,23 @@ def test_get_security_group_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_security_group_all_params_with_retries(self):
- # Enable retries and run test_get_security_group_all_params.
+ def test_get_public_gateway_all_params_with_retries(self):
+ # Enable retries and run test_get_public_gateway_all_params.
_service.enable_retries()
- self.test_get_security_group_all_params()
+ self.test_get_public_gateway_all_params()
- # Disable retries and run test_get_security_group_all_params.
+ # Disable retries and run test_get_public_gateway_all_params.
_service.disable_retries()
- self.test_get_security_group_all_params()
+ self.test_get_public_gateway_all_params()
@responses.activate
- def test_get_security_group_value_error(self):
+ def test_get_public_gateway_value_error(self):
"""
- test_get_security_group_value_error()
+ test_get_public_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/public_gateways/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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,
@@ -19542,60 +17946,49 @@ def test_get_security_group_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_security_group(**req_copy)
+ _service.get_public_gateway(**req_copy)
- def test_get_security_group_value_error_with_retries(self):
- # Enable retries and run test_get_security_group_value_error.
+ def test_get_public_gateway_value_error_with_retries(self):
+ # Enable retries and run test_get_public_gateway_value_error.
_service.enable_retries()
- self.test_get_security_group_value_error()
+ self.test_get_public_gateway_value_error()
- # Disable retries and run test_get_security_group_value_error.
+ # Disable retries and run test_get_public_gateway_value_error.
_service.disable_retries()
- self.test_get_security_group_value_error()
+ self.test_get_public_gateway_value_error()
-class TestUpdateSecurityGroup():
+class TestUpdatePublicGateway():
"""
- Test Class for update_security_group
+ Test Class for update_public_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_security_group_all_params(self):
+ def test_update_public_gateway_all_params(self):
"""
- update_security_group()
+ update_public_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/public_gateways/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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 SecurityGroupPatch model
- security_group_patch_model = {}
- security_group_patch_model['name'] = 'my-security-group'
+ # Construct a dict representation of a PublicGatewayPatch model
+ public_gateway_patch_model = {}
+ public_gateway_patch_model['name'] = 'my-public-gateway'
# Set up parameter values
id = 'testString'
- security_group_patch = security_group_patch_model
+ public_gateway_patch = public_gateway_patch_model
# Invoke method
- response = _service.update_security_group(
+ response = _service.update_public_gateway(
id,
- security_group_patch,
+ public_gateway_patch,
headers={}
)
@@ -19604,83 +17997,126 @@ def test_update_security_group_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == security_group_patch
+ assert req_body == public_gateway_patch
- def test_update_security_group_all_params_with_retries(self):
- # Enable retries and run test_update_security_group_all_params.
+ def test_update_public_gateway_all_params_with_retries(self):
+ # Enable retries and run test_update_public_gateway_all_params.
_service.enable_retries()
- self.test_update_security_group_all_params()
+ self.test_update_public_gateway_all_params()
- # Disable retries and run test_update_security_group_all_params.
+ # Disable retries and run test_update_public_gateway_all_params.
_service.disable_retries()
- self.test_update_security_group_all_params()
+ self.test_update_public_gateway_all_params()
@responses.activate
- def test_update_security_group_value_error(self):
+ def test_update_public_gateway_value_error(self):
"""
- test_update_security_group_value_error()
+ test_update_public_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/public_gateways/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241", "floating_ip": {"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241", "id": "dc5431ef-1fc6-4861-adc9-a59d077d1241", "name": "my-public-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "public_gateway", "status": "available", "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}, "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 SecurityGroupPatch model
- security_group_patch_model = {}
- security_group_patch_model['name'] = 'my-security-group'
+ # Construct a dict representation of a PublicGatewayPatch model
+ public_gateway_patch_model = {}
+ public_gateway_patch_model['name'] = 'my-public-gateway'
# Set up parameter values
id = 'testString'
- security_group_patch = security_group_patch_model
+ public_gateway_patch = public_gateway_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "security_group_patch": security_group_patch,
+ "public_gateway_patch": public_gateway_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_security_group(**req_copy)
+ _service.update_public_gateway(**req_copy)
- def test_update_security_group_value_error_with_retries(self):
- # Enable retries and run test_update_security_group_value_error.
+ def test_update_public_gateway_value_error_with_retries(self):
+ # Enable retries and run test_update_public_gateway_value_error.
_service.enable_retries()
- self.test_update_security_group_value_error()
+ self.test_update_public_gateway_value_error()
- # Disable retries and run test_update_security_group_value_error.
+ # Disable retries and run test_update_public_gateway_value_error.
_service.disable_retries()
- self.test_update_security_group_value_error()
+ self.test_update_public_gateway_value_error()
-class TestListSecurityGroupNetworkInterfaces():
+# endregion
+##############################################################################
+# End of Service: PublicGateways
+##############################################################################
+
+##############################################################################
+# Start of Service: FloatingIPs
+##############################################################################
+# region
+
+class TestNewInstance():
"""
- Test Class for list_security_group_network_interfaces
+ Test Class for new_instance
"""
- def preprocess_url(self, request_url: str):
+ 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):
"""
- Preprocess the request URL to ensure the mock response will be found.
+ new_instance_required_param_none()
"""
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ with pytest.raises(ValueError, match='version must be provided'):
+ service = VpcV1.new_instance(
+ version=None,
+ )
+class TestListFloatingIps():
+ """
+ Test Class for list_floating_ips
+ """
@responses.activate
- def test_list_security_group_network_interfaces_all_params(self):
+ def test_list_floating_ips_all_params(self):
"""
- list_security_group_network_interfaces()
+ list_floating_ips()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/floating_ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -19688,15 +18124,15 @@ def test_list_security_group_network_interfaces_all_params(self):
status=200)
# Set up parameter values
- security_group_id = 'testString'
start = 'testString'
limit = 1
+ resource_group_id = 'testString'
# Invoke method
- response = _service.list_security_group_network_interfaces(
- security_group_id,
+ response = _service.list_floating_ips(
start=start,
limit=limit,
+ resource_group_id=resource_group_id,
headers={}
)
@@ -19708,382 +18144,505 @@ def test_list_security_group_network_interfaces_all_params(self):
query_string = urllib.parse.unquote_plus(query_string)
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
+ assert 'resource_group.id={}'.format(resource_group_id) in query_string
- def test_list_security_group_network_interfaces_all_params_with_retries(self):
- # Enable retries and run test_list_security_group_network_interfaces_all_params.
+ def test_list_floating_ips_all_params_with_retries(self):
+ # Enable retries and run test_list_floating_ips_all_params.
_service.enable_retries()
- self.test_list_security_group_network_interfaces_all_params()
+ self.test_list_floating_ips_all_params()
- # Disable retries and run test_list_security_group_network_interfaces_all_params.
+ # Disable retries and run test_list_floating_ips_all_params.
_service.disable_retries()
- self.test_list_security_group_network_interfaces_all_params()
+ self.test_list_floating_ips_all_params()
@responses.activate
- def test_list_security_group_network_interfaces_required_params(self):
+ def test_list_floating_ips_required_params(self):
"""
- test_list_security_group_network_interfaces_required_params()
+ test_list_floating_ips_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/floating_ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Set up parameter values
- security_group_id = 'testString'
-
# Invoke method
- response = _service.list_security_group_network_interfaces(
- security_group_id,
- headers={}
- )
+ response = _service.list_floating_ips()
+
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_security_group_network_interfaces_required_params_with_retries(self):
- # Enable retries and run test_list_security_group_network_interfaces_required_params.
+ def test_list_floating_ips_required_params_with_retries(self):
+ # Enable retries and run test_list_floating_ips_required_params.
_service.enable_retries()
- self.test_list_security_group_network_interfaces_required_params()
+ self.test_list_floating_ips_required_params()
- # Disable retries and run test_list_security_group_network_interfaces_required_params.
+ # Disable retries and run test_list_floating_ips_required_params.
_service.disable_retries()
- self.test_list_security_group_network_interfaces_required_params()
+ self.test_list_floating_ips_required_params()
@responses.activate
- def test_list_security_group_network_interfaces_value_error(self):
+ def test_list_floating_ips_value_error(self):
"""
- test_list_security_group_network_interfaces_value_error()
+ test_list_floating_ips_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/floating_ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20"}, "floating_ips": [{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Set up parameter values
- security_group_id = 'testString'
-
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_security_group_network_interfaces(**req_copy)
+ _service.list_floating_ips(**req_copy)
- def test_list_security_group_network_interfaces_value_error_with_retries(self):
- # Enable retries and run test_list_security_group_network_interfaces_value_error.
+ def test_list_floating_ips_value_error_with_retries(self):
+ # Enable retries and run test_list_floating_ips_value_error.
_service.enable_retries()
- self.test_list_security_group_network_interfaces_value_error()
+ self.test_list_floating_ips_value_error()
- # Disable retries and run test_list_security_group_network_interfaces_value_error.
+ # Disable retries and run test_list_floating_ips_value_error.
_service.disable_retries()
- self.test_list_security_group_network_interfaces_value_error()
+ self.test_list_floating_ips_value_error()
-class TestRemoveSecurityGroupNetworkInterface():
+class TestCreateFloatingIp():
"""
- Test Class for remove_security_group_network_interface
+ Test Class for create_floating_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_remove_security_group_network_interface_all_params(self):
+ def test_create_floating_ip_all_params(self):
"""
- remove_security_group_network_interface()
+ create_floating_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/floating_ips')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.POST,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model
+ floating_ip_prototype_model = {}
+ floating_ip_prototype_model['name'] = 'my-floating-ip'
+ floating_ip_prototype_model['resource_group'] = resource_group_identity_model
+ floating_ip_prototype_model['zone'] = zone_identity_model
# Set up parameter values
- security_group_id = 'testString'
- id = 'testString'
+ floating_ip_prototype = floating_ip_prototype_model
# Invoke method
- response = _service.remove_security_group_network_interface(
- security_group_id,
- id,
+ response = _service.create_floating_ip(
+ floating_ip_prototype,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 201
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == floating_ip_prototype
- def test_remove_security_group_network_interface_all_params_with_retries(self):
- # Enable retries and run test_remove_security_group_network_interface_all_params.
+ def test_create_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_create_floating_ip_all_params.
_service.enable_retries()
- self.test_remove_security_group_network_interface_all_params()
+ self.test_create_floating_ip_all_params()
- # Disable retries and run test_remove_security_group_network_interface_all_params.
+ # Disable retries and run test_create_floating_ip_all_params.
_service.disable_retries()
- self.test_remove_security_group_network_interface_all_params()
+ self.test_create_floating_ip_all_params()
@responses.activate
- def test_remove_security_group_network_interface_value_error(self):
+ def test_create_floating_ip_value_error(self):
"""
- test_remove_security_group_network_interface_value_error()
+ test_create_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/floating_ips')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.POST,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a ZoneIdentityByName model
+ zone_identity_model = {}
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a dict representation of a FloatingIPPrototypeFloatingIPByZone model
+ floating_ip_prototype_model = {}
+ floating_ip_prototype_model['name'] = 'my-floating-ip'
+ floating_ip_prototype_model['resource_group'] = resource_group_identity_model
+ floating_ip_prototype_model['zone'] = zone_identity_model
# Set up parameter values
- security_group_id = 'testString'
- id = 'testString'
+ floating_ip_prototype = floating_ip_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
- "id": id,
+ "floating_ip_prototype": floating_ip_prototype,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.remove_security_group_network_interface(**req_copy)
+ _service.create_floating_ip(**req_copy)
- def test_remove_security_group_network_interface_value_error_with_retries(self):
- # Enable retries and run test_remove_security_group_network_interface_value_error.
+ def test_create_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_create_floating_ip_value_error.
_service.enable_retries()
- self.test_remove_security_group_network_interface_value_error()
+ self.test_create_floating_ip_value_error()
- # Disable retries and run test_remove_security_group_network_interface_value_error.
+ # Disable retries and run test_create_floating_ip_value_error.
_service.disable_retries()
- self.test_remove_security_group_network_interface_value_error()
+ self.test_create_floating_ip_value_error()
-class TestGetSecurityGroupNetworkInterface():
+class TestDeleteFloatingIp():
"""
- Test Class for get_security_group_network_interface
+ Test Class for delete_floating_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_security_group_network_interface_all_params(self):
+ def test_delete_floating_ip_all_params(self):
"""
- get_security_group_network_interface()
+ delete_floating_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
- responses.add(responses.GET,
+ url = preprocess_url('/floating_ips/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_security_group_network_interface(
- security_group_id,
+ response = _service.delete_floating_ip(
id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_get_security_group_network_interface_all_params_with_retries(self):
- # Enable retries and run test_get_security_group_network_interface_all_params.
+ def test_delete_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_delete_floating_ip_all_params.
_service.enable_retries()
- self.test_get_security_group_network_interface_all_params()
+ self.test_delete_floating_ip_all_params()
- # Disable retries and run test_get_security_group_network_interface_all_params.
+ # Disable retries and run test_delete_floating_ip_all_params.
_service.disable_retries()
- self.test_get_security_group_network_interface_all_params()
+ self.test_delete_floating_ip_all_params()
@responses.activate
- def test_get_security_group_network_interface_value_error(self):
+ def test_delete_floating_ip_value_error(self):
"""
- test_get_security_group_network_interface_value_error()
+ test_delete_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
- responses.add(responses.GET,
+ url = preprocess_url('/floating_ips/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_security_group_network_interface(**req_copy)
+ _service.delete_floating_ip(**req_copy)
- def test_get_security_group_network_interface_value_error_with_retries(self):
- # Enable retries and run test_get_security_group_network_interface_value_error.
+ def test_delete_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_delete_floating_ip_value_error.
_service.enable_retries()
- self.test_get_security_group_network_interface_value_error()
+ self.test_delete_floating_ip_value_error()
- # Disable retries and run test_get_security_group_network_interface_value_error.
+ # Disable retries and run test_delete_floating_ip_value_error.
_service.disable_retries()
- self.test_get_security_group_network_interface_value_error()
+ self.test_delete_floating_ip_value_error()
-class TestAddSecurityGroupNetworkInterface():
+class TestGetFloatingIp():
"""
- Test Class for add_security_group_network_interface
+ Test Class for get_floating_ip
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_add_security_group_network_interface_all_params(self):
+ def test_get_floating_ip_all_params(self):
"""
- add_security_group_network_interface()
+ get_floating_ip()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
- responses.add(responses.PUT,
+ url = preprocess_url('/floating_ips/testString')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
+ status=200)
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.add_security_group_network_interface(
- security_group_id,
+ response = _service.get_floating_ip(
id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
+ assert response.status_code == 200
- def test_add_security_group_network_interface_all_params_with_retries(self):
- # Enable retries and run test_add_security_group_network_interface_all_params.
+ def test_get_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_get_floating_ip_all_params.
_service.enable_retries()
- self.test_add_security_group_network_interface_all_params()
+ self.test_get_floating_ip_all_params()
- # Disable retries and run test_add_security_group_network_interface_all_params.
+ # Disable retries and run test_get_floating_ip_all_params.
_service.disable_retries()
- self.test_add_security_group_network_interface_all_params()
+ self.test_get_floating_ip_all_params()
@responses.activate
- def test_add_security_group_network_interface_value_error(self):
+ def test_get_floating_ip_value_error(self):
"""
- test_add_security_group_network_interface_value_error()
+ test_get_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/network_interfaces/testString')
- mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
- responses.add(responses.PUT,
+ url = preprocess_url('/floating_ips/testString')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
+ status=200)
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.add_security_group_network_interface(**req_copy)
+ _service.get_floating_ip(**req_copy)
- def test_add_security_group_network_interface_value_error_with_retries(self):
- # Enable retries and run test_add_security_group_network_interface_value_error.
+ def test_get_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_get_floating_ip_value_error.
_service.enable_retries()
- self.test_add_security_group_network_interface_value_error()
+ self.test_get_floating_ip_value_error()
- # Disable retries and run test_add_security_group_network_interface_value_error.
+ # Disable retries and run test_get_floating_ip_value_error.
_service.disable_retries()
- self.test_add_security_group_network_interface_value_error()
+ self.test_get_floating_ip_value_error()
-class TestListSecurityGroupRules():
+class TestUpdateFloatingIp():
"""
- Test Class for list_security_group_rules
+ Test Class for update_floating_ip
"""
- def preprocess_url(self, request_url: str):
+ @responses.activate
+ def test_update_floating_ip_all_params(self):
"""
- Preprocess the request URL to ensure the mock response will be found.
+ update_floating_ip()
"""
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ # Set up mock
+ url = preprocess_url('/floating_ips/testString')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a FloatingIPTargetPatchNetworkInterfaceIdentityById model
+ floating_ip_target_patch_model = {}
+ floating_ip_target_patch_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+
+ # Construct a dict representation of a FloatingIPPatch model
+ floating_ip_patch_model = {}
+ floating_ip_patch_model['name'] = 'my-floating-ip'
+ floating_ip_patch_model['target'] = floating_ip_target_patch_model
+
+ # Set up parameter values
+ id = 'testString'
+ floating_ip_patch = floating_ip_patch_model
+
+ # Invoke method
+ response = _service.update_floating_ip(
+ id,
+ floating_ip_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 == floating_ip_patch
+
+ def test_update_floating_ip_all_params_with_retries(self):
+ # Enable retries and run test_update_floating_ip_all_params.
+ _service.enable_retries()
+ self.test_update_floating_ip_all_params()
+
+ # Disable retries and run test_update_floating_ip_all_params.
+ _service.disable_retries()
+ self.test_update_floating_ip_all_params()
@responses.activate
- def test_list_security_group_rules_all_params(self):
+ def test_update_floating_ip_value_error(self):
"""
- list_security_group_rules()
+ test_update_floating_ip_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules')
- mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}'
+ url = preprocess_url('/floating_ips/testString')
+ mock_response = '{"address": "203.0.113.1", "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "status": "available", "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}, "zone": {"href": "https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1", "name": "us-south-1"}}'
+ responses.add(responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a FloatingIPTargetPatchNetworkInterfaceIdentityById model
+ floating_ip_target_patch_model = {}
+ floating_ip_target_patch_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+
+ # Construct a dict representation of a FloatingIPPatch model
+ floating_ip_patch_model = {}
+ floating_ip_patch_model['name'] = 'my-floating-ip'
+ floating_ip_patch_model['target'] = floating_ip_target_patch_model
+
+ # Set up parameter values
+ id = 'testString'
+ floating_ip_patch = floating_ip_patch_model
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ "floating_ip_patch": floating_ip_patch,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.update_floating_ip(**req_copy)
+
+
+ def test_update_floating_ip_value_error_with_retries(self):
+ # Enable retries and run test_update_floating_ip_value_error.
+ _service.enable_retries()
+ self.test_update_floating_ip_value_error()
+
+ # Disable retries and run test_update_floating_ip_value_error.
+ _service.disable_retries()
+ self.test_update_floating_ip_value_error()
+
+# endregion
+##############################################################################
+# End of Service: FloatingIPs
+##############################################################################
+
+##############################################################################
+# Start of Service: NetworkACLs
+##############################################################################
+# 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 TestListNetworkAcls():
+ """
+ Test Class for list_network_acls
+ """
+
+ @responses.activate
+ def test_list_network_acls_all_params(self):
+ """
+ list_network_acls()
+ """
+ # Set up mock
+ url = preprocess_url('/network_acls')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -20091,114 +18650,153 @@ def test_list_security_group_rules_all_params(self):
status=200)
# Set up parameter values
- security_group_id = 'testString'
+ start = 'testString'
+ limit = 1
+ resource_group_id = 'testString'
# Invoke method
- response = _service.list_security_group_rules(
- security_group_id,
+ response = _service.list_network_acls(
+ 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_security_group_rules_all_params_with_retries(self):
- # Enable retries and run test_list_security_group_rules_all_params.
+ def test_list_network_acls_all_params_with_retries(self):
+ # Enable retries and run test_list_network_acls_all_params.
_service.enable_retries()
- self.test_list_security_group_rules_all_params()
+ self.test_list_network_acls_all_params()
- # Disable retries and run test_list_security_group_rules_all_params.
+ # Disable retries and run test_list_network_acls_all_params.
_service.disable_retries()
- self.test_list_security_group_rules_all_params()
+ self.test_list_network_acls_all_params()
@responses.activate
- def test_list_security_group_rules_value_error(self):
+ def test_list_network_acls_required_params(self):
"""
- test_list_security_group_rules_value_error()
+ test_list_network_acls_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules')
- mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}'
+ url = preprocess_url('/network_acls')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Set up parameter values
- security_group_id = 'testString'
+ # Invoke method
+ response = _service.list_network_acls()
+
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_network_acls_required_params_with_retries(self):
+ # Enable retries and run test_list_network_acls_required_params.
+ _service.enable_retries()
+ self.test_list_network_acls_required_params()
+
+ # Disable retries and run test_list_network_acls_required_params.
+ _service.disable_retries()
+ self.test_list_network_acls_required_params()
+
+ @responses.activate
+ def test_list_network_acls_value_error(self):
+ """
+ test_list_network_acls_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/network_acls')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20"}, "limit": 20, "network_acls": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_security_group_rules(**req_copy)
+ _service.list_network_acls(**req_copy)
- def test_list_security_group_rules_value_error_with_retries(self):
- # Enable retries and run test_list_security_group_rules_value_error.
+ def test_list_network_acls_value_error_with_retries(self):
+ # Enable retries and run test_list_network_acls_value_error.
_service.enable_retries()
- self.test_list_security_group_rules_value_error()
+ self.test_list_network_acls_value_error()
- # Disable retries and run test_list_security_group_rules_value_error.
+ # Disable retries and run test_list_network_acls_value_error.
_service.disable_retries()
- self.test_list_security_group_rules_value_error()
+ self.test_list_network_acls_value_error()
-class TestCreateSecurityGroupRule():
+class TestCreateNetworkAcl():
"""
- Test Class for create_security_group_rule
+ Test Class for create_network_acl
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_security_group_rule_all_params(self):
+ def test_create_network_acl_all_params(self):
"""
- create_security_group_rule()
+ create_network_acl()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules')
- mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ url = preprocess_url('/network_acls')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model
- security_group_rule_remote_prototype_model = {}
- security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
- security_group_rule_prototype_model = {}
- security_group_rule_prototype_model['code'] = 0
- security_group_rule_prototype_model['direction'] = 'inbound'
- security_group_rule_prototype_model['ip_version'] = 'ipv4'
- security_group_rule_prototype_model['protocol'] = 'icmp'
- security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
- security_group_rule_prototype_model['type'] = 8
+ # Construct a dict representation of a VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f'
+
+ # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLContextNetworkACLRuleProtocolTCPUDP model
+ network_acl_rule_prototype_network_acl_context_model = {}
+ network_acl_rule_prototype_network_acl_context_model['action'] = 'allow'
+ network_acl_rule_prototype_network_acl_context_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_model['direction'] = 'inbound'
+ network_acl_rule_prototype_network_acl_context_model['name'] = 'my-rule-2'
+ network_acl_rule_prototype_network_acl_context_model['source'] = '192.168.3.2/32'
+ network_acl_rule_prototype_network_acl_context_model['destination_port_max'] = 22
+ network_acl_rule_prototype_network_acl_context_model['destination_port_min'] = 22
+ network_acl_rule_prototype_network_acl_context_model['protocol'] = 'udp'
+ network_acl_rule_prototype_network_acl_context_model['source_port_max'] = 65535
+ network_acl_rule_prototype_network_acl_context_model['source_port_min'] = 49152
+
+ # Construct a dict representation of a NetworkACLPrototypeNetworkACLByRules model
+ network_acl_prototype_model = {}
+ network_acl_prototype_model['name'] = 'my-network-acl'
+ network_acl_prototype_model['resource_group'] = resource_group_identity_model
+ network_acl_prototype_model['vpc'] = vpc_identity_model
+ network_acl_prototype_model['rules'] = [network_acl_rule_prototype_network_acl_context_model]
# Set up parameter values
- security_group_id = 'testString'
- security_group_rule_prototype = security_group_rule_prototype_model
+ network_acl_prototype = network_acl_prototype_model
# Invoke method
- response = _service.create_security_group_rule(
- security_group_id,
- security_group_rule_prototype,
+ response = _service.create_network_acl(
+ network_acl_prototype=network_acl_prototype,
headers={}
)
@@ -20207,102 +18805,101 @@ def test_create_security_group_rule_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == security_group_rule_prototype
+ assert req_body == network_acl_prototype
- def test_create_security_group_rule_all_params_with_retries(self):
- # Enable retries and run test_create_security_group_rule_all_params.
+ def test_create_network_acl_all_params_with_retries(self):
+ # Enable retries and run test_create_network_acl_all_params.
_service.enable_retries()
- self.test_create_security_group_rule_all_params()
+ self.test_create_network_acl_all_params()
- # Disable retries and run test_create_security_group_rule_all_params.
+ # Disable retries and run test_create_network_acl_all_params.
_service.disable_retries()
- self.test_create_security_group_rule_all_params()
+ self.test_create_network_acl_all_params()
@responses.activate
- def test_create_security_group_rule_value_error(self):
+ def test_create_network_acl_required_params(self):
"""
- test_create_security_group_rule_value_error()
+ test_create_network_acl_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules')
- mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ url = preprocess_url('/network_acls')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model
- security_group_rule_remote_prototype_model = {}
- security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
+ # Invoke method
+ response = _service.create_network_acl()
- # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
- security_group_rule_prototype_model = {}
- security_group_rule_prototype_model['code'] = 0
- security_group_rule_prototype_model['direction'] = 'inbound'
- security_group_rule_prototype_model['ip_version'] = 'ipv4'
- security_group_rule_prototype_model['protocol'] = 'icmp'
- security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
- security_group_rule_prototype_model['type'] = 8
- # Set up parameter values
- security_group_id = 'testString'
- security_group_rule_prototype = security_group_rule_prototype_model
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 201
+
+ def test_create_network_acl_required_params_with_retries(self):
+ # Enable retries and run test_create_network_acl_required_params.
+ _service.enable_retries()
+ self.test_create_network_acl_required_params()
+
+ # Disable retries and run test_create_network_acl_required_params.
+ _service.disable_retries()
+ self.test_create_network_acl_required_params()
+
+ @responses.activate
+ def test_create_network_acl_value_error(self):
+ """
+ test_create_network_acl_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/network_acls')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
- "security_group_rule_prototype": security_group_rule_prototype,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_security_group_rule(**req_copy)
+ _service.create_network_acl(**req_copy)
- def test_create_security_group_rule_value_error_with_retries(self):
- # Enable retries and run test_create_security_group_rule_value_error.
+ def test_create_network_acl_value_error_with_retries(self):
+ # Enable retries and run test_create_network_acl_value_error.
_service.enable_retries()
- self.test_create_security_group_rule_value_error()
+ self.test_create_network_acl_value_error()
- # Disable retries and run test_create_security_group_rule_value_error.
+ # Disable retries and run test_create_network_acl_value_error.
_service.disable_retries()
- self.test_create_security_group_rule_value_error()
+ self.test_create_network_acl_value_error()
-class TestDeleteSecurityGroupRule():
+class TestDeleteNetworkAcl():
"""
- Test Class for delete_security_group_rule
+ Test Class for delete_network_acl
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_security_group_rule_all_params(self):
+ def test_delete_network_acl_all_params(self):
"""
- delete_security_group_rule()
+ delete_network_acl()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString')
+ url = preprocess_url('/network_acls/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_security_group_rule(
- security_group_id,
+ response = _service.delete_network_acl(
id,
headers={}
)
@@ -20311,74 +18908,61 @@ def test_delete_security_group_rule_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_security_group_rule_all_params_with_retries(self):
- # Enable retries and run test_delete_security_group_rule_all_params.
+ def test_delete_network_acl_all_params_with_retries(self):
+ # Enable retries and run test_delete_network_acl_all_params.
_service.enable_retries()
- self.test_delete_security_group_rule_all_params()
+ self.test_delete_network_acl_all_params()
- # Disable retries and run test_delete_security_group_rule_all_params.
+ # Disable retries and run test_delete_network_acl_all_params.
_service.disable_retries()
- self.test_delete_security_group_rule_all_params()
+ self.test_delete_network_acl_all_params()
@responses.activate
- def test_delete_security_group_rule_value_error(self):
+ def test_delete_network_acl_value_error(self):
"""
- test_delete_security_group_rule_value_error()
+ test_delete_network_acl_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString')
+ url = preprocess_url('/network_acls/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_security_group_rule(**req_copy)
+ _service.delete_network_acl(**req_copy)
- def test_delete_security_group_rule_value_error_with_retries(self):
- # Enable retries and run test_delete_security_group_rule_value_error.
+ def test_delete_network_acl_value_error_with_retries(self):
+ # Enable retries and run test_delete_network_acl_value_error.
_service.enable_retries()
- self.test_delete_security_group_rule_value_error()
+ self.test_delete_network_acl_value_error()
- # Disable retries and run test_delete_security_group_rule_value_error.
+ # Disable retries and run test_delete_network_acl_value_error.
_service.disable_retries()
- self.test_delete_security_group_rule_value_error()
+ self.test_delete_network_acl_value_error()
-class TestGetSecurityGroupRule():
+class TestGetNetworkAcl():
"""
- Test Class for get_security_group_rule
+ Test Class for get_network_acl
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_security_group_rule_all_params(self):
+ def test_get_network_acl_all_params(self):
"""
- get_security_group_rule()
+ get_network_acl()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString')
- mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ url = preprocess_url('/network_acls/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -20386,12 +18970,10 @@ def test_get_security_group_rule_all_params(self):
status=200)
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_security_group_rule(
- security_group_id,
+ response = _service.get_network_acl(
id,
headers={}
)
@@ -20400,23 +18982,23 @@ def test_get_security_group_rule_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_security_group_rule_all_params_with_retries(self):
- # Enable retries and run test_get_security_group_rule_all_params.
+ def test_get_network_acl_all_params_with_retries(self):
+ # Enable retries and run test_get_network_acl_all_params.
_service.enable_retries()
- self.test_get_security_group_rule_all_params()
+ self.test_get_network_acl_all_params()
- # Disable retries and run test_get_security_group_rule_all_params.
+ # Disable retries and run test_get_network_acl_all_params.
_service.disable_retries()
- self.test_get_security_group_rule_all_params()
+ self.test_get_network_acl_all_params()
@responses.activate
- def test_get_security_group_rule_value_error(self):
+ def test_get_network_acl_value_error(self):
"""
- test_get_security_group_rule_value_error()
+ test_get_network_acl_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString')
- mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ url = preprocess_url('/network_acls/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -20424,83 +19006,58 @@ def test_get_security_group_rule_value_error(self):
status=200)
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_security_group_rule(**req_copy)
+ _service.get_network_acl(**req_copy)
- def test_get_security_group_rule_value_error_with_retries(self):
- # Enable retries and run test_get_security_group_rule_value_error.
+ def test_get_network_acl_value_error_with_retries(self):
+ # Enable retries and run test_get_network_acl_value_error.
_service.enable_retries()
- self.test_get_security_group_rule_value_error()
+ self.test_get_network_acl_value_error()
- # Disable retries and run test_get_security_group_rule_value_error.
+ # Disable retries and run test_get_network_acl_value_error.
_service.disable_retries()
- self.test_get_security_group_rule_value_error()
+ self.test_get_network_acl_value_error()
-class TestUpdateSecurityGroupRule():
+class TestUpdateNetworkAcl():
"""
- Test Class for update_security_group_rule
+ Test Class for update_network_acl
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_security_group_rule_all_params(self):
+ def test_update_network_acl_all_params(self):
"""
- update_security_group_rule()
+ update_network_acl()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString')
- mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ url = preprocess_url('/network_acls/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a SecurityGroupRuleRemotePatchIP model
- security_group_rule_remote_patch_model = {}
- security_group_rule_remote_patch_model['address'] = '192.168.3.4'
-
- # Construct a dict representation of a SecurityGroupRulePatch model
- security_group_rule_patch_model = {}
- security_group_rule_patch_model['code'] = 0
- security_group_rule_patch_model['direction'] = 'inbound'
- security_group_rule_patch_model['ip_version'] = 'ipv4'
- security_group_rule_patch_model['port_max'] = 22
- security_group_rule_patch_model['port_min'] = 22
- security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model
- security_group_rule_patch_model['type'] = 8
+ # Construct a dict representation of a NetworkACLPatch model
+ network_acl_patch_model = {}
+ network_acl_patch_model['name'] = 'my-network-acl'
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
- security_group_rule_patch = security_group_rule_patch_model
+ network_acl_patch = network_acl_patch_model
# Invoke method
- response = _service.update_security_group_rule(
- security_group_id,
+ response = _service.update_network_acl(
id,
- security_group_rule_patch,
+ network_acl_patch,
headers={}
)
@@ -20509,95 +19066,72 @@ def test_update_security_group_rule_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == security_group_rule_patch
+ assert req_body == network_acl_patch
- def test_update_security_group_rule_all_params_with_retries(self):
- # Enable retries and run test_update_security_group_rule_all_params.
+ def test_update_network_acl_all_params_with_retries(self):
+ # Enable retries and run test_update_network_acl_all_params.
_service.enable_retries()
- self.test_update_security_group_rule_all_params()
+ self.test_update_network_acl_all_params()
- # Disable retries and run test_update_security_group_rule_all_params.
+ # Disable retries and run test_update_network_acl_all_params.
_service.disable_retries()
- self.test_update_security_group_rule_all_params()
+ self.test_update_network_acl_all_params()
@responses.activate
- def test_update_security_group_rule_value_error(self):
+ def test_update_network_acl_value_error(self):
"""
- test_update_security_group_rule_value_error()
+ test_update_network_acl_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/rules/testString')
- mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ url = preprocess_url('/network_acls/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf", "id": "a4e28308-8ee7-46ab-8108-9f881f22bdbf", "name": "my-network-acl", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a SecurityGroupRuleRemotePatchIP model
- security_group_rule_remote_patch_model = {}
- security_group_rule_remote_patch_model['address'] = '192.168.3.4'
-
- # Construct a dict representation of a SecurityGroupRulePatch model
- security_group_rule_patch_model = {}
- security_group_rule_patch_model['code'] = 0
- security_group_rule_patch_model['direction'] = 'inbound'
- security_group_rule_patch_model['ip_version'] = 'ipv4'
- security_group_rule_patch_model['port_max'] = 22
- security_group_rule_patch_model['port_min'] = 22
- security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model
- security_group_rule_patch_model['type'] = 8
+ # Construct a dict representation of a NetworkACLPatch model
+ network_acl_patch_model = {}
+ network_acl_patch_model['name'] = 'my-network-acl'
# Set up parameter values
- security_group_id = 'testString'
id = 'testString'
- security_group_rule_patch = security_group_rule_patch_model
+ network_acl_patch = network_acl_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
"id": id,
- "security_group_rule_patch": security_group_rule_patch,
+ "network_acl_patch": network_acl_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_security_group_rule(**req_copy)
+ _service.update_network_acl(**req_copy)
- def test_update_security_group_rule_value_error_with_retries(self):
- # Enable retries and run test_update_security_group_rule_value_error.
+ def test_update_network_acl_value_error_with_retries(self):
+ # Enable retries and run test_update_network_acl_value_error.
_service.enable_retries()
- self.test_update_security_group_rule_value_error()
+ self.test_update_network_acl_value_error()
- # Disable retries and run test_update_security_group_rule_value_error.
+ # Disable retries and run test_update_network_acl_value_error.
_service.disable_retries()
- self.test_update_security_group_rule_value_error()
+ self.test_update_network_acl_value_error()
-class TestListSecurityGroupTargets():
+class TestListNetworkAclRules():
"""
- Test Class for list_security_group_targets
+ Test Class for list_network_acl_rules
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_security_group_targets_all_params(self):
+ def test_list_network_acl_rules_all_params(self):
"""
- list_security_group_targets()
+ list_network_acl_rules()
"""
# Set up mock
- url = self.preprocess_url(_base_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}'
+ url = preprocess_url('/network_acls/testString/rules')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -20605,15 +19139,17 @@ def test_list_security_group_targets_all_params(self):
status=200)
# Set up parameter values
- security_group_id = 'testString'
+ network_acl_id = 'testString'
start = 'testString'
limit = 1
+ direction = 'inbound'
# Invoke method
- response = _service.list_security_group_targets(
- security_group_id,
+ response = _service.list_network_acl_rules(
+ network_acl_id,
start=start,
limit=limit,
+ direction=direction,
headers={}
)
@@ -20625,24 +19161,25 @@ def test_list_security_group_targets_all_params(self):
query_string = urllib.parse.unquote_plus(query_string)
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
+ assert 'direction={}'.format(direction) in query_string
- def test_list_security_group_targets_all_params_with_retries(self):
- # Enable retries and run test_list_security_group_targets_all_params.
+ def test_list_network_acl_rules_all_params_with_retries(self):
+ # Enable retries and run test_list_network_acl_rules_all_params.
_service.enable_retries()
- self.test_list_security_group_targets_all_params()
+ self.test_list_network_acl_rules_all_params()
- # Disable retries and run test_list_security_group_targets_all_params.
+ # Disable retries and run test_list_network_acl_rules_all_params.
_service.disable_retries()
- self.test_list_security_group_targets_all_params()
+ self.test_list_network_acl_rules_all_params()
@responses.activate
- def test_list_security_group_targets_required_params(self):
+ def test_list_network_acl_rules_required_params(self):
"""
- test_list_security_group_targets_required_params()
+ test_list_network_acl_rules_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_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}'
+ url = preprocess_url('/network_acls/testString/rules')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -20650,11 +19187,11 @@ def test_list_security_group_targets_required_params(self):
status=200)
# Set up parameter values
- security_group_id = 'testString'
+ network_acl_id = 'testString'
# Invoke method
- response = _service.list_security_group_targets(
- security_group_id,
+ response = _service.list_network_acl_rules(
+ network_acl_id,
headers={}
)
@@ -20662,23 +19199,23 @@ def test_list_security_group_targets_required_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_security_group_targets_required_params_with_retries(self):
- # Enable retries and run test_list_security_group_targets_required_params.
+ def test_list_network_acl_rules_required_params_with_retries(self):
+ # Enable retries and run test_list_network_acl_rules_required_params.
_service.enable_retries()
- self.test_list_security_group_targets_required_params()
+ self.test_list_network_acl_rules_required_params()
- # Disable retries and run test_list_security_group_targets_required_params.
+ # Disable retries and run test_list_network_acl_rules_required_params.
_service.disable_retries()
- self.test_list_security_group_targets_required_params()
+ self.test_list_network_acl_rules_required_params()
@responses.activate
- def test_list_security_group_targets_value_error(self):
+ def test_list_network_acl_rules_value_error(self):
"""
- test_list_security_group_targets_value_error()
+ test_list_network_acl_rules_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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}'
+ url = preprocess_url('/network_acls/testString/rules')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "rules": [{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -20686,61 +19223,166 @@ def test_list_security_group_targets_value_error(self):
status=200)
# Set up parameter values
- security_group_id = 'testString'
+ network_acl_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
+ "network_acl_id": network_acl_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_security_group_targets(**req_copy)
+ _service.list_network_acl_rules(**req_copy)
- def test_list_security_group_targets_value_error_with_retries(self):
- # Enable retries and run test_list_security_group_targets_value_error.
+ def test_list_network_acl_rules_value_error_with_retries(self):
+ # Enable retries and run test_list_network_acl_rules_value_error.
_service.enable_retries()
- self.test_list_security_group_targets_value_error()
+ self.test_list_network_acl_rules_value_error()
- # Disable retries and run test_list_security_group_targets_value_error.
+ # Disable retries and run test_list_network_acl_rules_value_error.
_service.disable_retries()
- self.test_list_security_group_targets_value_error()
+ self.test_list_network_acl_rules_value_error()
-class TestDeleteSecurityGroupTargetBinding():
+class TestCreateNetworkAclRule():
"""
- Test Class for delete_security_group_target_binding
+ Test Class for create_network_acl_rule
"""
- def preprocess_url(self, request_url: str):
+ @responses.activate
+ def test_create_network_acl_rule_all_params(self):
+ """
+ create_network_acl_rule()
+ """
+ # Set up mock
+ url = preprocess_url('/network_acls/testString/rules')
+ mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model
+ network_acl_rule_before_prototype_model = {}
+ network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+
+ # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model
+ network_acl_rule_prototype_model = {}
+ network_acl_rule_prototype_model['action'] = 'allow'
+ network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model
+ network_acl_rule_prototype_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_model['direction'] = 'inbound'
+ network_acl_rule_prototype_model['name'] = 'my-rule-2'
+ network_acl_rule_prototype_model['source'] = '192.168.3.2/32'
+ network_acl_rule_prototype_model['code'] = 0
+ network_acl_rule_prototype_model['protocol'] = 'icmp'
+ network_acl_rule_prototype_model['type'] = 8
+
+ # Set up parameter values
+ network_acl_id = 'testString'
+ network_acl_rule_prototype = network_acl_rule_prototype_model
+
+ # Invoke method
+ response = _service.create_network_acl_rule(
+ network_acl_id,
+ network_acl_rule_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 == network_acl_rule_prototype
+
+ def test_create_network_acl_rule_all_params_with_retries(self):
+ # Enable retries and run test_create_network_acl_rule_all_params.
+ _service.enable_retries()
+ self.test_create_network_acl_rule_all_params()
+
+ # Disable retries and run test_create_network_acl_rule_all_params.
+ _service.disable_retries()
+ self.test_create_network_acl_rule_all_params()
+
+ @responses.activate
+ def test_create_network_acl_rule_value_error(self):
"""
- Preprocess the request URL to ensure the mock response will be found.
+ test_create_network_acl_rule_value_error()
"""
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ # Set up mock
+ url = preprocess_url('/network_acls/testString/rules')
+ mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a NetworkACLRuleBeforePrototypeNetworkACLRuleIdentityById model
+ network_acl_rule_before_prototype_model = {}
+ network_acl_rule_before_prototype_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+
+ # Construct a dict representation of a NetworkACLRulePrototypeNetworkACLRuleProtocolICMP model
+ network_acl_rule_prototype_model = {}
+ network_acl_rule_prototype_model['action'] = 'allow'
+ network_acl_rule_prototype_model['before'] = network_acl_rule_before_prototype_model
+ network_acl_rule_prototype_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_prototype_model['direction'] = 'inbound'
+ network_acl_rule_prototype_model['name'] = 'my-rule-2'
+ network_acl_rule_prototype_model['source'] = '192.168.3.2/32'
+ network_acl_rule_prototype_model['code'] = 0
+ network_acl_rule_prototype_model['protocol'] = 'icmp'
+ network_acl_rule_prototype_model['type'] = 8
+
+ # Set up parameter values
+ network_acl_id = 'testString'
+ network_acl_rule_prototype = network_acl_rule_prototype_model
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "network_acl_id": network_acl_id,
+ "network_acl_rule_prototype": network_acl_rule_prototype,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.create_network_acl_rule(**req_copy)
+
+
+ def test_create_network_acl_rule_value_error_with_retries(self):
+ # Enable retries and run test_create_network_acl_rule_value_error.
+ _service.enable_retries()
+ self.test_create_network_acl_rule_value_error()
+
+ # Disable retries and run test_create_network_acl_rule_value_error.
+ _service.disable_retries()
+ self.test_create_network_acl_rule_value_error()
+
+class TestDeleteNetworkAclRule():
+ """
+ Test Class for delete_network_acl_rule
+ """
@responses.activate
- def test_delete_security_group_target_binding_all_params(self):
+ def test_delete_network_acl_rule_all_params(self):
"""
- delete_security_group_target_binding()
+ delete_network_acl_rule()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/targets/testString')
+ url = preprocess_url('/network_acls/testString/rules/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- security_group_id = 'testString'
+ network_acl_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_security_group_target_binding(
- security_group_id,
+ response = _service.delete_network_acl_rule(
+ network_acl_id,
id,
headers={}
)
@@ -20749,74 +19391,63 @@ def test_delete_security_group_target_binding_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_security_group_target_binding_all_params_with_retries(self):
- # Enable retries and run test_delete_security_group_target_binding_all_params.
+ def test_delete_network_acl_rule_all_params_with_retries(self):
+ # Enable retries and run test_delete_network_acl_rule_all_params.
_service.enable_retries()
- self.test_delete_security_group_target_binding_all_params()
+ self.test_delete_network_acl_rule_all_params()
- # Disable retries and run test_delete_security_group_target_binding_all_params.
+ # Disable retries and run test_delete_network_acl_rule_all_params.
_service.disable_retries()
- self.test_delete_security_group_target_binding_all_params()
+ self.test_delete_network_acl_rule_all_params()
@responses.activate
- def test_delete_security_group_target_binding_value_error(self):
+ def test_delete_network_acl_rule_value_error(self):
"""
- test_delete_security_group_target_binding_value_error()
+ test_delete_network_acl_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/security_groups/testString/targets/testString')
+ url = preprocess_url('/network_acls/testString/rules/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- security_group_id = 'testString'
+ network_acl_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
+ "network_acl_id": network_acl_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_security_group_target_binding(**req_copy)
+ _service.delete_network_acl_rule(**req_copy)
- def test_delete_security_group_target_binding_value_error_with_retries(self):
- # Enable retries and run test_delete_security_group_target_binding_value_error.
+ def test_delete_network_acl_rule_value_error_with_retries(self):
+ # Enable retries and run test_delete_network_acl_rule_value_error.
_service.enable_retries()
- self.test_delete_security_group_target_binding_value_error()
+ self.test_delete_network_acl_rule_value_error()
- # Disable retries and run test_delete_security_group_target_binding_value_error.
+ # Disable retries and run test_delete_network_acl_rule_value_error.
_service.disable_retries()
- self.test_delete_security_group_target_binding_value_error()
+ self.test_delete_network_acl_rule_value_error()
-class TestGetSecurityGroupTarget():
+class TestGetNetworkAclRule():
"""
- Test Class for get_security_group_target
+ Test Class for get_network_acl_rule
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_security_group_target_all_params(self):
+ def test_get_network_acl_rule_all_params(self):
"""
- get_security_group_target()
+ get_network_acl_rule()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}'
+ url = preprocess_url('/network_acls/testString/rules/testString')
+ mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -20824,12 +19455,12 @@ def test_get_security_group_target_all_params(self):
status=200)
# Set up parameter values
- security_group_id = 'testString'
+ network_acl_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_security_group_target(
- security_group_id,
+ response = _service.get_network_acl_rule(
+ network_acl_id,
id,
headers={}
)
@@ -20838,23 +19469,23 @@ def test_get_security_group_target_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_security_group_target_all_params_with_retries(self):
- # Enable retries and run test_get_security_group_target_all_params.
+ def test_get_network_acl_rule_all_params_with_retries(self):
+ # Enable retries and run test_get_network_acl_rule_all_params.
_service.enable_retries()
- self.test_get_security_group_target_all_params()
+ self.test_get_network_acl_rule_all_params()
- # Disable retries and run test_get_security_group_target_all_params.
+ # Disable retries and run test_get_network_acl_rule_all_params.
_service.disable_retries()
- self.test_get_security_group_target_all_params()
+ self.test_get_network_acl_rule_all_params()
@responses.activate
- def test_get_security_group_target_value_error(self):
+ def test_get_network_acl_rule_value_error(self):
"""
- test_get_security_group_target_value_error()
+ test_get_network_acl_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}'
+ url = preprocess_url('/network_acls/testString/rules/testString')
+ mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -20862,128 +19493,162 @@ def test_get_security_group_target_value_error(self):
status=200)
# Set up parameter values
- security_group_id = 'testString'
+ network_acl_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
+ "network_acl_id": network_acl_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_security_group_target(**req_copy)
+ _service.get_network_acl_rule(**req_copy)
- def test_get_security_group_target_value_error_with_retries(self):
- # Enable retries and run test_get_security_group_target_value_error.
+ def test_get_network_acl_rule_value_error_with_retries(self):
+ # Enable retries and run test_get_network_acl_rule_value_error.
_service.enable_retries()
- self.test_get_security_group_target_value_error()
+ self.test_get_network_acl_rule_value_error()
- # Disable retries and run test_get_security_group_target_value_error.
+ # Disable retries and run test_get_network_acl_rule_value_error.
_service.disable_retries()
- self.test_get_security_group_target_value_error()
+ self.test_get_network_acl_rule_value_error()
-class TestCreateSecurityGroupTargetBinding():
+class TestUpdateNetworkAclRule():
"""
- Test Class for create_security_group_target_binding
+ Test Class for update_network_acl_rule
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_security_group_target_binding_all_params(self):
+ def test_update_network_acl_rule_all_params(self):
"""
- create_security_group_target_binding()
+ update_network_acl_rule()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}'
- responses.add(responses.PUT,
+ url = preprocess_url('/network_acls/testString/rules/testString')
+ mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
+ responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=201)
+ status=200)
+
+ # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model
+ network_acl_rule_before_patch_model = {}
+ network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+
+ # Construct a dict representation of a NetworkACLRulePatch model
+ network_acl_rule_patch_model = {}
+ network_acl_rule_patch_model['action'] = 'allow'
+ network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model
+ network_acl_rule_patch_model['code'] = 0
+ network_acl_rule_patch_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_patch_model['destination_port_max'] = 22
+ network_acl_rule_patch_model['destination_port_min'] = 22
+ network_acl_rule_patch_model['direction'] = 'inbound'
+ network_acl_rule_patch_model['name'] = 'my-rule-2'
+ network_acl_rule_patch_model['source'] = '192.168.3.2/32'
+ network_acl_rule_patch_model['source_port_max'] = 65535
+ network_acl_rule_patch_model['source_port_min'] = 49152
+ network_acl_rule_patch_model['type'] = 8
# Set up parameter values
- security_group_id = 'testString'
+ network_acl_id = 'testString'
id = 'testString'
+ network_acl_rule_patch = network_acl_rule_patch_model
# Invoke method
- response = _service.create_security_group_target_binding(
- security_group_id,
+ response = _service.update_network_acl_rule(
+ network_acl_id,
id,
+ network_acl_rule_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == network_acl_rule_patch
- def test_create_security_group_target_binding_all_params_with_retries(self):
- # Enable retries and run test_create_security_group_target_binding_all_params.
+ def test_update_network_acl_rule_all_params_with_retries(self):
+ # Enable retries and run test_update_network_acl_rule_all_params.
_service.enable_retries()
- self.test_create_security_group_target_binding_all_params()
+ self.test_update_network_acl_rule_all_params()
- # Disable retries and run test_create_security_group_target_binding_all_params.
+ # Disable retries and run test_update_network_acl_rule_all_params.
_service.disable_retries()
- self.test_create_security_group_target_binding_all_params()
+ self.test_update_network_acl_rule_all_params()
@responses.activate
- def test_create_security_group_target_binding_value_error(self):
+ def test_update_network_acl_rule_value_error(self):
"""
- test_create_security_group_target_binding_value_error()
+ test_update_network_acl_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}'
- responses.add(responses.PUT,
+ url = preprocess_url('/network_acls/testString/rules/testString')
+ mock_response = '{"action": "allow", "before": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "name": "my-rule-1"}, "created_at": "2019-01-01T12:00:00.000Z", "destination": "192.168.3.0/24", "direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9", "id": "8daca77a-4980-4d33-8f3e-7038797be8f9", "ip_version": "ipv4", "name": "my-rule-2", "source": "192.168.3.0/24", "code": 0, "protocol": "icmp", "type": 8}'
+ responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=201)
+ status=200)
+
+ # Construct a dict representation of a NetworkACLRuleBeforePatchNetworkACLRuleIdentityById model
+ network_acl_rule_before_patch_model = {}
+ network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+
+ # Construct a dict representation of a NetworkACLRulePatch model
+ network_acl_rule_patch_model = {}
+ network_acl_rule_patch_model['action'] = 'allow'
+ network_acl_rule_patch_model['before'] = network_acl_rule_before_patch_model
+ network_acl_rule_patch_model['code'] = 0
+ network_acl_rule_patch_model['destination'] = '192.168.3.2/32'
+ network_acl_rule_patch_model['destination_port_max'] = 22
+ network_acl_rule_patch_model['destination_port_min'] = 22
+ network_acl_rule_patch_model['direction'] = 'inbound'
+ network_acl_rule_patch_model['name'] = 'my-rule-2'
+ network_acl_rule_patch_model['source'] = '192.168.3.2/32'
+ network_acl_rule_patch_model['source_port_max'] = 65535
+ network_acl_rule_patch_model['source_port_min'] = 49152
+ network_acl_rule_patch_model['type'] = 8
# Set up parameter values
- security_group_id = 'testString'
+ network_acl_id = 'testString'
id = 'testString'
+ network_acl_rule_patch = network_acl_rule_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "security_group_id": security_group_id,
+ "network_acl_id": network_acl_id,
"id": id,
+ "network_acl_rule_patch": network_acl_rule_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_security_group_target_binding(**req_copy)
+ _service.update_network_acl_rule(**req_copy)
- def test_create_security_group_target_binding_value_error_with_retries(self):
- # Enable retries and run test_create_security_group_target_binding_value_error.
+ def test_update_network_acl_rule_value_error_with_retries(self):
+ # Enable retries and run test_update_network_acl_rule_value_error.
_service.enable_retries()
- self.test_create_security_group_target_binding_value_error()
+ self.test_update_network_acl_rule_value_error()
- # Disable retries and run test_create_security_group_target_binding_value_error.
+ # Disable retries and run test_update_network_acl_rule_value_error.
_service.disable_retries()
- self.test_create_security_group_target_binding_value_error()
+ self.test_update_network_acl_rule_value_error()
# endregion
##############################################################################
-# End of Service: SecurityGroups
+# End of Service: NetworkACLs
##############################################################################
##############################################################################
-# Start of Service: VPNGateways
+# Start of Service: SecurityGroups
##############################################################################
# region
@@ -21013,8 +19678,16 @@ def test_new_instance_without_authenticator(self):
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()
@@ -21023,30 +19696,19 @@ def test_new_instance_required_param_none(self):
service = VpcV1.new_instance(
version=None,
)
-class TestListIkePolicies():
+class TestListSecurityGroups():
"""
- Test Class for list_ike_policies
+ Test Class for list_security_groups
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_ike_policies_all_params(self):
+ def test_list_security_groups_all_params(self):
"""
- list_ike_policies()
+ list_security_groups()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -21056,11 +19718,19 @@ def test_list_ike_policies_all_params(self):
# Set up parameter values
start = 'testString'
limit = 1
+ resource_group_id = 'testString'
+ vpc_id = 'testString'
+ vpc_crn = 'testString'
+ vpc_name = 'testString'
# Invoke method
- response = _service.list_ike_policies(
+ response = _service.list_security_groups(
start=start,
limit=limit,
+ resource_group_id=resource_group_id,
+ vpc_id=vpc_id,
+ vpc_crn=vpc_crn,
+ vpc_name=vpc_name,
headers={}
)
@@ -21072,24 +19742,28 @@ def test_list_ike_policies_all_params(self):
query_string = urllib.parse.unquote_plus(query_string)
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
+ assert 'resource_group.id={}'.format(resource_group_id) in query_string
+ assert 'vpc.id={}'.format(vpc_id) in query_string
+ assert 'vpc.crn={}'.format(vpc_crn) in query_string
+ assert 'vpc.name={}'.format(vpc_name) in query_string
- def test_list_ike_policies_all_params_with_retries(self):
- # Enable retries and run test_list_ike_policies_all_params.
+ def test_list_security_groups_all_params_with_retries(self):
+ # Enable retries and run test_list_security_groups_all_params.
_service.enable_retries()
- self.test_list_ike_policies_all_params()
+ self.test_list_security_groups_all_params()
- # Disable retries and run test_list_ike_policies_all_params.
+ # Disable retries and run test_list_security_groups_all_params.
_service.disable_retries()
- self.test_list_ike_policies_all_params()
+ self.test_list_security_groups_all_params()
@responses.activate
- def test_list_ike_policies_required_params(self):
+ def test_list_security_groups_required_params(self):
"""
- test_list_ike_policies_required_params()
+ test_list_security_groups_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -21097,30 +19771,30 @@ def test_list_ike_policies_required_params(self):
status=200)
# Invoke method
- response = _service.list_ike_policies()
+ response = _service.list_security_groups()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_ike_policies_required_params_with_retries(self):
- # Enable retries and run test_list_ike_policies_required_params.
+ def test_list_security_groups_required_params_with_retries(self):
+ # Enable retries and run test_list_security_groups_required_params.
_service.enable_retries()
- self.test_list_ike_policies_required_params()
+ self.test_list_security_groups_required_params()
- # Disable retries and run test_list_ike_policies_required_params.
+ # Disable retries and run test_list_security_groups_required_params.
_service.disable_retries()
- self.test_list_ike_policies_required_params()
+ self.test_list_security_groups_required_params()
@responses.activate
- def test_list_ike_policies_value_error(self):
+ def test_list_security_groups_value_error(self):
"""
- test_list_ike_policies_value_error()
+ test_list_security_groups_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "security_groups": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -21133,70 +19807,70 @@ def test_list_ike_policies_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_ike_policies(**req_copy)
+ _service.list_security_groups(**req_copy)
- def test_list_ike_policies_value_error_with_retries(self):
- # Enable retries and run test_list_ike_policies_value_error.
+ def test_list_security_groups_value_error_with_retries(self):
+ # Enable retries and run test_list_security_groups_value_error.
_service.enable_retries()
- self.test_list_ike_policies_value_error()
+ self.test_list_security_groups_value_error()
- # Disable retries and run test_list_ike_policies_value_error.
+ # Disable retries and run test_list_security_groups_value_error.
_service.disable_retries()
- self.test_list_ike_policies_value_error()
+ self.test_list_security_groups_value_error()
-class TestCreateIkePolicy():
+class TestCreateSecurityGroup():
"""
- Test Class for create_ike_policy
+ Test Class for create_security_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_ike_policy_all_params(self):
+ def test_create_security_group_all_params(self):
"""
- create_ike_policy()
+ create_security_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
+ # Construct a dict representation of a VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Set up parameter values
- authentication_algorithm = 'md5'
- dh_group = 14
- encryption_algorithm = 'aes128'
- ike_version = 1
- key_lifetime = 28800
- name = 'my-ike-policy'
+ # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model
+ security_group_rule_remote_prototype_model = {}
+ security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
+
+ # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
+ security_group_rule_prototype_model = {}
+ security_group_rule_prototype_model['code'] = 0
+ security_group_rule_prototype_model['direction'] = 'inbound'
+ security_group_rule_prototype_model['ip_version'] = 'ipv4'
+ security_group_rule_prototype_model['protocol'] = 'icmp'
+ security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
+ security_group_rule_prototype_model['type'] = 8
+
+ # Set up parameter values
+ vpc = vpc_identity_model
+ name = 'my-security-group'
resource_group = resource_group_identity_model
+ rules = [security_group_rule_prototype_model]
# Invoke method
- response = _service.create_ike_policy(
- authentication_algorithm,
- dh_group,
- encryption_algorithm,
- ike_version,
- key_lifetime=key_lifetime,
+ response = _service.create_security_group(
+ vpc,
name=name,
resource_group=resource_group,
+ rules=rules,
headers={}
)
@@ -21205,95 +19879,92 @@ def test_create_ike_policy_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['authentication_algorithm'] == 'md5'
- assert req_body['dh_group'] == 14
- assert req_body['encryption_algorithm'] == 'aes128'
- assert req_body['ike_version'] == 1
- assert req_body['key_lifetime'] == 28800
- assert req_body['name'] == 'my-ike-policy'
+ assert req_body['vpc'] == vpc_identity_model
+ assert req_body['name'] == 'my-security-group'
assert req_body['resource_group'] == resource_group_identity_model
+ assert req_body['rules'] == [security_group_rule_prototype_model]
- def test_create_ike_policy_all_params_with_retries(self):
- # Enable retries and run test_create_ike_policy_all_params.
+ def test_create_security_group_all_params_with_retries(self):
+ # Enable retries and run test_create_security_group_all_params.
_service.enable_retries()
- self.test_create_ike_policy_all_params()
+ self.test_create_security_group_all_params()
- # Disable retries and run test_create_ike_policy_all_params.
+ # Disable retries and run test_create_security_group_all_params.
_service.disable_retries()
- self.test_create_ike_policy_all_params()
+ self.test_create_security_group_all_params()
@responses.activate
- def test_create_ike_policy_value_error(self):
+ def test_create_security_group_value_error(self):
"""
- test_create_ike_policy_value_error()
+ test_create_security_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
+ url = preprocess_url('/security_groups')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
+ # Construct a dict representation of a VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+
# Construct a dict representation of a ResourceGroupIdentityById model
resource_group_identity_model = {}
resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model
+ security_group_rule_remote_prototype_model = {}
+ security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
+
+ # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
+ security_group_rule_prototype_model = {}
+ security_group_rule_prototype_model['code'] = 0
+ security_group_rule_prototype_model['direction'] = 'inbound'
+ security_group_rule_prototype_model['ip_version'] = 'ipv4'
+ security_group_rule_prototype_model['protocol'] = 'icmp'
+ security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
+ security_group_rule_prototype_model['type'] = 8
+
# Set up parameter values
- authentication_algorithm = 'md5'
- dh_group = 14
- encryption_algorithm = 'aes128'
- ike_version = 1
- key_lifetime = 28800
- name = 'my-ike-policy'
+ vpc = vpc_identity_model
+ name = 'my-security-group'
resource_group = resource_group_identity_model
+ rules = [security_group_rule_prototype_model]
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "authentication_algorithm": authentication_algorithm,
- "dh_group": dh_group,
- "encryption_algorithm": encryption_algorithm,
- "ike_version": ike_version,
+ "vpc": vpc,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_ike_policy(**req_copy)
+ _service.create_security_group(**req_copy)
- def test_create_ike_policy_value_error_with_retries(self):
- # Enable retries and run test_create_ike_policy_value_error.
+ def test_create_security_group_value_error_with_retries(self):
+ # Enable retries and run test_create_security_group_value_error.
_service.enable_retries()
- self.test_create_ike_policy_value_error()
+ self.test_create_security_group_value_error()
- # Disable retries and run test_create_ike_policy_value_error.
+ # Disable retries and run test_create_security_group_value_error.
_service.disable_retries()
- self.test_create_ike_policy_value_error()
+ self.test_create_security_group_value_error()
-class TestDeleteIkePolicy():
+class TestDeleteSecurityGroup():
"""
- Test Class for delete_ike_policy
+ Test Class for delete_security_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_ike_policy_all_params(self):
+ def test_delete_security_group_all_params(self):
"""
- delete_ike_policy()
+ delete_security_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies/testString')
+ url = preprocess_url('/security_groups/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -21302,7 +19973,7 @@ def test_delete_ike_policy_all_params(self):
id = 'testString'
# Invoke method
- response = _service.delete_ike_policy(
+ response = _service.delete_security_group(
id,
headers={}
)
@@ -21311,22 +19982,22 @@ def test_delete_ike_policy_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_ike_policy_all_params_with_retries(self):
- # Enable retries and run test_delete_ike_policy_all_params.
+ def test_delete_security_group_all_params_with_retries(self):
+ # Enable retries and run test_delete_security_group_all_params.
_service.enable_retries()
- self.test_delete_ike_policy_all_params()
+ self.test_delete_security_group_all_params()
- # Disable retries and run test_delete_ike_policy_all_params.
+ # Disable retries and run test_delete_security_group_all_params.
_service.disable_retries()
- self.test_delete_ike_policy_all_params()
+ self.test_delete_security_group_all_params()
@responses.activate
- def test_delete_ike_policy_value_error(self):
+ def test_delete_security_group_value_error(self):
"""
- test_delete_ike_policy_value_error()
+ test_delete_security_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies/testString')
+ url = preprocess_url('/security_groups/testString')
responses.add(responses.DELETE,
url,
status=204)
@@ -21341,42 +20012,31 @@ def test_delete_ike_policy_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_ike_policy(**req_copy)
+ _service.delete_security_group(**req_copy)
- def test_delete_ike_policy_value_error_with_retries(self):
- # Enable retries and run test_delete_ike_policy_value_error.
+ def test_delete_security_group_value_error_with_retries(self):
+ # Enable retries and run test_delete_security_group_value_error.
_service.enable_retries()
- self.test_delete_ike_policy_value_error()
+ self.test_delete_security_group_value_error()
- # Disable retries and run test_delete_ike_policy_value_error.
+ # Disable retries and run test_delete_security_group_value_error.
_service.disable_retries()
- self.test_delete_ike_policy_value_error()
+ self.test_delete_security_group_value_error()
-class TestGetIkePolicy():
+class TestGetSecurityGroup():
"""
- Test Class for get_ike_policy
+ Test Class for get_security_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_ike_policy_all_params(self):
+ def test_get_security_group_all_params(self):
"""
- get_ike_policy()
+ get_security_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies/testString')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
+ url = preprocess_url('/security_groups/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -21387,7 +20047,7 @@ def test_get_ike_policy_all_params(self):
id = 'testString'
# Invoke method
- response = _service.get_ike_policy(
+ response = _service.get_security_group(
id,
headers={}
)
@@ -21396,23 +20056,23 @@ def test_get_ike_policy_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_ike_policy_all_params_with_retries(self):
- # Enable retries and run test_get_ike_policy_all_params.
+ def test_get_security_group_all_params_with_retries(self):
+ # Enable retries and run test_get_security_group_all_params.
_service.enable_retries()
- self.test_get_ike_policy_all_params()
+ self.test_get_security_group_all_params()
- # Disable retries and run test_get_ike_policy_all_params.
+ # Disable retries and run test_get_security_group_all_params.
_service.disable_retries()
- self.test_get_ike_policy_all_params()
+ self.test_get_security_group_all_params()
@responses.activate
- def test_get_ike_policy_value_error(self):
+ def test_get_security_group_value_error(self):
"""
- test_get_ike_policy_value_error()
+ test_get_security_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies/testString')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
+ url = preprocess_url('/security_groups/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -21429,65 +20089,49 @@ def test_get_ike_policy_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_ike_policy(**req_copy)
+ _service.get_security_group(**req_copy)
- def test_get_ike_policy_value_error_with_retries(self):
- # Enable retries and run test_get_ike_policy_value_error.
+ def test_get_security_group_value_error_with_retries(self):
+ # Enable retries and run test_get_security_group_value_error.
_service.enable_retries()
- self.test_get_ike_policy_value_error()
+ self.test_get_security_group_value_error()
- # Disable retries and run test_get_ike_policy_value_error.
+ # Disable retries and run test_get_security_group_value_error.
_service.disable_retries()
- self.test_get_ike_policy_value_error()
+ self.test_get_security_group_value_error()
-class TestUpdateIkePolicy():
+class TestUpdateSecurityGroup():
"""
- Test Class for update_ike_policy
+ Test Class for update_security_group
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_ike_policy_all_params(self):
+ def test_update_security_group_all_params(self):
"""
- update_ike_policy()
+ update_security_group()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies/testString')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
+ url = preprocess_url('/security_groups/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a IKEPolicyPatch model
- ike_policy_patch_model = {}
- ike_policy_patch_model['authentication_algorithm'] = 'md5'
- ike_policy_patch_model['dh_group'] = 14
- ike_policy_patch_model['encryption_algorithm'] = 'aes128'
- ike_policy_patch_model['ike_version'] = 1
- ike_policy_patch_model['key_lifetime'] = 28800
- ike_policy_patch_model['name'] = 'my-ike-policy'
+ # Construct a dict representation of a SecurityGroupPatch model
+ security_group_patch_model = {}
+ security_group_patch_model['name'] = 'my-security-group'
# Set up parameter values
id = 'testString'
- ike_policy_patch = ike_policy_patch_model
+ security_group_patch = security_group_patch_model
# Invoke method
- response = _service.update_ike_policy(
+ response = _service.update_security_group(
id,
- ike_policy_patch,
+ security_group_patch,
headers={}
)
@@ -21496,88 +20140,117 @@ def test_update_ike_policy_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == ike_policy_patch
+ assert req_body == security_group_patch
- def test_update_ike_policy_all_params_with_retries(self):
- # Enable retries and run test_update_ike_policy_all_params.
+ def test_update_security_group_all_params_with_retries(self):
+ # Enable retries and run test_update_security_group_all_params.
_service.enable_retries()
- self.test_update_ike_policy_all_params()
+ self.test_update_security_group_all_params()
- # Disable retries and run test_update_ike_policy_all_params.
+ # Disable retries and run test_update_security_group_all_params.
_service.disable_retries()
- self.test_update_ike_policy_all_params()
+ self.test_update_security_group_all_params()
@responses.activate
- def test_update_ike_policy_value_error(self):
+ def test_update_security_group_value_error(self):
"""
- test_update_ike_policy_value_error()
+ test_update_security_group_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies/testString')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
+ url = preprocess_url('/security_groups/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group", "network_interfaces": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}], "targets": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}], "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a IKEPolicyPatch model
- ike_policy_patch_model = {}
- ike_policy_patch_model['authentication_algorithm'] = 'md5'
- ike_policy_patch_model['dh_group'] = 14
- ike_policy_patch_model['encryption_algorithm'] = 'aes128'
- ike_policy_patch_model['ike_version'] = 1
- ike_policy_patch_model['key_lifetime'] = 28800
- ike_policy_patch_model['name'] = 'my-ike-policy'
+ # Construct a dict representation of a SecurityGroupPatch model
+ security_group_patch_model = {}
+ security_group_patch_model['name'] = 'my-security-group'
# Set up parameter values
id = 'testString'
- ike_policy_patch = ike_policy_patch_model
+ security_group_patch = security_group_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
- "ike_policy_patch": ike_policy_patch,
+ "security_group_patch": security_group_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_ike_policy(**req_copy)
+ _service.update_security_group(**req_copy)
- def test_update_ike_policy_value_error_with_retries(self):
- # Enable retries and run test_update_ike_policy_value_error.
+ def test_update_security_group_value_error_with_retries(self):
+ # Enable retries and run test_update_security_group_value_error.
_service.enable_retries()
- self.test_update_ike_policy_value_error()
+ self.test_update_security_group_value_error()
- # Disable retries and run test_update_ike_policy_value_error.
+ # Disable retries and run test_update_security_group_value_error.
_service.disable_retries()
- self.test_update_ike_policy_value_error()
+ self.test_update_security_group_value_error()
-class TestListIkePolicyConnections():
+class TestListSecurityGroupNetworkInterfaces():
"""
- Test Class for list_ike_policy_connections
+ Test Class for list_security_group_network_interfaces
"""
- def preprocess_url(self, request_url: str):
+ @responses.activate
+ def test_list_security_group_network_interfaces_all_params(self):
"""
- Preprocess the request URL to ensure the mock response will be found.
+ list_security_group_network_interfaces()
"""
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ # Set up mock
+ url = preprocess_url('/security_groups/testString/network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ security_group_id = 'testString'
+ start = 'testString'
+ limit = 1
+
+ # Invoke method
+ response = _service.list_security_group_network_interfaces(
+ security_group_id,
+ start=start,
+ limit=limit,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?',1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
+
+ def test_list_security_group_network_interfaces_all_params_with_retries(self):
+ # Enable retries and run test_list_security_group_network_interfaces_all_params.
+ _service.enable_retries()
+ self.test_list_security_group_network_interfaces_all_params()
+
+ # Disable retries and run test_list_security_group_network_interfaces_all_params.
+ _service.disable_retries()
+ self.test_list_security_group_network_interfaces_all_params()
@responses.activate
- def test_list_ike_policy_connections_all_params(self):
+ def test_list_security_group_network_interfaces_required_params(self):
"""
- list_ike_policy_connections()
+ test_list_security_group_network_interfaces_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies/testString/connections')
- mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
+ url = preprocess_url('/security_groups/testString/network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -21585,11 +20258,11 @@ def test_list_ike_policy_connections_all_params(self):
status=200)
# Set up parameter values
- id = 'testString'
+ security_group_id = 'testString'
# Invoke method
- response = _service.list_ike_policy_connections(
- id,
+ response = _service.list_security_group_network_interfaces(
+ security_group_id,
headers={}
)
@@ -21597,23 +20270,23 @@ def test_list_ike_policy_connections_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_ike_policy_connections_all_params_with_retries(self):
- # Enable retries and run test_list_ike_policy_connections_all_params.
+ def test_list_security_group_network_interfaces_required_params_with_retries(self):
+ # Enable retries and run test_list_security_group_network_interfaces_required_params.
_service.enable_retries()
- self.test_list_ike_policy_connections_all_params()
+ self.test_list_security_group_network_interfaces_required_params()
- # Disable retries and run test_list_ike_policy_connections_all_params.
+ # Disable retries and run test_list_security_group_network_interfaces_required_params.
_service.disable_retries()
- self.test_list_ike_policy_connections_all_params()
+ self.test_list_security_group_network_interfaces_required_params()
@responses.activate
- def test_list_ike_policy_connections_value_error(self):
+ def test_list_security_group_network_interfaces_value_error(self):
"""
- test_list_ike_policy_connections_value_error()
+ test_list_security_group_network_interfaces_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ike_policies/testString/connections')
- mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
+ url = preprocess_url('/security_groups/testString/network_interfaces')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20"}, "limit": 20, "network_interfaces": [{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -21621,663 +20294,736 @@ def test_list_ike_policy_connections_value_error(self):
status=200)
# Set up parameter values
- id = 'testString'
+ security_group_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
+ "security_group_id": security_group_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_ike_policy_connections(**req_copy)
+ _service.list_security_group_network_interfaces(**req_copy)
- def test_list_ike_policy_connections_value_error_with_retries(self):
- # Enable retries and run test_list_ike_policy_connections_value_error.
+ def test_list_security_group_network_interfaces_value_error_with_retries(self):
+ # Enable retries and run test_list_security_group_network_interfaces_value_error.
_service.enable_retries()
- self.test_list_ike_policy_connections_value_error()
+ self.test_list_security_group_network_interfaces_value_error()
- # Disable retries and run test_list_ike_policy_connections_value_error.
+ # Disable retries and run test_list_security_group_network_interfaces_value_error.
_service.disable_retries()
- self.test_list_ike_policy_connections_value_error()
+ self.test_list_security_group_network_interfaces_value_error()
-class TestListIpsecPolicies():
+class TestRemoveSecurityGroupNetworkInterface():
"""
- Test Class for list_ipsec_policies
+ Test Class for remove_security_group_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_ipsec_policies_all_params(self):
+ def test_remove_security_group_network_interface_all_params(self):
"""
- list_ipsec_policies()
+ remove_security_group_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
- responses.add(responses.GET,
+ url = preprocess_url('/security_groups/testString/network_interfaces/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- start = 'testString'
- limit = 1
+ security_group_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_ipsec_policies(
- start=start,
- limit=limit,
+ response = _service.remove_security_group_network_interface(
+ security_group_id,
+ id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
- # Validate query params
- query_string = responses.calls[0].request.url.split('?',1)[1]
- query_string = urllib.parse.unquote_plus(query_string)
- assert 'start={}'.format(start) in query_string
- assert 'limit={}'.format(limit) in query_string
+ assert response.status_code == 204
- def test_list_ipsec_policies_all_params_with_retries(self):
- # Enable retries and run test_list_ipsec_policies_all_params.
+ def test_remove_security_group_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_remove_security_group_network_interface_all_params.
_service.enable_retries()
- self.test_list_ipsec_policies_all_params()
+ self.test_remove_security_group_network_interface_all_params()
- # Disable retries and run test_list_ipsec_policies_all_params.
+ # Disable retries and run test_remove_security_group_network_interface_all_params.
_service.disable_retries()
- self.test_list_ipsec_policies_all_params()
+ self.test_remove_security_group_network_interface_all_params()
@responses.activate
- def test_list_ipsec_policies_required_params(self):
+ def test_remove_security_group_network_interface_value_error(self):
"""
- test_list_ipsec_policies_required_params()
+ test_remove_security_group_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/security_groups/testString/network_interfaces/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ security_group_id = 'testString'
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "security_group_id": security_group_id,
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.remove_security_group_network_interface(**req_copy)
+
+
+ def test_remove_security_group_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_remove_security_group_network_interface_value_error.
+ _service.enable_retries()
+ self.test_remove_security_group_network_interface_value_error()
+
+ # Disable retries and run test_remove_security_group_network_interface_value_error.
+ _service.disable_retries()
+ self.test_remove_security_group_network_interface_value_error()
+
+class TestGetSecurityGroupNetworkInterface():
+ """
+ Test Class for get_security_group_network_interface
+ """
+
+ @responses.activate
+ def test_get_security_group_network_interface_all_params(self):
+ """
+ get_security_group_network_interface()
+ """
+ # Set up mock
+ url = preprocess_url('/security_groups/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Invoke method
- response = _service.list_ipsec_policies()
+ # Set up parameter values
+ security_group_id = 'testString'
+ id = 'testString'
+ # Invoke method
+ response = _service.get_security_group_network_interface(
+ security_group_id,
+ id,
+ headers={}
+ )
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_ipsec_policies_required_params_with_retries(self):
- # Enable retries and run test_list_ipsec_policies_required_params.
+ def test_get_security_group_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_get_security_group_network_interface_all_params.
_service.enable_retries()
- self.test_list_ipsec_policies_required_params()
+ self.test_get_security_group_network_interface_all_params()
- # Disable retries and run test_list_ipsec_policies_required_params.
+ # Disable retries and run test_get_security_group_network_interface_all_params.
_service.disable_retries()
- self.test_list_ipsec_policies_required_params()
+ self.test_get_security_group_network_interface_all_params()
@responses.activate
- def test_list_ipsec_policies_value_error(self):
+ def test_get_security_group_network_interface_value_error(self):
"""
- test_list_ipsec_policies_value_error()
+ test_get_security_group_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/security_groups/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
+ # Set up parameter values
+ security_group_id = 'testString'
+ id = 'testString'
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "security_group_id": security_group_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_ipsec_policies(**req_copy)
+ _service.get_security_group_network_interface(**req_copy)
- def test_list_ipsec_policies_value_error_with_retries(self):
- # Enable retries and run test_list_ipsec_policies_value_error.
+ def test_get_security_group_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_get_security_group_network_interface_value_error.
_service.enable_retries()
- self.test_list_ipsec_policies_value_error()
+ self.test_get_security_group_network_interface_value_error()
- # Disable retries and run test_list_ipsec_policies_value_error.
+ # Disable retries and run test_get_security_group_network_interface_value_error.
_service.disable_retries()
- self.test_list_ipsec_policies_value_error()
+ self.test_get_security_group_network_interface_value_error()
-class TestCreateIpsecPolicy():
+class TestAddSecurityGroupNetworkInterface():
"""
- Test Class for create_ipsec_policy
+ Test Class for add_security_group_network_interface
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_ipsec_policy_all_params(self):
+ def test_add_security_group_network_interface_all_params(self):
"""
- create_ipsec_policy()
+ add_security_group_network_interface()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
- responses.add(responses.POST,
+ url = preprocess_url('/security_groups/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
+ responses.add(responses.PUT,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
# Set up parameter values
- authentication_algorithm = 'md5'
- encryption_algorithm = 'aes128'
- pfs = 'disabled'
- key_lifetime = 3600
- name = 'my-ipsec-policy'
- resource_group = resource_group_identity_model
+ security_group_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.create_ipsec_policy(
- authentication_algorithm,
- encryption_algorithm,
- pfs,
- key_lifetime=key_lifetime,
- name=name,
- resource_group=resource_group,
+ response = _service.add_security_group_network_interface(
+ security_group_id,
+ id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 201
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['authentication_algorithm'] == 'md5'
- assert req_body['encryption_algorithm'] == 'aes128'
- assert req_body['pfs'] == 'disabled'
- assert req_body['key_lifetime'] == 3600
- assert req_body['name'] == 'my-ipsec-policy'
- assert req_body['resource_group'] == resource_group_identity_model
- def test_create_ipsec_policy_all_params_with_retries(self):
- # Enable retries and run test_create_ipsec_policy_all_params.
+ def test_add_security_group_network_interface_all_params_with_retries(self):
+ # Enable retries and run test_add_security_group_network_interface_all_params.
_service.enable_retries()
- self.test_create_ipsec_policy_all_params()
+ self.test_add_security_group_network_interface_all_params()
- # Disable retries and run test_create_ipsec_policy_all_params.
+ # Disable retries and run test_add_security_group_network_interface_all_params.
_service.disable_retries()
- self.test_create_ipsec_policy_all_params()
+ self.test_add_security_group_network_interface_all_params()
@responses.activate
- def test_create_ipsec_policy_value_error(self):
+ def test_add_security_group_network_interface_value_error(self):
"""
- test_create_ipsec_policy_value_error()
+ test_add_security_group_network_interface_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
- responses.add(responses.POST,
+ url = preprocess_url('/security_groups/testString/network_interfaces/testString')
+ mock_response = '{"allow_ip_spoofing": true, "created_at": "2019-01-01T12:00:00.000Z", "floating_ips": [{"address": "203.0.113.1", "crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689", "id": "39300233-9995-4806-89a5-3c1b6eb88689", "name": "my-floating-ip"}], "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "port_speed": 1000, "primary_ipv4_address": "192.168.3.4", "resource_type": "network_interface", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "type": "primary"}'
+ responses.add(responses.PUT,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
# Set up parameter values
- authentication_algorithm = 'md5'
- encryption_algorithm = 'aes128'
- pfs = 'disabled'
- key_lifetime = 3600
- name = 'my-ipsec-policy'
- resource_group = resource_group_identity_model
+ security_group_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "authentication_algorithm": authentication_algorithm,
- "encryption_algorithm": encryption_algorithm,
- "pfs": pfs,
+ "security_group_id": security_group_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_ipsec_policy(**req_copy)
+ _service.add_security_group_network_interface(**req_copy)
- def test_create_ipsec_policy_value_error_with_retries(self):
- # Enable retries and run test_create_ipsec_policy_value_error.
+ def test_add_security_group_network_interface_value_error_with_retries(self):
+ # Enable retries and run test_add_security_group_network_interface_value_error.
_service.enable_retries()
- self.test_create_ipsec_policy_value_error()
+ self.test_add_security_group_network_interface_value_error()
- # Disable retries and run test_create_ipsec_policy_value_error.
+ # Disable retries and run test_add_security_group_network_interface_value_error.
_service.disable_retries()
- self.test_create_ipsec_policy_value_error()
+ self.test_add_security_group_network_interface_value_error()
-class TestDeleteIpsecPolicy():
+class TestListSecurityGroupRules():
"""
- Test Class for delete_ipsec_policy
+ Test Class for list_security_group_rules
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_ipsec_policy_all_params(self):
+ def test_list_security_group_rules_all_params(self):
"""
- delete_ipsec_policy()
+ list_security_group_rules()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/security_groups/testString/rules')
+ mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}'
+ responses.add(responses.GET,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- id = 'testString'
+ security_group_id = 'testString'
# Invoke method
- response = _service.delete_ipsec_policy(
- id,
+ response = _service.list_security_group_rules(
+ security_group_id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
- def test_delete_ipsec_policy_all_params_with_retries(self):
- # Enable retries and run test_delete_ipsec_policy_all_params.
+ def test_list_security_group_rules_all_params_with_retries(self):
+ # Enable retries and run test_list_security_group_rules_all_params.
_service.enable_retries()
- self.test_delete_ipsec_policy_all_params()
+ self.test_list_security_group_rules_all_params()
- # Disable retries and run test_delete_ipsec_policy_all_params.
+ # Disable retries and run test_list_security_group_rules_all_params.
_service.disable_retries()
- self.test_delete_ipsec_policy_all_params()
+ self.test_list_security_group_rules_all_params()
@responses.activate
- def test_delete_ipsec_policy_value_error(self):
+ def test_list_security_group_rules_value_error(self):
"""
- test_delete_ipsec_policy_value_error()
+ test_list_security_group_rules_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/security_groups/testString/rules')
+ mock_response = '{"rules": [{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}]}'
+ responses.add(responses.GET,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- id = 'testString'
+ security_group_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
+ "security_group_id": security_group_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_ipsec_policy(**req_copy)
+ _service.list_security_group_rules(**req_copy)
- def test_delete_ipsec_policy_value_error_with_retries(self):
- # Enable retries and run test_delete_ipsec_policy_value_error.
+ def test_list_security_group_rules_value_error_with_retries(self):
+ # Enable retries and run test_list_security_group_rules_value_error.
_service.enable_retries()
- self.test_delete_ipsec_policy_value_error()
+ self.test_list_security_group_rules_value_error()
- # Disable retries and run test_delete_ipsec_policy_value_error.
+ # Disable retries and run test_list_security_group_rules_value_error.
_service.disable_retries()
- self.test_delete_ipsec_policy_value_error()
+ self.test_list_security_group_rules_value_error()
-class TestGetIpsecPolicy():
+class TestCreateSecurityGroupRule():
"""
- Test Class for get_ipsec_policy
+ Test Class for create_security_group_rule
"""
- def preprocess_url(self, request_url: str):
+ @responses.activate
+ def test_create_security_group_rule_all_params(self):
"""
- Preprocess the request URL to ensure the mock response will be found.
+ create_security_group_rule()
"""
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ # Set up mock
+ url = preprocess_url('/security_groups/testString/rules')
+ mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model
+ security_group_rule_remote_prototype_model = {}
+ security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
+
+ # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
+ security_group_rule_prototype_model = {}
+ security_group_rule_prototype_model['code'] = 0
+ security_group_rule_prototype_model['direction'] = 'inbound'
+ security_group_rule_prototype_model['ip_version'] = 'ipv4'
+ security_group_rule_prototype_model['protocol'] = 'icmp'
+ security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
+ security_group_rule_prototype_model['type'] = 8
+
+ # Set up parameter values
+ security_group_id = 'testString'
+ security_group_rule_prototype = security_group_rule_prototype_model
+
+ # Invoke method
+ response = _service.create_security_group_rule(
+ security_group_id,
+ security_group_rule_prototype,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 201
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == security_group_rule_prototype
+
+ def test_create_security_group_rule_all_params_with_retries(self):
+ # Enable retries and run test_create_security_group_rule_all_params.
+ _service.enable_retries()
+ self.test_create_security_group_rule_all_params()
+
+ # Disable retries and run test_create_security_group_rule_all_params.
+ _service.disable_retries()
+ self.test_create_security_group_rule_all_params()
@responses.activate
- def test_get_ipsec_policy_all_params(self):
+ def test_create_security_group_rule_value_error(self):
"""
- get_ipsec_policy()
+ test_create_security_group_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies/testString')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
- responses.add(responses.GET,
+ url = preprocess_url('/security_groups/testString/rules')
+ mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200)
+ status=201)
+
+ # Construct a dict representation of a SecurityGroupRuleRemotePrototypeIP model
+ security_group_rule_remote_prototype_model = {}
+ security_group_rule_remote_prototype_model['address'] = '192.168.3.4'
+
+ # Construct a dict representation of a SecurityGroupRulePrototypeSecurityGroupRuleProtocolICMP model
+ security_group_rule_prototype_model = {}
+ security_group_rule_prototype_model['code'] = 0
+ security_group_rule_prototype_model['direction'] = 'inbound'
+ security_group_rule_prototype_model['ip_version'] = 'ipv4'
+ security_group_rule_prototype_model['protocol'] = 'icmp'
+ security_group_rule_prototype_model['remote'] = security_group_rule_remote_prototype_model
+ security_group_rule_prototype_model['type'] = 8
+
+ # Set up parameter values
+ security_group_id = 'testString'
+ security_group_rule_prototype = security_group_rule_prototype_model
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "security_group_id": security_group_id,
+ "security_group_rule_prototype": security_group_rule_prototype,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.create_security_group_rule(**req_copy)
+
+
+ def test_create_security_group_rule_value_error_with_retries(self):
+ # Enable retries and run test_create_security_group_rule_value_error.
+ _service.enable_retries()
+ self.test_create_security_group_rule_value_error()
+
+ # Disable retries and run test_create_security_group_rule_value_error.
+ _service.disable_retries()
+ self.test_create_security_group_rule_value_error()
+
+class TestDeleteSecurityGroupRule():
+ """
+ Test Class for delete_security_group_rule
+ """
+
+ @responses.activate
+ def test_delete_security_group_rule_all_params(self):
+ """
+ delete_security_group_rule()
+ """
+ # Set up mock
+ url = preprocess_url('/security_groups/testString/rules/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_ipsec_policy(
+ response = _service.delete_security_group_rule(
+ security_group_id,
id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_get_ipsec_policy_all_params_with_retries(self):
- # Enable retries and run test_get_ipsec_policy_all_params.
+ def test_delete_security_group_rule_all_params_with_retries(self):
+ # Enable retries and run test_delete_security_group_rule_all_params.
_service.enable_retries()
- self.test_get_ipsec_policy_all_params()
+ self.test_delete_security_group_rule_all_params()
- # Disable retries and run test_get_ipsec_policy_all_params.
+ # Disable retries and run test_delete_security_group_rule_all_params.
_service.disable_retries()
- self.test_get_ipsec_policy_all_params()
+ self.test_delete_security_group_rule_all_params()
@responses.activate
- def test_get_ipsec_policy_value_error(self):
+ def test_delete_security_group_rule_value_error(self):
"""
- test_get_ipsec_policy_value_error()
+ test_delete_security_group_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies/testString')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
- responses.add(responses.GET,
+ url = preprocess_url('/security_groups/testString/rules/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "security_group_id": security_group_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_ipsec_policy(**req_copy)
+ _service.delete_security_group_rule(**req_copy)
- def test_get_ipsec_policy_value_error_with_retries(self):
- # Enable retries and run test_get_ipsec_policy_value_error.
+ def test_delete_security_group_rule_value_error_with_retries(self):
+ # Enable retries and run test_delete_security_group_rule_value_error.
_service.enable_retries()
- self.test_get_ipsec_policy_value_error()
+ self.test_delete_security_group_rule_value_error()
- # Disable retries and run test_get_ipsec_policy_value_error.
+ # Disable retries and run test_delete_security_group_rule_value_error.
_service.disable_retries()
- self.test_get_ipsec_policy_value_error()
+ self.test_delete_security_group_rule_value_error()
-class TestUpdateIpsecPolicy():
+class TestGetSecurityGroupRule():
"""
- Test Class for update_ipsec_policy
+ Test Class for get_security_group_rule
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_ipsec_policy_all_params(self):
+ def test_get_security_group_rule_all_params(self):
"""
- update_ipsec_policy()
+ get_security_group_rule()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies/testString')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/security_groups/testString/rules/testString')
+ mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a IPsecPolicyPatch model
- i_psec_policy_patch_model = {}
- i_psec_policy_patch_model['authentication_algorithm'] = 'md5'
- i_psec_policy_patch_model['encryption_algorithm'] = 'aes128'
- i_psec_policy_patch_model['key_lifetime'] = 3600
- i_psec_policy_patch_model['name'] = 'my-ipsec-policy'
- i_psec_policy_patch_model['pfs'] = 'disabled'
-
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
- i_psec_policy_patch = i_psec_policy_patch_model
# Invoke method
- response = _service.update_ipsec_policy(
+ response = _service.get_security_group_rule(
+ security_group_id,
id,
- i_psec_policy_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == i_psec_policy_patch
- def test_update_ipsec_policy_all_params_with_retries(self):
- # Enable retries and run test_update_ipsec_policy_all_params.
+ def test_get_security_group_rule_all_params_with_retries(self):
+ # Enable retries and run test_get_security_group_rule_all_params.
_service.enable_retries()
- self.test_update_ipsec_policy_all_params()
+ self.test_get_security_group_rule_all_params()
- # Disable retries and run test_update_ipsec_policy_all_params.
+ # Disable retries and run test_get_security_group_rule_all_params.
_service.disable_retries()
- self.test_update_ipsec_policy_all_params()
+ self.test_get_security_group_rule_all_params()
@responses.activate
- def test_update_ipsec_policy_value_error(self):
+ def test_get_security_group_rule_value_error(self):
"""
- test_update_ipsec_policy_value_error()
+ test_get_security_group_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies/testString')
- mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/security_groups/testString/rules/testString')
+ mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a IPsecPolicyPatch model
- i_psec_policy_patch_model = {}
- i_psec_policy_patch_model['authentication_algorithm'] = 'md5'
- i_psec_policy_patch_model['encryption_algorithm'] = 'aes128'
- i_psec_policy_patch_model['key_lifetime'] = 3600
- i_psec_policy_patch_model['name'] = 'my-ipsec-policy'
- i_psec_policy_patch_model['pfs'] = 'disabled'
-
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
- i_psec_policy_patch = i_psec_policy_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "security_group_id": security_group_id,
"id": id,
- "i_psec_policy_patch": i_psec_policy_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_ipsec_policy(**req_copy)
+ _service.get_security_group_rule(**req_copy)
- def test_update_ipsec_policy_value_error_with_retries(self):
- # Enable retries and run test_update_ipsec_policy_value_error.
+ def test_get_security_group_rule_value_error_with_retries(self):
+ # Enable retries and run test_get_security_group_rule_value_error.
_service.enable_retries()
- self.test_update_ipsec_policy_value_error()
+ self.test_get_security_group_rule_value_error()
- # Disable retries and run test_update_ipsec_policy_value_error.
+ # Disable retries and run test_get_security_group_rule_value_error.
_service.disable_retries()
- self.test_update_ipsec_policy_value_error()
+ self.test_get_security_group_rule_value_error()
-class TestListIpsecPolicyConnections():
+class TestUpdateSecurityGroupRule():
"""
- Test Class for list_ipsec_policy_connections
+ Test Class for update_security_group_rule
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_ipsec_policy_connections_all_params(self):
+ def test_update_security_group_rule_all_params(self):
"""
- list_ipsec_policy_connections()
+ update_security_group_rule()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies/testString/connections')
- mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
- responses.add(responses.GET,
+ url = preprocess_url('/security_groups/testString/rules/testString')
+ mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
+ # Construct a dict representation of a SecurityGroupRuleRemotePatchIP model
+ security_group_rule_remote_patch_model = {}
+ security_group_rule_remote_patch_model['address'] = '192.168.3.4'
+
+ # Construct a dict representation of a SecurityGroupRulePatch model
+ security_group_rule_patch_model = {}
+ security_group_rule_patch_model['code'] = 0
+ security_group_rule_patch_model['direction'] = 'inbound'
+ security_group_rule_patch_model['ip_version'] = 'ipv4'
+ security_group_rule_patch_model['port_max'] = 22
+ security_group_rule_patch_model['port_min'] = 22
+ security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model
+ security_group_rule_patch_model['type'] = 8
+
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
+ security_group_rule_patch = security_group_rule_patch_model
# Invoke method
- response = _service.list_ipsec_policy_connections(
+ response = _service.update_security_group_rule(
+ security_group_id,
id,
+ security_group_rule_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == security_group_rule_patch
- def test_list_ipsec_policy_connections_all_params_with_retries(self):
- # Enable retries and run test_list_ipsec_policy_connections_all_params.
+ def test_update_security_group_rule_all_params_with_retries(self):
+ # Enable retries and run test_update_security_group_rule_all_params.
_service.enable_retries()
- self.test_list_ipsec_policy_connections_all_params()
+ self.test_update_security_group_rule_all_params()
- # Disable retries and run test_list_ipsec_policy_connections_all_params.
+ # Disable retries and run test_update_security_group_rule_all_params.
_service.disable_retries()
- self.test_list_ipsec_policy_connections_all_params()
+ self.test_update_security_group_rule_all_params()
@responses.activate
- def test_list_ipsec_policy_connections_value_error(self):
+ def test_update_security_group_rule_value_error(self):
"""
- test_list_ipsec_policy_connections_value_error()
+ test_update_security_group_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/ipsec_policies/testString/connections')
- mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
- responses.add(responses.GET,
+ url = preprocess_url('/security_groups/testString/rules/testString')
+ mock_response = '{"direction": "inbound", "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a", "id": "6f2a6efe-21e2-401c-b237-620aa26ba16a", "ip_version": "ipv4", "remote": {"address": "192.168.3.4"}, "protocol": "all"}'
+ responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
+ # Construct a dict representation of a SecurityGroupRuleRemotePatchIP model
+ security_group_rule_remote_patch_model = {}
+ security_group_rule_remote_patch_model['address'] = '192.168.3.4'
+
+ # Construct a dict representation of a SecurityGroupRulePatch model
+ security_group_rule_patch_model = {}
+ security_group_rule_patch_model['code'] = 0
+ security_group_rule_patch_model['direction'] = 'inbound'
+ security_group_rule_patch_model['ip_version'] = 'ipv4'
+ security_group_rule_patch_model['port_max'] = 22
+ security_group_rule_patch_model['port_min'] = 22
+ security_group_rule_patch_model['remote'] = security_group_rule_remote_patch_model
+ security_group_rule_patch_model['type'] = 8
+
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
+ security_group_rule_patch = security_group_rule_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "security_group_id": security_group_id,
"id": id,
+ "security_group_rule_patch": security_group_rule_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_ipsec_policy_connections(**req_copy)
+ _service.update_security_group_rule(**req_copy)
- def test_list_ipsec_policy_connections_value_error_with_retries(self):
- # Enable retries and run test_list_ipsec_policy_connections_value_error.
+ def test_update_security_group_rule_value_error_with_retries(self):
+ # Enable retries and run test_update_security_group_rule_value_error.
_service.enable_retries()
- self.test_list_ipsec_policy_connections_value_error()
+ self.test_update_security_group_rule_value_error()
- # Disable retries and run test_list_ipsec_policy_connections_value_error.
+ # Disable retries and run test_update_security_group_rule_value_error.
_service.disable_retries()
- self.test_list_ipsec_policy_connections_value_error()
+ self.test_update_security_group_rule_value_error()
-class TestListVpnGateways():
+class TestListSecurityGroupTargets():
"""
- Test Class for list_vpn_gateways
+ Test Class for list_security_group_targets
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_vpn_gateways_all_params(self):
+ def test_list_security_group_targets_all_params(self):
"""
- list_vpn_gateways()
+ list_security_group_targets()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}]}'
+ 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}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -22285,17 +21031,15 @@ def test_list_vpn_gateways_all_params(self):
status=200)
# Set up parameter values
+ security_group_id = 'testString'
start = 'testString'
limit = 1
- resource_group_id = 'testString'
- mode = 'route'
# Invoke method
- response = _service.list_vpn_gateways(
+ response = _service.list_security_group_targets(
+ security_group_id,
start=start,
limit=limit,
- resource_group_id=resource_group_id,
- mode=mode,
headers={}
)
@@ -22307,308 +21051,176 @@ def test_list_vpn_gateways_all_params(self):
query_string = urllib.parse.unquote_plus(query_string)
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
- assert 'resource_group.id={}'.format(resource_group_id) in query_string
- assert 'mode={}'.format(mode) in query_string
- def test_list_vpn_gateways_all_params_with_retries(self):
- # Enable retries and run test_list_vpn_gateways_all_params.
+ def test_list_security_group_targets_all_params_with_retries(self):
+ # Enable retries and run test_list_security_group_targets_all_params.
_service.enable_retries()
- self.test_list_vpn_gateways_all_params()
+ self.test_list_security_group_targets_all_params()
- # Disable retries and run test_list_vpn_gateways_all_params.
+ # Disable retries and run test_list_security_group_targets_all_params.
_service.disable_retries()
- self.test_list_vpn_gateways_all_params()
+ self.test_list_security_group_targets_all_params()
@responses.activate
- def test_list_vpn_gateways_required_params(self):
+ def test_list_security_group_targets_required_params(self):
"""
- test_list_vpn_gateways_required_params()
+ test_list_security_group_targets_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}]}'
+ 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}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Invoke method
- response = _service.list_vpn_gateways()
+ # Set up parameter values
+ security_group_id = 'testString'
+ # Invoke method
+ response = _service.list_security_group_targets(
+ security_group_id,
+ headers={}
+ )
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_vpn_gateways_required_params_with_retries(self):
- # Enable retries and run test_list_vpn_gateways_required_params.
+ def test_list_security_group_targets_required_params_with_retries(self):
+ # Enable retries and run test_list_security_group_targets_required_params.
_service.enable_retries()
- self.test_list_vpn_gateways_required_params()
+ self.test_list_security_group_targets_required_params()
- # Disable retries and run test_list_vpn_gateways_required_params.
+ # Disable retries and run test_list_security_group_targets_required_params.
_service.disable_retries()
- self.test_list_vpn_gateways_required_params()
+ self.test_list_security_group_targets_required_params()
@responses.activate
- def test_list_vpn_gateways_value_error(self):
+ def test_list_security_group_targets_value_error(self):
"""
- test_list_vpn_gateways_value_error()
+ test_list_security_group_targets_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}]}'
+ 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}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
+ # Set up parameter values
+ security_group_id = 'testString'
+
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "security_group_id": security_group_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_vpn_gateways(**req_copy)
+ _service.list_security_group_targets(**req_copy)
- def test_list_vpn_gateways_value_error_with_retries(self):
- # Enable retries and run test_list_vpn_gateways_value_error.
- _service.enable_retries()
- self.test_list_vpn_gateways_value_error()
-
- # Disable retries and run test_list_vpn_gateways_value_error.
- _service.disable_retries()
- self.test_list_vpn_gateways_value_error()
-
-class TestCreateVpnGateway():
- """
- Test Class for create_vpn_gateway
- """
-
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
- @responses.activate
- def test_create_vpn_gateway_all_params(self):
- """
- create_vpn_gateway()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
- responses.add(responses.POST,
- url,
- body=mock_response,
- content_type='application/json',
- status=201)
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model
- vpn_gateway_prototype_model = {}
- vpn_gateway_prototype_model['name'] = 'my-vpn-gateway'
- vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model
- vpn_gateway_prototype_model['subnet'] = subnet_identity_model
- vpn_gateway_prototype_model['mode'] = 'route'
-
- # Set up parameter values
- vpn_gateway_prototype = vpn_gateway_prototype_model
-
- # Invoke method
- response = _service.create_vpn_gateway(
- vpn_gateway_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 == vpn_gateway_prototype
-
- def test_create_vpn_gateway_all_params_with_retries(self):
- # Enable retries and run test_create_vpn_gateway_all_params.
- _service.enable_retries()
- self.test_create_vpn_gateway_all_params()
-
- # Disable retries and run test_create_vpn_gateway_all_params.
- _service.disable_retries()
- self.test_create_vpn_gateway_all_params()
-
- @responses.activate
- def test_create_vpn_gateway_value_error(self):
- """
- test_create_vpn_gateway_value_error()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
- responses.add(responses.POST,
- url,
- body=mock_response,
- content_type='application/json',
- status=201)
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # Construct a dict representation of a SubnetIdentityById model
- subnet_identity_model = {}
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model
- vpn_gateway_prototype_model = {}
- vpn_gateway_prototype_model['name'] = 'my-vpn-gateway'
- vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model
- vpn_gateway_prototype_model['subnet'] = subnet_identity_model
- vpn_gateway_prototype_model['mode'] = 'route'
-
- # Set up parameter values
- vpn_gateway_prototype = vpn_gateway_prototype_model
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "vpn_gateway_prototype": vpn_gateway_prototype,
- }
- for param in req_param_dict.keys():
- req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.create_vpn_gateway(**req_copy)
-
-
- def test_create_vpn_gateway_value_error_with_retries(self):
- # Enable retries and run test_create_vpn_gateway_value_error.
+ def test_list_security_group_targets_value_error_with_retries(self):
+ # Enable retries and run test_list_security_group_targets_value_error.
_service.enable_retries()
- self.test_create_vpn_gateway_value_error()
+ self.test_list_security_group_targets_value_error()
- # Disable retries and run test_create_vpn_gateway_value_error.
+ # Disable retries and run test_list_security_group_targets_value_error.
_service.disable_retries()
- self.test_create_vpn_gateway_value_error()
+ self.test_list_security_group_targets_value_error()
-class TestDeleteVpnGateway():
+class TestDeleteSecurityGroupTargetBinding():
"""
- Test Class for delete_vpn_gateway
+ Test Class for delete_security_group_target_binding
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_vpn_gateway_all_params(self):
+ def test_delete_security_group_target_binding_all_params(self):
"""
- delete_vpn_gateway()
+ delete_security_group_target_binding()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString')
+ url = preprocess_url('/security_groups/testString/targets/testString')
responses.add(responses.DELETE,
url,
- status=202)
+ status=204)
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_vpn_gateway(
+ response = _service.delete_security_group_target_binding(
+ security_group_id,
id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 204
- def test_delete_vpn_gateway_all_params_with_retries(self):
- # Enable retries and run test_delete_vpn_gateway_all_params.
+ def test_delete_security_group_target_binding_all_params_with_retries(self):
+ # Enable retries and run test_delete_security_group_target_binding_all_params.
_service.enable_retries()
- self.test_delete_vpn_gateway_all_params()
+ self.test_delete_security_group_target_binding_all_params()
- # Disable retries and run test_delete_vpn_gateway_all_params.
+ # Disable retries and run test_delete_security_group_target_binding_all_params.
_service.disable_retries()
- self.test_delete_vpn_gateway_all_params()
+ self.test_delete_security_group_target_binding_all_params()
@responses.activate
- def test_delete_vpn_gateway_value_error(self):
+ def test_delete_security_group_target_binding_value_error(self):
"""
- test_delete_vpn_gateway_value_error()
+ test_delete_security_group_target_binding_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString')
+ url = preprocess_url('/security_groups/testString/targets/testString')
responses.add(responses.DELETE,
url,
- status=202)
+ status=204)
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "security_group_id": security_group_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_vpn_gateway(**req_copy)
+ _service.delete_security_group_target_binding(**req_copy)
- def test_delete_vpn_gateway_value_error_with_retries(self):
- # Enable retries and run test_delete_vpn_gateway_value_error.
+ def test_delete_security_group_target_binding_value_error_with_retries(self):
+ # Enable retries and run test_delete_security_group_target_binding_value_error.
_service.enable_retries()
- self.test_delete_vpn_gateway_value_error()
+ self.test_delete_security_group_target_binding_value_error()
- # Disable retries and run test_delete_vpn_gateway_value_error.
+ # Disable retries and run test_delete_security_group_target_binding_value_error.
_service.disable_retries()
- self.test_delete_vpn_gateway_value_error()
+ self.test_delete_security_group_target_binding_value_error()
-class TestGetVpnGateway():
+class TestGetSecurityGroupTarget():
"""
- Test Class for get_vpn_gateway
+ Test Class for get_security_group_target
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_vpn_gateway_all_params(self):
+ def test_get_security_group_target_all_params(self):
"""
- get_vpn_gateway()
+ get_security_group_target()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
+ url = preprocess_url('/security_groups/testString/targets/testString')
+ mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -22616,10 +21228,12 @@ def test_get_vpn_gateway_all_params(self):
status=200)
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_vpn_gateway(
+ response = _service.get_security_group_target(
+ security_group_id,
id,
headers={}
)
@@ -22628,23 +21242,23 @@ def test_get_vpn_gateway_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_vpn_gateway_all_params_with_retries(self):
- # Enable retries and run test_get_vpn_gateway_all_params.
+ def test_get_security_group_target_all_params_with_retries(self):
+ # Enable retries and run test_get_security_group_target_all_params.
_service.enable_retries()
- self.test_get_vpn_gateway_all_params()
+ self.test_get_security_group_target_all_params()
- # Disable retries and run test_get_vpn_gateway_all_params.
+ # Disable retries and run test_get_security_group_target_all_params.
_service.disable_retries()
- self.test_get_vpn_gateway_all_params()
+ self.test_get_security_group_target_all_params()
@responses.activate
- def test_get_vpn_gateway_value_error(self):
+ def test_get_security_group_target_value_error(self):
"""
- test_get_vpn_gateway_value_error()
+ test_get_security_group_target_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
+ url = preprocess_url('/security_groups/testString/targets/testString')
+ mock_response = '{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e", "id": "10c02d81-0ecb-4dc5-897d-28392913b81e", "name": "my-network-interface", "resource_type": "network_interface"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -22652,154 +21266,177 @@ def test_get_vpn_gateway_value_error(self):
status=200)
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "security_group_id": security_group_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_vpn_gateway(**req_copy)
+ _service.get_security_group_target(**req_copy)
- def test_get_vpn_gateway_value_error_with_retries(self):
- # Enable retries and run test_get_vpn_gateway_value_error.
+ def test_get_security_group_target_value_error_with_retries(self):
+ # Enable retries and run test_get_security_group_target_value_error.
_service.enable_retries()
- self.test_get_vpn_gateway_value_error()
+ self.test_get_security_group_target_value_error()
- # Disable retries and run test_get_vpn_gateway_value_error.
+ # Disable retries and run test_get_security_group_target_value_error.
_service.disable_retries()
- self.test_get_vpn_gateway_value_error()
+ self.test_get_security_group_target_value_error()
-class TestUpdateVpnGateway():
+class TestCreateSecurityGroupTargetBinding():
"""
- Test Class for update_vpn_gateway
+ Test Class for create_security_group_target_binding
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_vpn_gateway_all_params(self):
+ def test_create_security_group_target_binding_all_params(self):
"""
- update_vpn_gateway()
+ create_security_group_target_binding()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
- responses.add(responses.PATCH,
+ 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"}'
+ responses.add(responses.PUT,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a VPNGatewayPatch model
- vpn_gateway_patch_model = {}
- vpn_gateway_patch_model['name'] = 'my-vpn-gateway'
-
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
- vpn_gateway_patch = vpn_gateway_patch_model
# Invoke method
- response = _service.update_vpn_gateway(
+ response = _service.create_security_group_target_binding(
+ security_group_id,
id,
- vpn_gateway_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == vpn_gateway_patch
- def test_update_vpn_gateway_all_params_with_retries(self):
- # Enable retries and run test_update_vpn_gateway_all_params.
+ def test_create_security_group_target_binding_all_params_with_retries(self):
+ # Enable retries and run test_create_security_group_target_binding_all_params.
_service.enable_retries()
- self.test_update_vpn_gateway_all_params()
+ self.test_create_security_group_target_binding_all_params()
- # Disable retries and run test_update_vpn_gateway_all_params.
+ # Disable retries and run test_create_security_group_target_binding_all_params.
_service.disable_retries()
- self.test_update_vpn_gateway_all_params()
+ self.test_create_security_group_target_binding_all_params()
@responses.activate
- def test_update_vpn_gateway_value_error(self):
+ def test_create_security_group_target_binding_value_error(self):
"""
- test_update_vpn_gateway_value_error()
+ test_create_security_group_target_binding_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString')
- mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
- responses.add(responses.PATCH,
+ 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"}'
+ responses.add(responses.PUT,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a VPNGatewayPatch model
- vpn_gateway_patch_model = {}
- vpn_gateway_patch_model['name'] = 'my-vpn-gateway'
-
# Set up parameter values
+ security_group_id = 'testString'
id = 'testString'
- vpn_gateway_patch = vpn_gateway_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "security_group_id": security_group_id,
"id": id,
- "vpn_gateway_patch": vpn_gateway_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_vpn_gateway(**req_copy)
+ _service.create_security_group_target_binding(**req_copy)
- def test_update_vpn_gateway_value_error_with_retries(self):
- # Enable retries and run test_update_vpn_gateway_value_error.
+ def test_create_security_group_target_binding_value_error_with_retries(self):
+ # Enable retries and run test_create_security_group_target_binding_value_error.
_service.enable_retries()
- self.test_update_vpn_gateway_value_error()
+ self.test_create_security_group_target_binding_value_error()
- # Disable retries and run test_update_vpn_gateway_value_error.
+ # Disable retries and run test_create_security_group_target_binding_value_error.
_service.disable_retries()
- self.test_update_vpn_gateway_value_error()
+ self.test_create_security_group_target_binding_value_error()
-class TestListVpnGatewayConnections():
+# endregion
+##############################################################################
+# End of Service: SecurityGroups
+##############################################################################
+
+##############################################################################
+# Start of Service: VPNGateways
+##############################################################################
+# region
+
+class TestNewInstance():
"""
- Test Class for list_vpn_gateway_connections
+ Test Class for new_instance
"""
- def preprocess_url(self, request_url: str):
+ 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):
"""
- Preprocess the request URL to ensure the mock response will be found.
+ new_instance_required_param_none()
"""
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ with pytest.raises(ValueError, match='version must be provided'):
+ service = VpcV1.new_instance(
+ version=None,
+ )
+class TestListIkePolicies():
+ """
+ Test Class for list_ike_policies
+ """
@responses.activate
- def test_list_vpn_gateway_connections_all_params(self):
+ def test_list_ike_policies_all_params(self):
"""
- list_vpn_gateway_connections()
+ list_ike_policies()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections')
- mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
+ url = preprocess_url('/ike_policies')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -22807,13 +21444,13 @@ def test_list_vpn_gateway_connections_all_params(self):
status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
- status = 'testString'
+ start = 'testString'
+ limit = 1
# Invoke method
- response = _service.list_vpn_gateway_connections(
- vpn_gateway_id,
- status=status,
+ response = _service.list_ike_policies(
+ start=start,
+ limit=limit,
headers={}
)
@@ -22823,152 +21460,122 @@ def test_list_vpn_gateway_connections_all_params(self):
# Validate query params
query_string = responses.calls[0].request.url.split('?',1)[1]
query_string = urllib.parse.unquote_plus(query_string)
- assert 'status={}'.format(status) in query_string
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
- def test_list_vpn_gateway_connections_all_params_with_retries(self):
- # Enable retries and run test_list_vpn_gateway_connections_all_params.
+ def test_list_ike_policies_all_params_with_retries(self):
+ # Enable retries and run test_list_ike_policies_all_params.
_service.enable_retries()
- self.test_list_vpn_gateway_connections_all_params()
+ self.test_list_ike_policies_all_params()
- # Disable retries and run test_list_vpn_gateway_connections_all_params.
+ # Disable retries and run test_list_ike_policies_all_params.
_service.disable_retries()
- self.test_list_vpn_gateway_connections_all_params()
+ self.test_list_ike_policies_all_params()
@responses.activate
- def test_list_vpn_gateway_connections_required_params(self):
+ def test_list_ike_policies_required_params(self):
"""
- test_list_vpn_gateway_connections_required_params()
+ test_list_ike_policies_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections')
- mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
+ url = preprocess_url('/ike_policies')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Set up parameter values
- vpn_gateway_id = 'testString'
-
# Invoke method
- response = _service.list_vpn_gateway_connections(
- vpn_gateway_id,
- headers={}
- )
+ response = _service.list_ike_policies()
+
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_vpn_gateway_connections_required_params_with_retries(self):
- # Enable retries and run test_list_vpn_gateway_connections_required_params.
+ def test_list_ike_policies_required_params_with_retries(self):
+ # Enable retries and run test_list_ike_policies_required_params.
_service.enable_retries()
- self.test_list_vpn_gateway_connections_required_params()
+ self.test_list_ike_policies_required_params()
- # Disable retries and run test_list_vpn_gateway_connections_required_params.
+ # Disable retries and run test_list_ike_policies_required_params.
_service.disable_retries()
- self.test_list_vpn_gateway_connections_required_params()
+ self.test_list_ike_policies_required_params()
@responses.activate
- def test_list_vpn_gateway_connections_value_error(self):
+ def test_list_ike_policies_value_error(self):
"""
- test_list_vpn_gateway_connections_value_error()
+ test_list_ike_policies_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections')
- mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
+ url = preprocess_url('/ike_policies')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20"}, "ike_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Set up parameter values
- vpn_gateway_id = 'testString'
-
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_vpn_gateway_connections(**req_copy)
+ _service.list_ike_policies(**req_copy)
- def test_list_vpn_gateway_connections_value_error_with_retries(self):
- # Enable retries and run test_list_vpn_gateway_connections_value_error.
+ def test_list_ike_policies_value_error_with_retries(self):
+ # Enable retries and run test_list_ike_policies_value_error.
_service.enable_retries()
- self.test_list_vpn_gateway_connections_value_error()
+ self.test_list_ike_policies_value_error()
- # Disable retries and run test_list_vpn_gateway_connections_value_error.
+ # Disable retries and run test_list_ike_policies_value_error.
_service.disable_retries()
- self.test_list_vpn_gateway_connections_value_error()
+ self.test_list_ike_policies_value_error()
-class TestCreateVpnGatewayConnection():
+class TestCreateIkePolicy():
"""
- Test Class for create_vpn_gateway_connection
+ Test Class for create_ike_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_vpn_gateway_connection_all_params(self):
+ def test_create_ike_policy_all_params(self):
"""
- create_vpn_gateway_connection()
+ create_ike_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections')
- mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ url = preprocess_url('/ike_policies')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a VPNGatewayConnectionDPDPrototype model
- vpn_gateway_connection_dpd_prototype_model = {}
- vpn_gateway_connection_dpd_prototype_model['action'] = 'restart'
- vpn_gateway_connection_dpd_prototype_model['interval'] = 30
- vpn_gateway_connection_dpd_prototype_model['timeout'] = 120
-
- # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model
- vpn_gateway_connection_ike_policy_prototype_model = {}
- vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model
- vpn_gateway_connection_i_psec_policy_prototype_model = {}
- vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
- vpn_gateway_connection_prototype_model = {}
- vpn_gateway_connection_prototype_model['admin_state_up'] = True
- vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model
- vpn_gateway_connection_prototype_model['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model
- vpn_gateway_connection_prototype_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model
- vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_prototype_model['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_prototype_model['routing_protocol'] = 'none'
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
# Set up parameter values
- vpn_gateway_id = 'testString'
- vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model
+ authentication_algorithm = 'md5'
+ dh_group = 14
+ encryption_algorithm = 'aes128'
+ ike_version = 1
+ key_lifetime = 28800
+ name = 'my-ike-policy'
+ resource_group = resource_group_identity_model
# Invoke method
- response = _service.create_vpn_gateway_connection(
- vpn_gateway_id,
- vpn_gateway_connection_prototype,
+ response = _service.create_ike_policy(
+ authentication_algorithm,
+ dh_group,
+ encryption_algorithm,
+ ike_version,
+ key_lifetime=key_lifetime,
+ name=name,
+ resource_group=resource_group,
headers={}
)
@@ -22977,190 +21584,156 @@ def test_create_vpn_gateway_connection_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == vpn_gateway_connection_prototype
+ assert req_body['authentication_algorithm'] == 'md5'
+ assert req_body['dh_group'] == 14
+ assert req_body['encryption_algorithm'] == 'aes128'
+ assert req_body['ike_version'] == 1
+ assert req_body['key_lifetime'] == 28800
+ assert req_body['name'] == 'my-ike-policy'
+ assert req_body['resource_group'] == resource_group_identity_model
- def test_create_vpn_gateway_connection_all_params_with_retries(self):
- # Enable retries and run test_create_vpn_gateway_connection_all_params.
+ def test_create_ike_policy_all_params_with_retries(self):
+ # Enable retries and run test_create_ike_policy_all_params.
_service.enable_retries()
- self.test_create_vpn_gateway_connection_all_params()
+ self.test_create_ike_policy_all_params()
- # Disable retries and run test_create_vpn_gateway_connection_all_params.
+ # Disable retries and run test_create_ike_policy_all_params.
_service.disable_retries()
- self.test_create_vpn_gateway_connection_all_params()
+ self.test_create_ike_policy_all_params()
@responses.activate
- def test_create_vpn_gateway_connection_value_error(self):
+ def test_create_ike_policy_value_error(self):
"""
- test_create_vpn_gateway_connection_value_error()
+ test_create_ike_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections')
- mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ url = preprocess_url('/ike_policies')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a VPNGatewayConnectionDPDPrototype model
- vpn_gateway_connection_dpd_prototype_model = {}
- vpn_gateway_connection_dpd_prototype_model['action'] = 'restart'
- vpn_gateway_connection_dpd_prototype_model['interval'] = 30
- vpn_gateway_connection_dpd_prototype_model['timeout'] = 120
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model
- vpn_gateway_connection_ike_policy_prototype_model = {}
- vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model
- vpn_gateway_connection_i_psec_policy_prototype_model = {}
- vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
- vpn_gateway_connection_prototype_model = {}
- vpn_gateway_connection_prototype_model['admin_state_up'] = True
- vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model
- vpn_gateway_connection_prototype_model['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model
- vpn_gateway_connection_prototype_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model
- vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_prototype_model['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_prototype_model['routing_protocol'] = 'none'
-
- # Set up parameter values
- vpn_gateway_id = 'testString'
- vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model
+ # Set up parameter values
+ authentication_algorithm = 'md5'
+ dh_group = 14
+ encryption_algorithm = 'aes128'
+ ike_version = 1
+ key_lifetime = 28800
+ name = 'my-ike-policy'
+ resource_group = resource_group_identity_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
- "vpn_gateway_connection_prototype": vpn_gateway_connection_prototype,
+ "authentication_algorithm": authentication_algorithm,
+ "dh_group": dh_group,
+ "encryption_algorithm": encryption_algorithm,
+ "ike_version": ike_version,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_vpn_gateway_connection(**req_copy)
+ _service.create_ike_policy(**req_copy)
- def test_create_vpn_gateway_connection_value_error_with_retries(self):
- # Enable retries and run test_create_vpn_gateway_connection_value_error.
+ def test_create_ike_policy_value_error_with_retries(self):
+ # Enable retries and run test_create_ike_policy_value_error.
_service.enable_retries()
- self.test_create_vpn_gateway_connection_value_error()
+ self.test_create_ike_policy_value_error()
- # Disable retries and run test_create_vpn_gateway_connection_value_error.
+ # Disable retries and run test_create_ike_policy_value_error.
_service.disable_retries()
- self.test_create_vpn_gateway_connection_value_error()
+ self.test_create_ike_policy_value_error()
-class TestDeleteVpnGatewayConnection():
+class TestDeleteIkePolicy():
"""
- Test Class for delete_vpn_gateway_connection
+ Test Class for delete_ike_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_vpn_gateway_connection_all_params(self):
+ def test_delete_ike_policy_all_params(self):
"""
- delete_vpn_gateway_connection()
+ delete_ike_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString')
+ url = preprocess_url('/ike_policies/testString')
responses.add(responses.DELETE,
url,
- status=202)
+ status=204)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_vpn_gateway_connection(
- vpn_gateway_id,
+ response = _service.delete_ike_policy(
id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 204
- def test_delete_vpn_gateway_connection_all_params_with_retries(self):
- # Enable retries and run test_delete_vpn_gateway_connection_all_params.
+ def test_delete_ike_policy_all_params_with_retries(self):
+ # Enable retries and run test_delete_ike_policy_all_params.
_service.enable_retries()
- self.test_delete_vpn_gateway_connection_all_params()
+ self.test_delete_ike_policy_all_params()
- # Disable retries and run test_delete_vpn_gateway_connection_all_params.
+ # Disable retries and run test_delete_ike_policy_all_params.
_service.disable_retries()
- self.test_delete_vpn_gateway_connection_all_params()
+ self.test_delete_ike_policy_all_params()
@responses.activate
- def test_delete_vpn_gateway_connection_value_error(self):
+ def test_delete_ike_policy_value_error(self):
"""
- test_delete_vpn_gateway_connection_value_error()
+ test_delete_ike_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString')
+ url = preprocess_url('/ike_policies/testString')
responses.add(responses.DELETE,
url,
- status=202)
+ status=204)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_vpn_gateway_connection(**req_copy)
+ _service.delete_ike_policy(**req_copy)
- def test_delete_vpn_gateway_connection_value_error_with_retries(self):
- # Enable retries and run test_delete_vpn_gateway_connection_value_error.
+ def test_delete_ike_policy_value_error_with_retries(self):
+ # Enable retries and run test_delete_ike_policy_value_error.
_service.enable_retries()
- self.test_delete_vpn_gateway_connection_value_error()
+ self.test_delete_ike_policy_value_error()
- # Disable retries and run test_delete_vpn_gateway_connection_value_error.
+ # Disable retries and run test_delete_ike_policy_value_error.
_service.disable_retries()
- self.test_delete_vpn_gateway_connection_value_error()
+ self.test_delete_ike_policy_value_error()
-class TestGetVpnGatewayConnection():
+class TestGetIkePolicy():
"""
- Test Class for get_vpn_gateway_connection
+ Test Class for get_ike_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_vpn_gateway_connection_all_params(self):
+ def test_get_ike_policy_all_params(self):
"""
- get_vpn_gateway_connection()
+ get_ike_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString')
- mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ url = preprocess_url('/ike_policies/testString')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -23168,12 +21741,10 @@ def test_get_vpn_gateway_connection_all_params(self):
status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_vpn_gateway_connection(
- vpn_gateway_id,
+ response = _service.get_ike_policy(
id,
headers={}
)
@@ -23182,23 +21753,23 @@ def test_get_vpn_gateway_connection_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_vpn_gateway_connection_all_params_with_retries(self):
- # Enable retries and run test_get_vpn_gateway_connection_all_params.
+ def test_get_ike_policy_all_params_with_retries(self):
+ # Enable retries and run test_get_ike_policy_all_params.
_service.enable_retries()
- self.test_get_vpn_gateway_connection_all_params()
+ self.test_get_ike_policy_all_params()
- # Disable retries and run test_get_vpn_gateway_connection_all_params.
+ # Disable retries and run test_get_ike_policy_all_params.
_service.disable_retries()
- self.test_get_vpn_gateway_connection_all_params()
+ self.test_get_ike_policy_all_params()
@responses.activate
- def test_get_vpn_gateway_connection_value_error(self):
+ def test_get_ike_policy_value_error(self):
"""
- test_get_vpn_gateway_connection_value_error()
+ test_get_ike_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString')
- mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ url = preprocess_url('/ike_policies/testString')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -23206,94 +21777,63 @@ def test_get_vpn_gateway_connection_value_error(self):
status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_vpn_gateway_connection(**req_copy)
+ _service.get_ike_policy(**req_copy)
- def test_get_vpn_gateway_connection_value_error_with_retries(self):
- # Enable retries and run test_get_vpn_gateway_connection_value_error.
+ def test_get_ike_policy_value_error_with_retries(self):
+ # Enable retries and run test_get_ike_policy_value_error.
_service.enable_retries()
- self.test_get_vpn_gateway_connection_value_error()
+ self.test_get_ike_policy_value_error()
- # Disable retries and run test_get_vpn_gateway_connection_value_error.
+ # Disable retries and run test_get_ike_policy_value_error.
_service.disable_retries()
- self.test_get_vpn_gateway_connection_value_error()
+ self.test_get_ike_policy_value_error()
-class TestUpdateVpnGatewayConnection():
+class TestUpdateIkePolicy():
"""
- Test Class for update_vpn_gateway_connection
+ Test Class for update_ike_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_vpn_gateway_connection_all_params(self):
+ def test_update_ike_policy_all_params(self):
"""
- update_vpn_gateway_connection()
+ update_ike_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString')
- mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ url = preprocess_url('/ike_policies/testString')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a VPNGatewayConnectionDPDPatch model
- vpn_gateway_connection_dpd_patch_model = {}
- vpn_gateway_connection_dpd_patch_model['action'] = 'restart'
- vpn_gateway_connection_dpd_patch_model['interval'] = 30
- vpn_gateway_connection_dpd_patch_model['timeout'] = 120
-
- # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model
- vpn_gateway_connection_ike_policy_patch_model = {}
- vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model
- vpn_gateway_connection_i_psec_policy_patch_model = {}
- vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- # Construct a dict representation of a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch model
- vpn_gateway_connection_patch_model = {}
- vpn_gateway_connection_patch_model['admin_state_up'] = True
- vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model
- vpn_gateway_connection_patch_model['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model
- vpn_gateway_connection_patch_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model
- vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_patch_model['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_patch_model['routing_protocol'] = 'none'
+ # Construct a dict representation of a IKEPolicyPatch model
+ ike_policy_patch_model = {}
+ ike_policy_patch_model['authentication_algorithm'] = 'md5'
+ ike_policy_patch_model['dh_group'] = 14
+ ike_policy_patch_model['encryption_algorithm'] = 'aes128'
+ ike_policy_patch_model['ike_version'] = 1
+ ike_policy_patch_model['key_lifetime'] = 28800
+ ike_policy_patch_model['name'] = 'my-ike-policy'
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
- vpn_gateway_connection_patch = vpn_gateway_connection_patch_model
+ ike_policy_patch = ike_policy_patch_model
# Invoke method
- response = _service.update_vpn_gateway_connection(
- vpn_gateway_id,
+ response = _service.update_ike_policy(
id,
- vpn_gateway_connection_patch,
+ ike_policy_patch,
headers={}
)
@@ -23302,106 +21842,77 @@ def test_update_vpn_gateway_connection_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == vpn_gateway_connection_patch
+ assert req_body == ike_policy_patch
- def test_update_vpn_gateway_connection_all_params_with_retries(self):
- # Enable retries and run test_update_vpn_gateway_connection_all_params.
+ def test_update_ike_policy_all_params_with_retries(self):
+ # Enable retries and run test_update_ike_policy_all_params.
_service.enable_retries()
- self.test_update_vpn_gateway_connection_all_params()
+ self.test_update_ike_policy_all_params()
- # Disable retries and run test_update_vpn_gateway_connection_all_params.
+ # Disable retries and run test_update_ike_policy_all_params.
_service.disable_retries()
- self.test_update_vpn_gateway_connection_all_params()
+ self.test_update_ike_policy_all_params()
@responses.activate
- def test_update_vpn_gateway_connection_value_error(self):
+ def test_update_ike_policy_value_error(self):
"""
- test_update_vpn_gateway_connection_value_error()
+ test_update_ike_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString')
- mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ url = preprocess_url('/ike_policies/testString')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "dh_group": 14, "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "ike_version": 1, "key_lifetime": 28800, "name": "my-ike-policy", "negotiation_mode": "main", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ike_policy"}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a VPNGatewayConnectionDPDPatch model
- vpn_gateway_connection_dpd_patch_model = {}
- vpn_gateway_connection_dpd_patch_model['action'] = 'restart'
- vpn_gateway_connection_dpd_patch_model['interval'] = 30
- vpn_gateway_connection_dpd_patch_model['timeout'] = 120
-
- # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model
- vpn_gateway_connection_ike_policy_patch_model = {}
- vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model
- vpn_gateway_connection_i_psec_policy_patch_model = {}
- vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
-
- # Construct a dict representation of a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch model
- vpn_gateway_connection_patch_model = {}
- vpn_gateway_connection_patch_model['admin_state_up'] = True
- vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model
- vpn_gateway_connection_patch_model['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model
- vpn_gateway_connection_patch_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model
- vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_patch_model['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_patch_model['routing_protocol'] = 'none'
+ # Construct a dict representation of a IKEPolicyPatch model
+ ike_policy_patch_model = {}
+ ike_policy_patch_model['authentication_algorithm'] = 'md5'
+ ike_policy_patch_model['dh_group'] = 14
+ ike_policy_patch_model['encryption_algorithm'] = 'aes128'
+ ike_policy_patch_model['ike_version'] = 1
+ ike_policy_patch_model['key_lifetime'] = 28800
+ ike_policy_patch_model['name'] = 'my-ike-policy'
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
- vpn_gateway_connection_patch = vpn_gateway_connection_patch_model
+ ike_policy_patch = ike_policy_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
"id": id,
- "vpn_gateway_connection_patch": vpn_gateway_connection_patch,
+ "ike_policy_patch": ike_policy_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_vpn_gateway_connection(**req_copy)
+ _service.update_ike_policy(**req_copy)
- def test_update_vpn_gateway_connection_value_error_with_retries(self):
- # Enable retries and run test_update_vpn_gateway_connection_value_error.
+ def test_update_ike_policy_value_error_with_retries(self):
+ # Enable retries and run test_update_ike_policy_value_error.
_service.enable_retries()
- self.test_update_vpn_gateway_connection_value_error()
+ self.test_update_ike_policy_value_error()
- # Disable retries and run test_update_vpn_gateway_connection_value_error.
+ # Disable retries and run test_update_ike_policy_value_error.
_service.disable_retries()
- self.test_update_vpn_gateway_connection_value_error()
+ self.test_update_ike_policy_value_error()
-class TestListVpnGatewayConnectionLocalCidrs():
+class TestListIkePolicyConnections():
"""
- Test Class for list_vpn_gateway_connection_local_cidrs
+ Test Class for list_ike_policy_connections
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_vpn_gateway_connection_local_cidrs_all_params(self):
+ def test_list_ike_policy_connections_all_params(self):
"""
- list_vpn_gateway_connection_local_cidrs()
+ list_ike_policy_connections()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs')
- mock_response = '{"local_cidrs": ["192.168.1.0/24"]}'
+ url = preprocess_url('/ike_policies/testString/connections')
+ mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -23409,12 +21920,10 @@ def test_list_vpn_gateway_connection_local_cidrs_all_params(self):
status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.list_vpn_gateway_connection_local_cidrs(
- vpn_gateway_id,
+ response = _service.list_ike_policy_connections(
id,
headers={}
)
@@ -23423,23 +21932,23 @@ def test_list_vpn_gateway_connection_local_cidrs_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_vpn_gateway_connection_local_cidrs_all_params_with_retries(self):
- # Enable retries and run test_list_vpn_gateway_connection_local_cidrs_all_params.
+ def test_list_ike_policy_connections_all_params_with_retries(self):
+ # Enable retries and run test_list_ike_policy_connections_all_params.
_service.enable_retries()
- self.test_list_vpn_gateway_connection_local_cidrs_all_params()
+ self.test_list_ike_policy_connections_all_params()
- # Disable retries and run test_list_vpn_gateway_connection_local_cidrs_all_params.
+ # Disable retries and run test_list_ike_policy_connections_all_params.
_service.disable_retries()
- self.test_list_vpn_gateway_connection_local_cidrs_all_params()
+ self.test_list_ike_policy_connections_all_params()
@responses.activate
- def test_list_vpn_gateway_connection_local_cidrs_value_error(self):
+ def test_list_ike_policy_connections_value_error(self):
"""
- test_list_vpn_gateway_connection_local_cidrs_value_error()
+ test_list_ike_policy_connections_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs')
- mock_response = '{"local_cidrs": ["192.168.1.0/24"]}'
+ url = preprocess_url('/ike_policies/testString/connections')
+ mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -23447,256 +21956,270 @@ def test_list_vpn_gateway_connection_local_cidrs_value_error(self):
status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_vpn_gateway_connection_local_cidrs(**req_copy)
+ _service.list_ike_policy_connections(**req_copy)
- def test_list_vpn_gateway_connection_local_cidrs_value_error_with_retries(self):
- # Enable retries and run test_list_vpn_gateway_connection_local_cidrs_value_error.
+ def test_list_ike_policy_connections_value_error_with_retries(self):
+ # Enable retries and run test_list_ike_policy_connections_value_error.
_service.enable_retries()
- self.test_list_vpn_gateway_connection_local_cidrs_value_error()
+ self.test_list_ike_policy_connections_value_error()
- # Disable retries and run test_list_vpn_gateway_connection_local_cidrs_value_error.
+ # Disable retries and run test_list_ike_policy_connections_value_error.
_service.disable_retries()
- self.test_list_vpn_gateway_connection_local_cidrs_value_error()
+ self.test_list_ike_policy_connections_value_error()
-class TestRemoveVpnGatewayConnectionLocalCidr():
+class TestListIpsecPolicies():
"""
- Test Class for remove_vpn_gateway_connection_local_cidr
+ Test Class for list_ipsec_policies
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_remove_vpn_gateway_connection_local_cidr_all_params(self):
+ def test_list_ipsec_policies_all_params(self):
"""
- remove_vpn_gateway_connection_local_cidr()
+ list_ipsec_policies()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/ipsec_policies')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
+ start = 'testString'
+ limit = 1
# Invoke method
- response = _service.remove_vpn_gateway_connection_local_cidr(
- vpn_gateway_id,
- id,
- cidr_prefix,
- prefix_length,
+ response = _service.list_ipsec_policies(
+ start=start,
+ limit=limit,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?',1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
- def test_remove_vpn_gateway_connection_local_cidr_all_params_with_retries(self):
- # Enable retries and run test_remove_vpn_gateway_connection_local_cidr_all_params.
+ def test_list_ipsec_policies_all_params_with_retries(self):
+ # Enable retries and run test_list_ipsec_policies_all_params.
_service.enable_retries()
- self.test_remove_vpn_gateway_connection_local_cidr_all_params()
+ self.test_list_ipsec_policies_all_params()
- # Disable retries and run test_remove_vpn_gateway_connection_local_cidr_all_params.
+ # Disable retries and run test_list_ipsec_policies_all_params.
_service.disable_retries()
- self.test_remove_vpn_gateway_connection_local_cidr_all_params()
+ self.test_list_ipsec_policies_all_params()
@responses.activate
- def test_remove_vpn_gateway_connection_local_cidr_value_error(self):
+ def test_list_ipsec_policies_required_params(self):
"""
- test_remove_vpn_gateway_connection_local_cidr_value_error()
+ test_list_ipsec_policies_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/ipsec_policies')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
- # Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
+ # Invoke method
+ response = _service.list_ipsec_policies()
+
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_ipsec_policies_required_params_with_retries(self):
+ # Enable retries and run test_list_ipsec_policies_required_params.
+ _service.enable_retries()
+ self.test_list_ipsec_policies_required_params()
+
+ # Disable retries and run test_list_ipsec_policies_required_params.
+ _service.disable_retries()
+ self.test_list_ipsec_policies_required_params()
+
+ @responses.activate
+ def test_list_ipsec_policies_value_error(self):
+ """
+ test_list_ipsec_policies_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/ipsec_policies')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20"}, "ipsec_policies": [{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ 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 = {
- "vpn_gateway_id": vpn_gateway_id,
- "id": id,
- "cidr_prefix": cidr_prefix,
- "prefix_length": prefix_length,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.remove_vpn_gateway_connection_local_cidr(**req_copy)
+ _service.list_ipsec_policies(**req_copy)
- def test_remove_vpn_gateway_connection_local_cidr_value_error_with_retries(self):
- # Enable retries and run test_remove_vpn_gateway_connection_local_cidr_value_error.
+ def test_list_ipsec_policies_value_error_with_retries(self):
+ # Enable retries and run test_list_ipsec_policies_value_error.
_service.enable_retries()
- self.test_remove_vpn_gateway_connection_local_cidr_value_error()
+ self.test_list_ipsec_policies_value_error()
- # Disable retries and run test_remove_vpn_gateway_connection_local_cidr_value_error.
+ # Disable retries and run test_list_ipsec_policies_value_error.
_service.disable_retries()
- self.test_remove_vpn_gateway_connection_local_cidr_value_error()
+ self.test_list_ipsec_policies_value_error()
-class TestCheckVpnGatewayConnectionLocalCidr():
+class TestCreateIpsecPolicy():
"""
- Test Class for check_vpn_gateway_connection_local_cidr
+ Test Class for create_ipsec_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_check_vpn_gateway_connection_local_cidr_all_params(self):
+ def test_create_ipsec_policy_all_params(self):
"""
- check_vpn_gateway_connection_local_cidr()
+ create_ipsec_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
- responses.add(responses.GET,
+ url = preprocess_url('/ipsec_policies')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ responses.add(responses.POST,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
# Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
+ authentication_algorithm = 'md5'
+ encryption_algorithm = 'aes128'
+ pfs = 'disabled'
+ key_lifetime = 3600
+ name = 'my-ipsec-policy'
+ resource_group = resource_group_identity_model
# Invoke method
- response = _service.check_vpn_gateway_connection_local_cidr(
- vpn_gateway_id,
- id,
- cidr_prefix,
- prefix_length,
+ response = _service.create_ipsec_policy(
+ authentication_algorithm,
+ encryption_algorithm,
+ pfs,
+ key_lifetime=key_lifetime,
+ name=name,
+ resource_group=resource_group,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 201
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['authentication_algorithm'] == 'md5'
+ assert req_body['encryption_algorithm'] == 'aes128'
+ assert req_body['pfs'] == 'disabled'
+ assert req_body['key_lifetime'] == 3600
+ assert req_body['name'] == 'my-ipsec-policy'
+ assert req_body['resource_group'] == resource_group_identity_model
- def test_check_vpn_gateway_connection_local_cidr_all_params_with_retries(self):
- # Enable retries and run test_check_vpn_gateway_connection_local_cidr_all_params.
+ def test_create_ipsec_policy_all_params_with_retries(self):
+ # Enable retries and run test_create_ipsec_policy_all_params.
_service.enable_retries()
- self.test_check_vpn_gateway_connection_local_cidr_all_params()
+ self.test_create_ipsec_policy_all_params()
- # Disable retries and run test_check_vpn_gateway_connection_local_cidr_all_params.
+ # Disable retries and run test_create_ipsec_policy_all_params.
_service.disable_retries()
- self.test_check_vpn_gateway_connection_local_cidr_all_params()
+ self.test_create_ipsec_policy_all_params()
@responses.activate
- def test_check_vpn_gateway_connection_local_cidr_value_error(self):
+ def test_create_ipsec_policy_value_error(self):
"""
- test_check_vpn_gateway_connection_local_cidr_value_error()
+ test_create_ipsec_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
- responses.add(responses.GET,
+ url = preprocess_url('/ipsec_policies')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ responses.add(responses.POST,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
# Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
+ authentication_algorithm = 'md5'
+ encryption_algorithm = 'aes128'
+ pfs = 'disabled'
+ key_lifetime = 3600
+ name = 'my-ipsec-policy'
+ resource_group = resource_group_identity_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
- "id": id,
- "cidr_prefix": cidr_prefix,
- "prefix_length": prefix_length,
+ "authentication_algorithm": authentication_algorithm,
+ "encryption_algorithm": encryption_algorithm,
+ "pfs": pfs,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.check_vpn_gateway_connection_local_cidr(**req_copy)
+ _service.create_ipsec_policy(**req_copy)
- def test_check_vpn_gateway_connection_local_cidr_value_error_with_retries(self):
- # Enable retries and run test_check_vpn_gateway_connection_local_cidr_value_error.
+ def test_create_ipsec_policy_value_error_with_retries(self):
+ # Enable retries and run test_create_ipsec_policy_value_error.
_service.enable_retries()
- self.test_check_vpn_gateway_connection_local_cidr_value_error()
+ self.test_create_ipsec_policy_value_error()
- # Disable retries and run test_check_vpn_gateway_connection_local_cidr_value_error.
+ # Disable retries and run test_create_ipsec_policy_value_error.
_service.disable_retries()
- self.test_check_vpn_gateway_connection_local_cidr_value_error()
+ self.test_create_ipsec_policy_value_error()
-class TestAddVpnGatewayConnectionLocalCidr():
+class TestDeleteIpsecPolicy():
"""
- Test Class for add_vpn_gateway_connection_local_cidr
+ Test Class for delete_ipsec_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_add_vpn_gateway_connection_local_cidr_all_params(self):
+ def test_delete_ipsec_policy_all_params(self):
"""
- add_vpn_gateway_connection_local_cidr()
+ delete_ipsec_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
- responses.add(responses.PUT,
+ url = preprocess_url('/ipsec_policies/testString')
+ responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
# Invoke method
- response = _service.add_vpn_gateway_connection_local_cidr(
- vpn_gateway_id,
+ response = _service.delete_ipsec_policy(
id,
- cidr_prefix,
- prefix_length,
headers={}
)
@@ -23704,78 +22227,61 @@ def test_add_vpn_gateway_connection_local_cidr_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_add_vpn_gateway_connection_local_cidr_all_params_with_retries(self):
- # Enable retries and run test_add_vpn_gateway_connection_local_cidr_all_params.
+ def test_delete_ipsec_policy_all_params_with_retries(self):
+ # Enable retries and run test_delete_ipsec_policy_all_params.
_service.enable_retries()
- self.test_add_vpn_gateway_connection_local_cidr_all_params()
+ self.test_delete_ipsec_policy_all_params()
- # Disable retries and run test_add_vpn_gateway_connection_local_cidr_all_params.
+ # Disable retries and run test_delete_ipsec_policy_all_params.
_service.disable_retries()
- self.test_add_vpn_gateway_connection_local_cidr_all_params()
+ self.test_delete_ipsec_policy_all_params()
@responses.activate
- def test_add_vpn_gateway_connection_local_cidr_value_error(self):
+ def test_delete_ipsec_policy_value_error(self):
"""
- test_add_vpn_gateway_connection_local_cidr_value_error()
+ test_delete_ipsec_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
- responses.add(responses.PUT,
+ url = preprocess_url('/ipsec_policies/testString')
+ responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
"id": id,
- "cidr_prefix": cidr_prefix,
- "prefix_length": prefix_length,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.add_vpn_gateway_connection_local_cidr(**req_copy)
+ _service.delete_ipsec_policy(**req_copy)
- def test_add_vpn_gateway_connection_local_cidr_value_error_with_retries(self):
- # Enable retries and run test_add_vpn_gateway_connection_local_cidr_value_error.
+ def test_delete_ipsec_policy_value_error_with_retries(self):
+ # Enable retries and run test_delete_ipsec_policy_value_error.
_service.enable_retries()
- self.test_add_vpn_gateway_connection_local_cidr_value_error()
+ self.test_delete_ipsec_policy_value_error()
- # Disable retries and run test_add_vpn_gateway_connection_local_cidr_value_error.
+ # Disable retries and run test_delete_ipsec_policy_value_error.
_service.disable_retries()
- self.test_add_vpn_gateway_connection_local_cidr_value_error()
+ self.test_delete_ipsec_policy_value_error()
-class TestListVpnGatewayConnectionPeerCidrs():
+class TestGetIpsecPolicy():
"""
- Test Class for list_vpn_gateway_connection_peer_cidrs
+ Test Class for get_ipsec_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_vpn_gateway_connection_peer_cidrs_all_params(self):
+ def test_get_ipsec_policy_all_params(self):
"""
- list_vpn_gateway_connection_peer_cidrs()
+ get_ipsec_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs')
- mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}'
+ url = preprocess_url('/ipsec_policies/testString')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -23783,12 +22289,10 @@ def test_list_vpn_gateway_connection_peer_cidrs_all_params(self):
status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.list_vpn_gateway_connection_peer_cidrs(
- vpn_gateway_id,
+ response = _service.get_ipsec_policy(
id,
headers={}
)
@@ -23797,23 +22301,23 @@ def test_list_vpn_gateway_connection_peer_cidrs_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_vpn_gateway_connection_peer_cidrs_all_params_with_retries(self):
- # Enable retries and run test_list_vpn_gateway_connection_peer_cidrs_all_params.
+ def test_get_ipsec_policy_all_params_with_retries(self):
+ # Enable retries and run test_get_ipsec_policy_all_params.
_service.enable_retries()
- self.test_list_vpn_gateway_connection_peer_cidrs_all_params()
+ self.test_get_ipsec_policy_all_params()
- # Disable retries and run test_list_vpn_gateway_connection_peer_cidrs_all_params.
+ # Disable retries and run test_get_ipsec_policy_all_params.
_service.disable_retries()
- self.test_list_vpn_gateway_connection_peer_cidrs_all_params()
+ self.test_get_ipsec_policy_all_params()
@responses.activate
- def test_list_vpn_gateway_connection_peer_cidrs_value_error(self):
+ def test_get_ipsec_policy_value_error(self):
"""
- test_list_vpn_gateway_connection_peer_cidrs_value_error()
+ test_get_ipsec_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs')
- mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}'
+ url = preprocess_url('/ipsec_policies/testString')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -23821,381 +22325,217 @@ def test_list_vpn_gateway_connection_peer_cidrs_value_error(self):
status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_vpn_gateway_connection_peer_cidrs(**req_copy)
+ _service.get_ipsec_policy(**req_copy)
- def test_list_vpn_gateway_connection_peer_cidrs_value_error_with_retries(self):
- # Enable retries and run test_list_vpn_gateway_connection_peer_cidrs_value_error.
+ def test_get_ipsec_policy_value_error_with_retries(self):
+ # Enable retries and run test_get_ipsec_policy_value_error.
_service.enable_retries()
- self.test_list_vpn_gateway_connection_peer_cidrs_value_error()
+ self.test_get_ipsec_policy_value_error()
- # Disable retries and run test_list_vpn_gateway_connection_peer_cidrs_value_error.
+ # Disable retries and run test_get_ipsec_policy_value_error.
_service.disable_retries()
- self.test_list_vpn_gateway_connection_peer_cidrs_value_error()
+ self.test_get_ipsec_policy_value_error()
-class TestRemoveVpnGatewayConnectionPeerCidr():
+class TestUpdateIpsecPolicy():
"""
- Test Class for remove_vpn_gateway_connection_peer_cidr
+ Test Class for update_ipsec_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_remove_vpn_gateway_connection_peer_cidr_all_params(self):
+ def test_update_ipsec_policy_all_params(self):
"""
- remove_vpn_gateway_connection_peer_cidr()
+ update_ipsec_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/ipsec_policies/testString')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ responses.add(responses.PATCH,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a IPsecPolicyPatch model
+ i_psec_policy_patch_model = {}
+ i_psec_policy_patch_model['authentication_algorithm'] = 'md5'
+ i_psec_policy_patch_model['encryption_algorithm'] = 'aes128'
+ i_psec_policy_patch_model['key_lifetime'] = 3600
+ i_psec_policy_patch_model['name'] = 'my-ipsec-policy'
+ i_psec_policy_patch_model['pfs'] = 'disabled'
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
+ i_psec_policy_patch = i_psec_policy_patch_model
# Invoke method
- response = _service.remove_vpn_gateway_connection_peer_cidr(
- vpn_gateway_id,
+ response = _service.update_ipsec_policy(
id,
- cidr_prefix,
- prefix_length,
+ i_psec_policy_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == i_psec_policy_patch
- def test_remove_vpn_gateway_connection_peer_cidr_all_params_with_retries(self):
- # Enable retries and run test_remove_vpn_gateway_connection_peer_cidr_all_params.
+ def test_update_ipsec_policy_all_params_with_retries(self):
+ # Enable retries and run test_update_ipsec_policy_all_params.
_service.enable_retries()
- self.test_remove_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_update_ipsec_policy_all_params()
- # Disable retries and run test_remove_vpn_gateway_connection_peer_cidr_all_params.
+ # Disable retries and run test_update_ipsec_policy_all_params.
_service.disable_retries()
- self.test_remove_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_update_ipsec_policy_all_params()
@responses.activate
- def test_remove_vpn_gateway_connection_peer_cidr_value_error(self):
+ def test_update_ipsec_policy_value_error(self):
"""
- test_remove_vpn_gateway_connection_peer_cidr_value_error()
+ test_update_ipsec_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/ipsec_policies/testString')
+ mock_response = '{"authentication_algorithm": "md5", "connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "encapsulation_mode": "tunnel", "encryption_algorithm": "aes128", "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "key_lifetime": 3600, "name": "my-ipsec-policy", "pfs": "disabled", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "ipsec_policy", "transform_protocol": "esp"}'
+ responses.add(responses.PATCH,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a IPsecPolicyPatch model
+ i_psec_policy_patch_model = {}
+ i_psec_policy_patch_model['authentication_algorithm'] = 'md5'
+ i_psec_policy_patch_model['encryption_algorithm'] = 'aes128'
+ i_psec_policy_patch_model['key_lifetime'] = 3600
+ i_psec_policy_patch_model['name'] = 'my-ipsec-policy'
+ i_psec_policy_patch_model['pfs'] = 'disabled'
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
+ i_psec_policy_patch = i_psec_policy_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
"id": id,
- "cidr_prefix": cidr_prefix,
- "prefix_length": prefix_length,
+ "i_psec_policy_patch": i_psec_policy_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.remove_vpn_gateway_connection_peer_cidr(**req_copy)
+ _service.update_ipsec_policy(**req_copy)
- def test_remove_vpn_gateway_connection_peer_cidr_value_error_with_retries(self):
- # Enable retries and run test_remove_vpn_gateway_connection_peer_cidr_value_error.
+ def test_update_ipsec_policy_value_error_with_retries(self):
+ # Enable retries and run test_update_ipsec_policy_value_error.
_service.enable_retries()
- self.test_remove_vpn_gateway_connection_peer_cidr_value_error()
+ self.test_update_ipsec_policy_value_error()
- # Disable retries and run test_remove_vpn_gateway_connection_peer_cidr_value_error.
+ # Disable retries and run test_update_ipsec_policy_value_error.
_service.disable_retries()
- self.test_remove_vpn_gateway_connection_peer_cidr_value_error()
+ self.test_update_ipsec_policy_value_error()
-class TestCheckVpnGatewayConnectionPeerCidr():
+class TestListIpsecPolicyConnections():
"""
- Test Class for check_vpn_gateway_connection_peer_cidr
+ Test Class for list_ipsec_policy_connections
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_check_vpn_gateway_connection_peer_cidr_all_params(self):
+ def test_list_ipsec_policy_connections_all_params(self):
"""
- check_vpn_gateway_connection_peer_cidr()
+ list_ipsec_policy_connections()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ url = preprocess_url('/ipsec_policies/testString/connections')
+ mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
responses.add(responses.GET,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
# Invoke method
- response = _service.check_vpn_gateway_connection_peer_cidr(
- vpn_gateway_id,
+ response = _service.list_ipsec_policy_connections(
id,
- cidr_prefix,
- prefix_length,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
- def test_check_vpn_gateway_connection_peer_cidr_all_params_with_retries(self):
- # Enable retries and run test_check_vpn_gateway_connection_peer_cidr_all_params.
+ def test_list_ipsec_policy_connections_all_params_with_retries(self):
+ # Enable retries and run test_list_ipsec_policy_connections_all_params.
_service.enable_retries()
- self.test_check_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_list_ipsec_policy_connections_all_params()
- # Disable retries and run test_check_vpn_gateway_connection_peer_cidr_all_params.
+ # Disable retries and run test_list_ipsec_policy_connections_all_params.
_service.disable_retries()
- self.test_check_vpn_gateway_connection_peer_cidr_all_params()
+ self.test_list_ipsec_policy_connections_all_params()
@responses.activate
- def test_check_vpn_gateway_connection_peer_cidr_value_error(self):
+ def test_list_ipsec_policy_connections_value_error(self):
"""
- test_check_vpn_gateway_connection_peer_cidr_value_error()
+ test_list_ipsec_policy_connections_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ url = preprocess_url('/ipsec_policies/testString/connections')
+ mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
responses.add(responses.GET,
url,
- status=204)
-
- # Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
- "id": id,
- "cidr_prefix": cidr_prefix,
- "prefix_length": prefix_length,
- }
- for param in req_param_dict.keys():
- req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.check_vpn_gateway_connection_peer_cidr(**req_copy)
-
-
- def test_check_vpn_gateway_connection_peer_cidr_value_error_with_retries(self):
- # Enable retries and run test_check_vpn_gateway_connection_peer_cidr_value_error.
- _service.enable_retries()
- self.test_check_vpn_gateway_connection_peer_cidr_value_error()
-
- # Disable retries and run test_check_vpn_gateway_connection_peer_cidr_value_error.
- _service.disable_retries()
- self.test_check_vpn_gateway_connection_peer_cidr_value_error()
-
-class TestAddVpnGatewayConnectionPeerCidr():
- """
- Test Class for add_vpn_gateway_connection_peer_cidr
- """
-
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
- @responses.activate
- def test_add_vpn_gateway_connection_peer_cidr_all_params(self):
- """
- add_vpn_gateway_connection_peer_cidr()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
- responses.add(responses.PUT,
- url,
- status=204)
-
- # Set up parameter values
- vpn_gateway_id = 'testString'
- id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
-
- # Invoke method
- response = _service.add_vpn_gateway_connection_peer_cidr(
- vpn_gateway_id,
- id,
- cidr_prefix,
- prefix_length,
- headers={}
- )
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 204
-
- def test_add_vpn_gateway_connection_peer_cidr_all_params_with_retries(self):
- # Enable retries and run test_add_vpn_gateway_connection_peer_cidr_all_params.
- _service.enable_retries()
- self.test_add_vpn_gateway_connection_peer_cidr_all_params()
-
- # Disable retries and run test_add_vpn_gateway_connection_peer_cidr_all_params.
- _service.disable_retries()
- self.test_add_vpn_gateway_connection_peer_cidr_all_params()
-
- @responses.activate
- def test_add_vpn_gateway_connection_peer_cidr_value_error(self):
- """
- test_add_vpn_gateway_connection_peer_cidr_value_error()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
- responses.add(responses.PUT,
- url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- vpn_gateway_id = 'testString'
id = 'testString'
- cidr_prefix = 'testString'
- prefix_length = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "vpn_gateway_id": vpn_gateway_id,
"id": id,
- "cidr_prefix": cidr_prefix,
- "prefix_length": prefix_length,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.add_vpn_gateway_connection_peer_cidr(**req_copy)
+ _service.list_ipsec_policy_connections(**req_copy)
- def test_add_vpn_gateway_connection_peer_cidr_value_error_with_retries(self):
- # Enable retries and run test_add_vpn_gateway_connection_peer_cidr_value_error.
+ def test_list_ipsec_policy_connections_value_error_with_retries(self):
+ # Enable retries and run test_list_ipsec_policy_connections_value_error.
_service.enable_retries()
- self.test_add_vpn_gateway_connection_peer_cidr_value_error()
+ self.test_list_ipsec_policy_connections_value_error()
- # Disable retries and run test_add_vpn_gateway_connection_peer_cidr_value_error.
+ # Disable retries and run test_list_ipsec_policy_connections_value_error.
_service.disable_retries()
- self.test_add_vpn_gateway_connection_peer_cidr_value_error()
-
-# endregion
-##############################################################################
-# End of Service: VPNGateways
-##############################################################################
-
-##############################################################################
-# Start of Service: LoadBalancers
-##############################################################################
-# region
-
-class TestNewInstance():
- """
- Test Class for new_instance
- """
-
- def test_new_instance(self):
- """
- new_instance()
- """
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
-
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
- )
-
- assert service is not None
- assert isinstance(service, VpcV1)
-
- def test_new_instance_without_authenticator(self):
- """
- new_instance_without_authenticator()
- """
- with pytest.raises(ValueError, match='authenticator must be provided'):
- service = VpcV1.new_instance(
- version=version,
- )
+ self.test_list_ipsec_policy_connections_value_error()
- def test_new_instance_required_param_none(self):
- """
- new_instance_required_param_none()
- """
- with pytest.raises(ValueError, match='version must be provided'):
- service = VpcV1.new_instance(
- version=None,
- )
-class TestListLoadBalancerProfiles():
+class TestListVpnGateways():
"""
- Test Class for list_load_balancer_profiles
+ Test Class for list_vpn_gateways
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_load_balancer_profiles_all_params(self):
+ def test_list_vpn_gateways_all_params(self):
"""
- list_load_balancer_profiles()
+ list_vpn_gateways()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancer/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
+ url = preprocess_url('/vpn_gateways')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -24205,11 +22545,15 @@ def test_list_load_balancer_profiles_all_params(self):
# Set up parameter values
start = 'testString'
limit = 1
+ resource_group_id = 'testString'
+ mode = 'route'
# Invoke method
- response = _service.list_load_balancer_profiles(
+ response = _service.list_vpn_gateways(
start=start,
limit=limit,
+ resource_group_id=resource_group_id,
+ mode=mode,
headers={}
)
@@ -24221,24 +22565,26 @@ def test_list_load_balancer_profiles_all_params(self):
query_string = urllib.parse.unquote_plus(query_string)
assert 'start={}'.format(start) in query_string
assert 'limit={}'.format(limit) in query_string
+ assert 'resource_group.id={}'.format(resource_group_id) in query_string
+ assert 'mode={}'.format(mode) in query_string
- def test_list_load_balancer_profiles_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_profiles_all_params.
+ def test_list_vpn_gateways_all_params_with_retries(self):
+ # Enable retries and run test_list_vpn_gateways_all_params.
_service.enable_retries()
- self.test_list_load_balancer_profiles_all_params()
+ self.test_list_vpn_gateways_all_params()
- # Disable retries and run test_list_load_balancer_profiles_all_params.
+ # Disable retries and run test_list_vpn_gateways_all_params.
_service.disable_retries()
- self.test_list_load_balancer_profiles_all_params()
+ self.test_list_vpn_gateways_all_params()
@responses.activate
- def test_list_load_balancer_profiles_required_params(self):
+ def test_list_vpn_gateways_required_params(self):
"""
- test_list_load_balancer_profiles_required_params()
+ test_list_vpn_gateways_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancer/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
+ url = preprocess_url('/vpn_gateways')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -24246,30 +22592,30 @@ def test_list_load_balancer_profiles_required_params(self):
status=200)
# Invoke method
- response = _service.list_load_balancer_profiles()
+ response = _service.list_vpn_gateways()
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_load_balancer_profiles_required_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_profiles_required_params.
+ def test_list_vpn_gateways_required_params_with_retries(self):
+ # Enable retries and run test_list_vpn_gateways_required_params.
_service.enable_retries()
- self.test_list_load_balancer_profiles_required_params()
+ self.test_list_vpn_gateways_required_params()
- # Disable retries and run test_list_load_balancer_profiles_required_params.
+ # Disable retries and run test_list_vpn_gateways_required_params.
_service.disable_retries()
- self.test_list_load_balancer_profiles_required_params()
+ self.test_list_vpn_gateways_required_params()
@responses.activate
- def test_list_load_balancer_profiles_value_error(self):
+ def test_list_vpn_gateways_value_error(self):
"""
- test_list_load_balancer_profiles_value_error()
+ test_list_vpn_gateways_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancer/profiles')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
+ url = preprocess_url('/vpn_gateways')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132, "vpn_gateways": [{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -24282,606 +22628,381 @@ def test_list_load_balancer_profiles_value_error(self):
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_load_balancer_profiles(**req_copy)
+ _service.list_vpn_gateways(**req_copy)
- def test_list_load_balancer_profiles_value_error_with_retries(self):
- # Enable retries and run test_list_load_balancer_profiles_value_error.
+ def test_list_vpn_gateways_value_error_with_retries(self):
+ # Enable retries and run test_list_vpn_gateways_value_error.
_service.enable_retries()
- self.test_list_load_balancer_profiles_value_error()
+ self.test_list_vpn_gateways_value_error()
- # Disable retries and run test_list_load_balancer_profiles_value_error.
+ # Disable retries and run test_list_vpn_gateways_value_error.
_service.disable_retries()
- self.test_list_load_balancer_profiles_value_error()
+ self.test_list_vpn_gateways_value_error()
-class TestGetLoadBalancerProfile():
+class TestCreateVpnGateway():
"""
- Test Class for get_load_balancer_profile
+ Test Class for create_vpn_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_load_balancer_profile_all_params(self):
+ def test_create_vpn_gateway_all_params(self):
"""
- get_load_balancer_profile()
+ create_vpn_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancer/profiles/testString')
- mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways')
+ mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200)
+ status=201)
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model
+ vpn_gateway_prototype_model = {}
+ vpn_gateway_prototype_model['name'] = 'my-vpn-gateway'
+ vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model
+ vpn_gateway_prototype_model['subnet'] = subnet_identity_model
+ vpn_gateway_prototype_model['mode'] = 'route'
# Set up parameter values
- name = 'testString'
+ vpn_gateway_prototype = vpn_gateway_prototype_model
# Invoke method
- response = _service.get_load_balancer_profile(
- name,
+ response = _service.create_vpn_gateway(
+ vpn_gateway_prototype,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 201
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == vpn_gateway_prototype
- def test_get_load_balancer_profile_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_profile_all_params.
+ def test_create_vpn_gateway_all_params_with_retries(self):
+ # Enable retries and run test_create_vpn_gateway_all_params.
_service.enable_retries()
- self.test_get_load_balancer_profile_all_params()
+ self.test_create_vpn_gateway_all_params()
- # Disable retries and run test_get_load_balancer_profile_all_params.
+ # Disable retries and run test_create_vpn_gateway_all_params.
_service.disable_retries()
- self.test_get_load_balancer_profile_all_params()
+ self.test_create_vpn_gateway_all_params()
@responses.activate
- def test_get_load_balancer_profile_value_error(self):
+ def test_create_vpn_gateway_value_error(self):
"""
- test_get_load_balancer_profile_value_error()
+ test_create_vpn_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancer/profiles/testString')
- mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways')
+ mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200)
+ status=201)
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a dict representation of a VPNGatewayPrototypeVPNGatewayRouteModePrototype model
+ vpn_gateway_prototype_model = {}
+ vpn_gateway_prototype_model['name'] = 'my-vpn-gateway'
+ vpn_gateway_prototype_model['resource_group'] = resource_group_identity_model
+ vpn_gateway_prototype_model['subnet'] = subnet_identity_model
+ vpn_gateway_prototype_model['mode'] = 'route'
# Set up parameter values
- name = 'testString'
+ vpn_gateway_prototype = vpn_gateway_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "name": name,
+ "vpn_gateway_prototype": vpn_gateway_prototype,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_load_balancer_profile(**req_copy)
+ _service.create_vpn_gateway(**req_copy)
- def test_get_load_balancer_profile_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_profile_value_error.
+ def test_create_vpn_gateway_value_error_with_retries(self):
+ # Enable retries and run test_create_vpn_gateway_value_error.
_service.enable_retries()
- self.test_get_load_balancer_profile_value_error()
+ self.test_create_vpn_gateway_value_error()
- # Disable retries and run test_get_load_balancer_profile_value_error.
+ # Disable retries and run test_create_vpn_gateway_value_error.
_service.disable_retries()
- self.test_get_load_balancer_profile_value_error()
+ self.test_create_vpn_gateway_value_error()
-class TestListLoadBalancers():
+class TestDeleteVpnGateway():
"""
- Test Class for list_load_balancers
+ Test Class for delete_vpn_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_load_balancers_all_params(self):
+ def test_delete_vpn_gateway_all_params(self):
"""
- list_load_balancers()
+ delete_vpn_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=202)
# Set up parameter values
- start = 'testString'
- limit = 1
+ id = 'testString'
# Invoke method
- response = _service.list_load_balancers(
- start=start,
- limit=limit,
+ response = _service.delete_vpn_gateway(
+ 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 response.status_code == 202
- def test_list_load_balancers_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancers_all_params.
+ def test_delete_vpn_gateway_all_params_with_retries(self):
+ # Enable retries and run test_delete_vpn_gateway_all_params.
_service.enable_retries()
- self.test_list_load_balancers_all_params()
+ self.test_delete_vpn_gateway_all_params()
- # Disable retries and run test_list_load_balancers_all_params.
+ # Disable retries and run test_delete_vpn_gateway_all_params.
_service.disable_retries()
- self.test_list_load_balancers_all_params()
+ self.test_delete_vpn_gateway_all_params()
@responses.activate
- def test_list_load_balancers_required_params(self):
+ def test_delete_vpn_gateway_value_error(self):
"""
- test_list_load_balancers_required_params()
+ test_delete_vpn_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
-
- # Invoke method
- response = _service.list_load_balancers()
-
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- def test_list_load_balancers_required_params_with_retries(self):
- # Enable retries and run test_list_load_balancers_required_params.
- _service.enable_retries()
- self.test_list_load_balancers_required_params()
-
- # Disable retries and run test_list_load_balancers_required_params.
- _service.disable_retries()
- self.test_list_load_balancers_required_params()
+ status=202)
- @responses.activate
- def test_list_load_balancers_value_error(self):
- """
- test_list_load_balancers_value_error()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
- responses.add(responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ # Set up parameter values
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_load_balancers(**req_copy)
+ _service.delete_vpn_gateway(**req_copy)
- def test_list_load_balancers_value_error_with_retries(self):
- # Enable retries and run test_list_load_balancers_value_error.
+ def test_delete_vpn_gateway_value_error_with_retries(self):
+ # Enable retries and run test_delete_vpn_gateway_value_error.
_service.enable_retries()
- self.test_list_load_balancers_value_error()
+ self.test_delete_vpn_gateway_value_error()
- # Disable retries and run test_list_load_balancers_value_error.
+ # Disable retries and run test_delete_vpn_gateway_value_error.
_service.disable_retries()
- self.test_list_load_balancers_value_error()
+ self.test_delete_vpn_gateway_value_error()
-class TestCreateLoadBalancer():
+class TestGetVpnGateway():
"""
- Test Class for create_load_balancer
+ Test Class for get_vpn_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_load_balancer_all_params(self):
+ def test_get_vpn_gateway_all_params(self):
"""
- create_load_balancer()
+ get_vpn_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
- responses.add(responses.POST,
+ url = preprocess_url('/vpn_gateways/testString')
+ mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # 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 LoadBalancerPoolIdentityByName model
- load_balancer_pool_identity_by_name_model = {}
- load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
-
- # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
- load_balancer_listener_prototype_load_balancer_context_model = {}
- load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True
- load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000
- load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model
- load_balancer_listener_prototype_load_balancer_context_model['port'] = 443
- load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499
- load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443
- load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http'
-
- # Construct a dict representation of a LoadBalancerLoggingDatapath model
- load_balancer_logging_datapath_model = {}
- load_balancer_logging_datapath_model['active'] = True
-
- # Construct a dict representation of a LoadBalancerLogging model
- load_balancer_logging_model = {}
- load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
-
- # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model
- load_balancer_pool_health_monitor_prototype_model = {}
- load_balancer_pool_health_monitor_prototype_model['delay'] = 5
- load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2
- load_balancer_pool_health_monitor_prototype_model['port'] = 22
- load_balancer_pool_health_monitor_prototype_model['timeout'] = 2
- load_balancer_pool_health_monitor_prototype_model['type'] = 'http'
- load_balancer_pool_health_monitor_prototype_model['url_path'] = '/'
-
- # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
- load_balancer_pool_member_target_prototype_model = {}
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
- load_balancer_pool_member_prototype_model = {}
- load_balancer_pool_member_prototype_model['port'] = 80
- load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
- load_balancer_pool_member_prototype_model['weight'] = 50
-
- # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model
- load_balancer_pool_session_persistence_prototype_model = {}
- load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie'
-
- # Construct a dict representation of a LoadBalancerPoolPrototype model
- load_balancer_pool_prototype_model = {}
- load_balancer_pool_prototype_model['algorithm'] = 'least_connections'
- load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model
- load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model]
- load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool'
- load_balancer_pool_prototype_model['protocol'] = 'http'
- load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled'
- load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model
-
- # Construct a dict representation of a LoadBalancerProfileIdentityByName model
- load_balancer_profile_identity_model = {}
- load_balancer_profile_identity_model['name'] = 'network-fixed'
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # Construct a dict representation of a SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ status=200)
# Set up parameter values
- is_public = True
- subnets = [subnet_identity_model]
- listeners = [load_balancer_listener_prototype_load_balancer_context_model]
- logging = load_balancer_logging_model
- name = 'my-load-balancer'
- pools = [load_balancer_pool_prototype_model]
- profile = load_balancer_profile_identity_model
- resource_group = resource_group_identity_model
- route_mode = True
- security_groups = [security_group_identity_model]
+ id = 'testString'
# Invoke method
- response = _service.create_load_balancer(
- is_public,
- subnets,
- listeners=listeners,
- logging=logging,
- name=name,
- pools=pools,
- profile=profile,
- resource_group=resource_group,
- route_mode=route_mode,
- security_groups=security_groups,
+ response = _service.get_vpn_gateway(
+ id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['is_public'] == True
- assert req_body['subnets'] == [subnet_identity_model]
- assert req_body['listeners'] == [load_balancer_listener_prototype_load_balancer_context_model]
- assert req_body['logging'] == load_balancer_logging_model
- assert req_body['name'] == 'my-load-balancer'
- assert req_body['pools'] == [load_balancer_pool_prototype_model]
- assert req_body['profile'] == load_balancer_profile_identity_model
- assert req_body['resource_group'] == resource_group_identity_model
- assert req_body['route_mode'] == True
- assert req_body['security_groups'] == [security_group_identity_model]
+ assert response.status_code == 200
- def test_create_load_balancer_all_params_with_retries(self):
- # Enable retries and run test_create_load_balancer_all_params.
+ def test_get_vpn_gateway_all_params_with_retries(self):
+ # Enable retries and run test_get_vpn_gateway_all_params.
_service.enable_retries()
- self.test_create_load_balancer_all_params()
+ self.test_get_vpn_gateway_all_params()
- # Disable retries and run test_create_load_balancer_all_params.
+ # Disable retries and run test_get_vpn_gateway_all_params.
_service.disable_retries()
- self.test_create_load_balancer_all_params()
+ self.test_get_vpn_gateway_all_params()
@responses.activate
- def test_create_load_balancer_value_error(self):
+ def test_get_vpn_gateway_value_error(self):
"""
- test_create_load_balancer_value_error()
+ test_get_vpn_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
- responses.add(responses.POST,
+ url = preprocess_url('/vpn_gateways/testString')
+ mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # 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 LoadBalancerPoolIdentityByName model
- load_balancer_pool_identity_by_name_model = {}
- load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
-
- # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
- load_balancer_listener_prototype_load_balancer_context_model = {}
- load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True
- load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000
- load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model
- load_balancer_listener_prototype_load_balancer_context_model['port'] = 443
- load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499
- load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443
- load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http'
-
- # Construct a dict representation of a LoadBalancerLoggingDatapath model
- load_balancer_logging_datapath_model = {}
- load_balancer_logging_datapath_model['active'] = True
-
- # Construct a dict representation of a LoadBalancerLogging model
- load_balancer_logging_model = {}
- load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
-
- # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model
- load_balancer_pool_health_monitor_prototype_model = {}
- load_balancer_pool_health_monitor_prototype_model['delay'] = 5
- load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2
- load_balancer_pool_health_monitor_prototype_model['port'] = 22
- load_balancer_pool_health_monitor_prototype_model['timeout'] = 2
- load_balancer_pool_health_monitor_prototype_model['type'] = 'http'
- load_balancer_pool_health_monitor_prototype_model['url_path'] = '/'
-
- # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
- load_balancer_pool_member_target_prototype_model = {}
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
- load_balancer_pool_member_prototype_model = {}
- load_balancer_pool_member_prototype_model['port'] = 80
- load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
- load_balancer_pool_member_prototype_model['weight'] = 50
-
- # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model
- load_balancer_pool_session_persistence_prototype_model = {}
- load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie'
-
- # Construct a dict representation of a LoadBalancerPoolPrototype model
- load_balancer_pool_prototype_model = {}
- load_balancer_pool_prototype_model['algorithm'] = 'least_connections'
- load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model
- load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model]
- load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool'
- load_balancer_pool_prototype_model['protocol'] = 'http'
- load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled'
- load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model
-
- # Construct a dict representation of a LoadBalancerProfileIdentityByName model
- load_balancer_profile_identity_model = {}
- load_balancer_profile_identity_model['name'] = 'network-fixed'
-
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
-
- # Construct a dict representation of a SecurityGroupIdentityById model
- security_group_identity_model = {}
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ status=200)
# Set up parameter values
- is_public = True
- subnets = [subnet_identity_model]
- listeners = [load_balancer_listener_prototype_load_balancer_context_model]
- logging = load_balancer_logging_model
- name = 'my-load-balancer'
- pools = [load_balancer_pool_prototype_model]
- profile = load_balancer_profile_identity_model
- resource_group = resource_group_identity_model
- route_mode = True
- security_groups = [security_group_identity_model]
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "is_public": is_public,
- "subnets": subnets,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_load_balancer(**req_copy)
+ _service.get_vpn_gateway(**req_copy)
- def test_create_load_balancer_value_error_with_retries(self):
- # Enable retries and run test_create_load_balancer_value_error.
+ def test_get_vpn_gateway_value_error_with_retries(self):
+ # Enable retries and run test_get_vpn_gateway_value_error.
_service.enable_retries()
- self.test_create_load_balancer_value_error()
+ self.test_get_vpn_gateway_value_error()
- # Disable retries and run test_create_load_balancer_value_error.
+ # Disable retries and run test_get_vpn_gateway_value_error.
_service.disable_retries()
- self.test_create_load_balancer_value_error()
+ self.test_get_vpn_gateway_value_error()
-class TestDeleteLoadBalancer():
+class TestUpdateVpnGateway():
"""
- Test Class for delete_load_balancer
+ Test Class for update_vpn_gateway
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_load_balancer_all_params(self):
+ def test_update_vpn_gateway_all_params(self):
"""
- delete_load_balancer()
+ update_vpn_gateway()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/vpn_gateways/testString')
+ mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
+ responses.add(responses.PATCH,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a VPNGatewayPatch model
+ vpn_gateway_patch_model = {}
+ vpn_gateway_patch_model['name'] = 'my-vpn-gateway'
# Set up parameter values
id = 'testString'
+ vpn_gateway_patch = vpn_gateway_patch_model
# Invoke method
- response = _service.delete_load_balancer(
+ response = _service.update_vpn_gateway(
id,
+ vpn_gateway_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == vpn_gateway_patch
- def test_delete_load_balancer_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_all_params.
+ def test_update_vpn_gateway_all_params_with_retries(self):
+ # Enable retries and run test_update_vpn_gateway_all_params.
_service.enable_retries()
- self.test_delete_load_balancer_all_params()
+ self.test_update_vpn_gateway_all_params()
- # Disable retries and run test_delete_load_balancer_all_params.
+ # Disable retries and run test_update_vpn_gateway_all_params.
_service.disable_retries()
- self.test_delete_load_balancer_all_params()
+ self.test_update_vpn_gateway_all_params()
@responses.activate
- def test_delete_load_balancer_value_error(self):
+ def test_update_vpn_gateway_value_error(self):
"""
- test_delete_load_balancer_value_error()
+ test_update_vpn_gateway_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/vpn_gateways/testString')
+ mock_response = '{"connections": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "name": "my-vpn-connection", "resource_type": "vpn_gateway_connection"}], "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b", "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "members": [{"private_ip": {"address": "192.168.3.4"}, "public_ip": {"address": "192.168.3.4"}, "role": "active", "status": "available"}], "name": "my-vpn-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "vpn_gateway", "status": "available", "subnet": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}, "mode": "route"}'
+ responses.add(responses.PATCH,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a VPNGatewayPatch model
+ vpn_gateway_patch_model = {}
+ vpn_gateway_patch_model['name'] = 'my-vpn-gateway'
# Set up parameter values
id = 'testString'
+ vpn_gateway_patch = vpn_gateway_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"id": id,
+ "vpn_gateway_patch": vpn_gateway_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_load_balancer(**req_copy)
+ _service.update_vpn_gateway(**req_copy)
- def test_delete_load_balancer_value_error_with_retries(self):
- # Enable retries and run test_delete_load_balancer_value_error.
+ def test_update_vpn_gateway_value_error_with_retries(self):
+ # Enable retries and run test_update_vpn_gateway_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_value_error()
+ self.test_update_vpn_gateway_value_error()
- # Disable retries and run test_delete_load_balancer_value_error.
+ # Disable retries and run test_update_vpn_gateway_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_value_error()
+ self.test_update_vpn_gateway_value_error()
-class TestGetLoadBalancer():
+class TestListVpnGatewayConnections():
"""
- Test Class for get_load_balancer
+ Test Class for list_vpn_gateway_connections
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_load_balancer_all_params(self):
+ def test_list_vpn_gateway_connections_all_params(self):
"""
- get_load_balancer()
+ list_vpn_gateway_connections()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
+ url = preprocess_url('/vpn_gateways/testString/connections')
+ mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -24889,35 +23010,41 @@ def test_get_load_balancer_all_params(self):
status=200)
# Set up parameter values
- id = 'testString'
+ vpn_gateway_id = 'testString'
+ status = 'testString'
# Invoke method
- response = _service.get_load_balancer(
- id,
+ response = _service.list_vpn_gateway_connections(
+ vpn_gateway_id,
+ status=status,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?',1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'status={}'.format(status) in query_string
- def test_get_load_balancer_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_all_params.
+ def test_list_vpn_gateway_connections_all_params_with_retries(self):
+ # Enable retries and run test_list_vpn_gateway_connections_all_params.
_service.enable_retries()
- self.test_get_load_balancer_all_params()
+ self.test_list_vpn_gateway_connections_all_params()
- # Disable retries and run test_get_load_balancer_all_params.
+ # Disable retries and run test_list_vpn_gateway_connections_all_params.
_service.disable_retries()
- self.test_get_load_balancer_all_params()
+ self.test_list_vpn_gateway_connections_all_params()
@responses.activate
- def test_get_load_balancer_value_error(self):
+ def test_list_vpn_gateway_connections_required_params(self):
"""
- test_get_load_balancer_value_error()
+ test_list_vpn_gateway_connections_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
+ url = preprocess_url('/vpn_gateways/testString/connections')
+ mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -24925,260 +23052,285 @@ def test_get_load_balancer_value_error(self):
status=200)
# Set up parameter values
- id = 'testString'
+ vpn_gateway_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_load_balancer(**req_copy)
+ # Invoke method
+ response = _service.list_vpn_gateway_connections(
+ vpn_gateway_id,
+ headers={}
+ )
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
- def test_get_load_balancer_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_value_error.
+ def test_list_vpn_gateway_connections_required_params_with_retries(self):
+ # Enable retries and run test_list_vpn_gateway_connections_required_params.
_service.enable_retries()
- self.test_get_load_balancer_value_error()
+ self.test_list_vpn_gateway_connections_required_params()
- # Disable retries and run test_get_load_balancer_value_error.
+ # Disable retries and run test_list_vpn_gateway_connections_required_params.
_service.disable_retries()
- self.test_get_load_balancer_value_error()
-
-class TestUpdateLoadBalancer():
- """
- Test Class for update_load_balancer
- """
+ self.test_list_vpn_gateway_connections_required_params()
- def preprocess_url(self, request_url: str):
+ @responses.activate
+ def test_list_vpn_gateway_connections_value_error(self):
"""
- Preprocess the request URL to ensure the mock response will be found.
+ test_list_vpn_gateway_connections_value_error()
"""
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ # Set up mock
+ url = preprocess_url('/vpn_gateways/testString/connections')
+ mock_response = '{"connections": [{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}]}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ vpn_gateway_id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "vpn_gateway_id": vpn_gateway_id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.list_vpn_gateway_connections(**req_copy)
+
+
+ def test_list_vpn_gateway_connections_value_error_with_retries(self):
+ # Enable retries and run test_list_vpn_gateway_connections_value_error.
+ _service.enable_retries()
+ self.test_list_vpn_gateway_connections_value_error()
+
+ # Disable retries and run test_list_vpn_gateway_connections_value_error.
+ _service.disable_retries()
+ self.test_list_vpn_gateway_connections_value_error()
+
+class TestCreateVpnGatewayConnection():
+ """
+ Test Class for create_vpn_gateway_connection
+ """
@responses.activate
- def test_update_load_balancer_all_params(self):
+ def test_create_vpn_gateway_connection_all_params(self):
"""
- update_load_balancer()
+ create_vpn_gateway_connection()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/vpn_gateways/testString/connections')
+ mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200)
+ status=201)
- # Construct a dict representation of a LoadBalancerLoggingDatapath model
- load_balancer_logging_datapath_model = {}
- load_balancer_logging_datapath_model['active'] = True
+ # Construct a dict representation of a VPNGatewayConnectionDPDPrototype model
+ vpn_gateway_connection_dpd_prototype_model = {}
+ vpn_gateway_connection_dpd_prototype_model['action'] = 'restart'
+ vpn_gateway_connection_dpd_prototype_model['interval'] = 30
+ vpn_gateway_connection_dpd_prototype_model['timeout'] = 120
- # Construct a dict representation of a LoadBalancerLogging model
- load_balancer_logging_model = {}
- load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
+ # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model
+ vpn_gateway_connection_ike_policy_prototype_model = {}
+ vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a dict representation of a LoadBalancerPatch model
- load_balancer_patch_model = {}
- load_balancer_patch_model['logging'] = load_balancer_logging_model
- load_balancer_patch_model['name'] = 'my-load-balancer'
+ # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model
+ vpn_gateway_connection_i_psec_policy_prototype_model = {}
+ vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+
+ # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
+ vpn_gateway_connection_prototype_model = {}
+ vpn_gateway_connection_prototype_model['admin_state_up'] = True
+ vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model
+ vpn_gateway_connection_prototype_model['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model
+ vpn_gateway_connection_prototype_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model
+ vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_prototype_model['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_prototype_model['routing_protocol'] = 'none'
# Set up parameter values
- id = 'testString'
- load_balancer_patch = load_balancer_patch_model
+ vpn_gateway_id = 'testString'
+ vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model
# Invoke method
- response = _service.update_load_balancer(
- id,
- load_balancer_patch,
+ response = _service.create_vpn_gateway_connection(
+ vpn_gateway_id,
+ vpn_gateway_connection_prototype,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == load_balancer_patch
+ assert req_body == vpn_gateway_connection_prototype
- def test_update_load_balancer_all_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_all_params.
+ def test_create_vpn_gateway_connection_all_params_with_retries(self):
+ # Enable retries and run test_create_vpn_gateway_connection_all_params.
_service.enable_retries()
- self.test_update_load_balancer_all_params()
+ self.test_create_vpn_gateway_connection_all_params()
- # Disable retries and run test_update_load_balancer_all_params.
+ # Disable retries and run test_create_vpn_gateway_connection_all_params.
_service.disable_retries()
- self.test_update_load_balancer_all_params()
+ self.test_create_vpn_gateway_connection_all_params()
@responses.activate
- def test_update_load_balancer_value_error(self):
+ def test_create_vpn_gateway_connection_value_error(self):
"""
- test_update_load_balancer_value_error()
+ test_create_vpn_gateway_connection_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/vpn_gateways/testString/connections')
+ mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200)
+ status=201)
- # Construct a dict representation of a LoadBalancerLoggingDatapath model
- load_balancer_logging_datapath_model = {}
- load_balancer_logging_datapath_model['active'] = True
+ # Construct a dict representation of a VPNGatewayConnectionDPDPrototype model
+ vpn_gateway_connection_dpd_prototype_model = {}
+ vpn_gateway_connection_dpd_prototype_model['action'] = 'restart'
+ vpn_gateway_connection_dpd_prototype_model['interval'] = 30
+ vpn_gateway_connection_dpd_prototype_model['timeout'] = 120
- # Construct a dict representation of a LoadBalancerLogging model
- load_balancer_logging_model = {}
- load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
+ # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPrototypeIKEPolicyIdentityById model
+ vpn_gateway_connection_ike_policy_prototype_model = {}
+ vpn_gateway_connection_ike_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a dict representation of a LoadBalancerPatch model
- load_balancer_patch_model = {}
- load_balancer_patch_model['logging'] = load_balancer_logging_model
- load_balancer_patch_model['name'] = 'my-load-balancer'
+ # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPrototypeIPsecPolicyIdentityById model
+ vpn_gateway_connection_i_psec_policy_prototype_model = {}
+ vpn_gateway_connection_i_psec_policy_prototype_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+
+ # Construct a dict representation of a VPNGatewayConnectionPrototypeVPNGatewayConnectionStaticRouteModePrototype model
+ vpn_gateway_connection_prototype_model = {}
+ vpn_gateway_connection_prototype_model['admin_state_up'] = True
+ vpn_gateway_connection_prototype_model['dead_peer_detection'] = vpn_gateway_connection_dpd_prototype_model
+ vpn_gateway_connection_prototype_model['ike_policy'] = vpn_gateway_connection_ike_policy_prototype_model
+ vpn_gateway_connection_prototype_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_prototype_model
+ vpn_gateway_connection_prototype_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_prototype_model['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_prototype_model['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_prototype_model['routing_protocol'] = 'none'
# Set up parameter values
- id = 'testString'
- load_balancer_patch = load_balancer_patch_model
+ vpn_gateway_id = 'testString'
+ vpn_gateway_connection_prototype = vpn_gateway_connection_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "id": id,
- "load_balancer_patch": load_balancer_patch,
+ "vpn_gateway_id": vpn_gateway_id,
+ "vpn_gateway_connection_prototype": vpn_gateway_connection_prototype,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_load_balancer(**req_copy)
+ _service.create_vpn_gateway_connection(**req_copy)
- def test_update_load_balancer_value_error_with_retries(self):
- # Enable retries and run test_update_load_balancer_value_error.
+ def test_create_vpn_gateway_connection_value_error_with_retries(self):
+ # Enable retries and run test_create_vpn_gateway_connection_value_error.
_service.enable_retries()
- self.test_update_load_balancer_value_error()
+ self.test_create_vpn_gateway_connection_value_error()
- # Disable retries and run test_update_load_balancer_value_error.
+ # Disable retries and run test_create_vpn_gateway_connection_value_error.
_service.disable_retries()
- self.test_update_load_balancer_value_error()
+ self.test_create_vpn_gateway_connection_value_error()
-class TestGetLoadBalancerStatistics():
+class TestDeleteVpnGatewayConnection():
"""
- Test Class for get_load_balancer_statistics
+ Test Class for delete_vpn_gateway_connection
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_load_balancer_statistics_all_params(self):
+ def test_delete_vpn_gateway_connection_all_params(self):
"""
- get_load_balancer_statistics()
+ delete_vpn_gateway_connection()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/statistics')
- mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=202)
# Set up parameter values
+ vpn_gateway_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_load_balancer_statistics(
+ response = _service.delete_vpn_gateway_connection(
+ vpn_gateway_id,
id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 202
- def test_get_load_balancer_statistics_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_statistics_all_params.
+ def test_delete_vpn_gateway_connection_all_params_with_retries(self):
+ # Enable retries and run test_delete_vpn_gateway_connection_all_params.
_service.enable_retries()
- self.test_get_load_balancer_statistics_all_params()
+ self.test_delete_vpn_gateway_connection_all_params()
- # Disable retries and run test_get_load_balancer_statistics_all_params.
+ # Disable retries and run test_delete_vpn_gateway_connection_all_params.
_service.disable_retries()
- self.test_get_load_balancer_statistics_all_params()
+ self.test_delete_vpn_gateway_connection_all_params()
@responses.activate
- def test_get_load_balancer_statistics_value_error(self):
+ def test_delete_vpn_gateway_connection_value_error(self):
"""
- test_get_load_balancer_statistics_value_error()
+ test_delete_vpn_gateway_connection_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/statistics')
- mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=202)
# Set up parameter values
+ vpn_gateway_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "vpn_gateway_id": vpn_gateway_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_load_balancer_statistics(**req_copy)
+ _service.delete_vpn_gateway_connection(**req_copy)
- def test_get_load_balancer_statistics_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_statistics_value_error.
+ def test_delete_vpn_gateway_connection_value_error_with_retries(self):
+ # Enable retries and run test_delete_vpn_gateway_connection_value_error.
_service.enable_retries()
- self.test_get_load_balancer_statistics_value_error()
+ self.test_delete_vpn_gateway_connection_value_error()
- # Disable retries and run test_get_load_balancer_statistics_value_error.
+ # Disable retries and run test_delete_vpn_gateway_connection_value_error.
_service.disable_retries()
- self.test_get_load_balancer_statistics_value_error()
+ self.test_delete_vpn_gateway_connection_value_error()
-class TestListLoadBalancerListeners():
+class TestGetVpnGatewayConnection():
"""
- Test Class for list_load_balancer_listeners
+ Test Class for get_vpn_gateway_connection
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_load_balancer_listeners_all_params(self):
+ def test_get_vpn_gateway_connection_all_params(self):
"""
- list_load_balancer_listeners()
+ get_vpn_gateway_connection()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners')
- mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString')
+ mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -25186,11 +23338,13 @@ def test_list_load_balancer_listeners_all_params(self):
status=200)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_gateway_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_load_balancer_listeners(
- load_balancer_id,
+ response = _service.get_vpn_gateway_connection(
+ vpn_gateway_id,
+ id,
headers={}
)
@@ -25198,23 +23352,23 @@ def test_list_load_balancer_listeners_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_load_balancer_listeners_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_listeners_all_params.
+ def test_get_vpn_gateway_connection_all_params_with_retries(self):
+ # Enable retries and run test_get_vpn_gateway_connection_all_params.
_service.enable_retries()
- self.test_list_load_balancer_listeners_all_params()
+ self.test_get_vpn_gateway_connection_all_params()
- # Disable retries and run test_list_load_balancer_listeners_all_params.
+ # Disable retries and run test_get_vpn_gateway_connection_all_params.
_service.disable_retries()
- self.test_list_load_balancer_listeners_all_params()
+ self.test_get_vpn_gateway_connection_all_params()
@responses.activate
- def test_list_load_balancer_listeners_value_error(self):
+ def test_get_vpn_gateway_connection_value_error(self):
"""
- test_list_load_balancer_listeners_value_error()
+ test_get_vpn_gateway_connection_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners')
- mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString')
+ mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -25222,836 +23376,606 @@ def test_list_load_balancer_listeners_value_error(self):
status=200)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_gateway_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
+ "vpn_gateway_id": vpn_gateway_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_load_balancer_listeners(**req_copy)
+ _service.get_vpn_gateway_connection(**req_copy)
- def test_list_load_balancer_listeners_value_error_with_retries(self):
- # Enable retries and run test_list_load_balancer_listeners_value_error.
+ def test_get_vpn_gateway_connection_value_error_with_retries(self):
+ # Enable retries and run test_get_vpn_gateway_connection_value_error.
_service.enable_retries()
- self.test_list_load_balancer_listeners_value_error()
+ self.test_get_vpn_gateway_connection_value_error()
- # Disable retries and run test_list_load_balancer_listeners_value_error.
+ # Disable retries and run test_get_vpn_gateway_connection_value_error.
_service.disable_retries()
- self.test_list_load_balancer_listeners_value_error()
+ self.test_get_vpn_gateway_connection_value_error()
-class TestCreateLoadBalancerListener():
+class TestUpdateVpnGatewayConnection():
"""
- Test Class for create_load_balancer_listener
+ Test Class for update_vpn_gateway_connection
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_load_balancer_listener_all_params(self):
+ def test_update_vpn_gateway_connection_all_params(self):
"""
- create_load_balancer_listener()
+ update_vpn_gateway_connection()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
- responses.add(responses.POST,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString')
+ mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
-
- # Construct a dict representation of a LoadBalancerPoolIdentityById model
- load_balancer_pool_identity_model = {}
- load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerIdentityById model
- load_balancer_listener_identity_model = {}
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ status=200)
- # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model
- load_balancer_listener_https_redirect_prototype_model = {}
- load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get'
+ # Construct a dict representation of a VPNGatewayConnectionDPDPatch model
+ vpn_gateway_connection_dpd_patch_model = {}
+ vpn_gateway_connection_dpd_patch_model['action'] = 'restart'
+ vpn_gateway_connection_dpd_patch_model['interval'] = 30
+ vpn_gateway_connection_dpd_patch_model['timeout'] = 120
- # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
- load_balancer_listener_policy_rule_prototype_model = {}
- load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
- load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
- load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
+ # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model
+ vpn_gateway_connection_ike_policy_patch_model = {}
+ vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
- load_balancer_listener_policy_target_prototype_model = {}
- load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model
+ vpn_gateway_connection_i_psec_policy_patch_model = {}
+ vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model
- load_balancer_listener_policy_prototype_model = {}
- load_balancer_listener_policy_prototype_model['action'] = 'forward'
- load_balancer_listener_policy_prototype_model['name'] = 'my-policy'
- load_balancer_listener_policy_prototype_model['priority'] = 5
- load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model]
- load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model
+ # Construct a dict representation of a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch model
+ vpn_gateway_connection_patch_model = {}
+ vpn_gateway_connection_patch_model['admin_state_up'] = True
+ vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model
+ vpn_gateway_connection_patch_model['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model
+ vpn_gateway_connection_patch_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model
+ vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_patch_model['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_patch_model['routing_protocol'] = 'none'
# Set up parameter values
- load_balancer_id = 'testString'
- protocol = 'http'
- accept_proxy_protocol = True
- certificate_instance = certificate_instance_identity_model
- connection_limit = 2000
- default_pool = load_balancer_pool_identity_model
- https_redirect = load_balancer_listener_https_redirect_prototype_model
- policies = [load_balancer_listener_policy_prototype_model]
- port = 443
- port_max = 499
- port_min = 443
+ vpn_gateway_id = 'testString'
+ id = 'testString'
+ vpn_gateway_connection_patch = vpn_gateway_connection_patch_model
# Invoke method
- response = _service.create_load_balancer_listener(
- load_balancer_id,
- protocol,
- accept_proxy_protocol=accept_proxy_protocol,
- certificate_instance=certificate_instance,
- connection_limit=connection_limit,
- default_pool=default_pool,
- https_redirect=https_redirect,
- policies=policies,
- port=port,
- port_max=port_max,
- port_min=port_min,
+ response = _service.update_vpn_gateway_connection(
+ vpn_gateway_id,
+ id,
+ vpn_gateway_connection_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
+ assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['protocol'] == 'http'
- assert req_body['accept_proxy_protocol'] == True
- assert req_body['certificate_instance'] == certificate_instance_identity_model
- assert req_body['connection_limit'] == 2000
- assert req_body['default_pool'] == load_balancer_pool_identity_model
- assert req_body['https_redirect'] == load_balancer_listener_https_redirect_prototype_model
- assert req_body['policies'] == [load_balancer_listener_policy_prototype_model]
- assert req_body['port'] == 443
- assert req_body['port_max'] == 499
- assert req_body['port_min'] == 443
+ assert req_body == vpn_gateway_connection_patch
- def test_create_load_balancer_listener_all_params_with_retries(self):
- # Enable retries and run test_create_load_balancer_listener_all_params.
+ def test_update_vpn_gateway_connection_all_params_with_retries(self):
+ # Enable retries and run test_update_vpn_gateway_connection_all_params.
_service.enable_retries()
- self.test_create_load_balancer_listener_all_params()
+ self.test_update_vpn_gateway_connection_all_params()
- # Disable retries and run test_create_load_balancer_listener_all_params.
+ # Disable retries and run test_update_vpn_gateway_connection_all_params.
_service.disable_retries()
- self.test_create_load_balancer_listener_all_params()
+ self.test_update_vpn_gateway_connection_all_params()
@responses.activate
- def test_create_load_balancer_listener_value_error(self):
+ def test_update_vpn_gateway_connection_value_error(self):
"""
- test_create_load_balancer_listener_value_error()
+ test_update_vpn_gateway_connection_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
- responses.add(responses.POST,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString')
+ mock_response = '{"admin_state_up": true, "authentication_mode": "psk", "created_at": "2019-01-01T12:00:00.000Z", "dead_peer_detection": {"action": "restart", "interval": 30, "timeout": 120}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b", "id": "a10a5771-dc23-442c-8460-c3601d8542f7", "ike_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ike-policy", "resource_type": "ike_policy"}, "ipsec_policy": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b", "id": "ddf51bec-3424-11e8-b467-0ed5f89f718b", "name": "my-ipsec-policy", "resource_type": "ipsec_policy"}, "mode": "route", "name": "my-vpn-connection", "peer_address": "169.21.50.5", "psk": "lkj14b1oi0alcniejkso", "resource_type": "vpn_gateway_connection", "status": "down", "routing_protocol": "none", "tunnels": [{"public_ip": {"address": "192.168.3.4"}, "status": "down"}]}'
+ responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
-
- # Construct a dict representation of a LoadBalancerPoolIdentityById model
- load_balancer_pool_identity_model = {}
- load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerIdentityById model
- load_balancer_listener_identity_model = {}
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ status=200)
- # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model
- load_balancer_listener_https_redirect_prototype_model = {}
- load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get'
+ # Construct a dict representation of a VPNGatewayConnectionDPDPatch model
+ vpn_gateway_connection_dpd_patch_model = {}
+ vpn_gateway_connection_dpd_patch_model['action'] = 'restart'
+ vpn_gateway_connection_dpd_patch_model['interval'] = 30
+ vpn_gateway_connection_dpd_patch_model['timeout'] = 120
- # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
- load_balancer_listener_policy_rule_prototype_model = {}
- load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
- load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
- load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
+ # Construct a dict representation of a VPNGatewayConnectionIKEPolicyPatchIKEPolicyIdentityById model
+ vpn_gateway_connection_ike_policy_patch_model = {}
+ vpn_gateway_connection_ike_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
- load_balancer_listener_policy_target_prototype_model = {}
- load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a dict representation of a VPNGatewayConnectionIPsecPolicyPatchIPsecPolicyIdentityById model
+ vpn_gateway_connection_i_psec_policy_patch_model = {}
+ vpn_gateway_connection_i_psec_policy_patch_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model
- load_balancer_listener_policy_prototype_model = {}
- load_balancer_listener_policy_prototype_model['action'] = 'forward'
- load_balancer_listener_policy_prototype_model['name'] = 'my-policy'
- load_balancer_listener_policy_prototype_model['priority'] = 5
- load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model]
- load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model
+ # Construct a dict representation of a VPNGatewayConnectionPatchVPNGatewayConnectionStaticRouteModePatch model
+ vpn_gateway_connection_patch_model = {}
+ vpn_gateway_connection_patch_model['admin_state_up'] = True
+ vpn_gateway_connection_patch_model['dead_peer_detection'] = vpn_gateway_connection_dpd_patch_model
+ vpn_gateway_connection_patch_model['ike_policy'] = vpn_gateway_connection_ike_policy_patch_model
+ vpn_gateway_connection_patch_model['ipsec_policy'] = vpn_gateway_connection_i_psec_policy_patch_model
+ vpn_gateway_connection_patch_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_patch_model['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_patch_model['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_patch_model['routing_protocol'] = 'none'
# Set up parameter values
- load_balancer_id = 'testString'
- protocol = 'http'
- accept_proxy_protocol = True
- certificate_instance = certificate_instance_identity_model
- connection_limit = 2000
- default_pool = load_balancer_pool_identity_model
- https_redirect = load_balancer_listener_https_redirect_prototype_model
- policies = [load_balancer_listener_policy_prototype_model]
- port = 443
- port_max = 499
- port_min = 443
+ vpn_gateway_id = 'testString'
+ id = 'testString'
+ vpn_gateway_connection_patch = vpn_gateway_connection_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "protocol": protocol,
+ "vpn_gateway_id": vpn_gateway_id,
+ "id": id,
+ "vpn_gateway_connection_patch": vpn_gateway_connection_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_load_balancer_listener(**req_copy)
+ _service.update_vpn_gateway_connection(**req_copy)
- def test_create_load_balancer_listener_value_error_with_retries(self):
- # Enable retries and run test_create_load_balancer_listener_value_error.
+ def test_update_vpn_gateway_connection_value_error_with_retries(self):
+ # Enable retries and run test_update_vpn_gateway_connection_value_error.
_service.enable_retries()
- self.test_create_load_balancer_listener_value_error()
+ self.test_update_vpn_gateway_connection_value_error()
- # Disable retries and run test_create_load_balancer_listener_value_error.
+ # Disable retries and run test_update_vpn_gateway_connection_value_error.
_service.disable_retries()
- self.test_create_load_balancer_listener_value_error()
+ self.test_update_vpn_gateway_connection_value_error()
-class TestDeleteLoadBalancerListener():
+class TestListVpnGatewayConnectionLocalCidrs():
"""
- Test Class for delete_load_balancer_listener
+ Test Class for list_vpn_gateway_connection_local_cidrs
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_load_balancer_listener_all_params(self):
+ def test_list_vpn_gateway_connection_local_cidrs_all_params(self):
"""
- delete_load_balancer_listener()
+ list_vpn_gateway_connection_local_cidrs()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs')
+ mock_response = '{"local_cidrs": ["192.168.1.0/24"]}'
+ responses.add(responses.GET,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_load_balancer_listener(
- load_balancer_id,
+ response = _service.list_vpn_gateway_connection_local_cidrs(
+ vpn_gateway_id,
id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
- def test_delete_load_balancer_listener_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_listener_all_params.
+ def test_list_vpn_gateway_connection_local_cidrs_all_params_with_retries(self):
+ # Enable retries and run test_list_vpn_gateway_connection_local_cidrs_all_params.
_service.enable_retries()
- self.test_delete_load_balancer_listener_all_params()
+ self.test_list_vpn_gateway_connection_local_cidrs_all_params()
- # Disable retries and run test_delete_load_balancer_listener_all_params.
+ # Disable retries and run test_list_vpn_gateway_connection_local_cidrs_all_params.
_service.disable_retries()
- self.test_delete_load_balancer_listener_all_params()
+ self.test_list_vpn_gateway_connection_local_cidrs_all_params()
@responses.activate
- def test_delete_load_balancer_listener_value_error(self):
+ def test_list_vpn_gateway_connection_local_cidrs_value_error(self):
"""
- test_delete_load_balancer_listener_value_error()
+ test_list_vpn_gateway_connection_local_cidrs_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs')
+ mock_response = '{"local_cidrs": ["192.168.1.0/24"]}'
+ responses.add(responses.GET,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
+ "vpn_gateway_id": vpn_gateway_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_load_balancer_listener(**req_copy)
+ _service.list_vpn_gateway_connection_local_cidrs(**req_copy)
- def test_delete_load_balancer_listener_value_error_with_retries(self):
- # Enable retries and run test_delete_load_balancer_listener_value_error.
+ def test_list_vpn_gateway_connection_local_cidrs_value_error_with_retries(self):
+ # Enable retries and run test_list_vpn_gateway_connection_local_cidrs_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_listener_value_error()
+ self.test_list_vpn_gateway_connection_local_cidrs_value_error()
- # Disable retries and run test_delete_load_balancer_listener_value_error.
+ # Disable retries and run test_list_vpn_gateway_connection_local_cidrs_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_listener_value_error()
+ self.test_list_vpn_gateway_connection_local_cidrs_value_error()
-class TestGetLoadBalancerListener():
+class TestRemoveVpnGatewayConnectionLocalCidr():
"""
- Test Class for get_load_balancer_listener
+ Test Class for remove_vpn_gateway_connection_local_cidr
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_load_balancer_listener_all_params(self):
+ def test_remove_vpn_gateway_connection_local_cidr_all_params(self):
"""
- get_load_balancer_listener()
+ remove_vpn_gateway_connection_local_cidr()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.get_load_balancer_listener(
- load_balancer_id,
+ response = _service.remove_vpn_gateway_connection_local_cidr(
+ vpn_gateway_id,
id,
+ cidr_prefix,
+ prefix_length,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_get_load_balancer_listener_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_listener_all_params.
+ def test_remove_vpn_gateway_connection_local_cidr_all_params_with_retries(self):
+ # Enable retries and run test_remove_vpn_gateway_connection_local_cidr_all_params.
_service.enable_retries()
- self.test_get_load_balancer_listener_all_params()
+ self.test_remove_vpn_gateway_connection_local_cidr_all_params()
- # Disable retries and run test_get_load_balancer_listener_all_params.
+ # Disable retries and run test_remove_vpn_gateway_connection_local_cidr_all_params.
_service.disable_retries()
- self.test_get_load_balancer_listener_all_params()
+ self.test_remove_vpn_gateway_connection_local_cidr_all_params()
@responses.activate
- def test_get_load_balancer_listener_value_error(self):
+ def test_remove_vpn_gateway_connection_local_cidr_value_error(self):
"""
- test_get_load_balancer_listener_value_error()
+ test_remove_vpn_gateway_connection_local_cidr_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
+ "vpn_gateway_id": vpn_gateway_id,
"id": id,
+ "cidr_prefix": cidr_prefix,
+ "prefix_length": prefix_length,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_load_balancer_listener(**req_copy)
+ _service.remove_vpn_gateway_connection_local_cidr(**req_copy)
- def test_get_load_balancer_listener_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_listener_value_error.
+ def test_remove_vpn_gateway_connection_local_cidr_value_error_with_retries(self):
+ # Enable retries and run test_remove_vpn_gateway_connection_local_cidr_value_error.
_service.enable_retries()
- self.test_get_load_balancer_listener_value_error()
+ self.test_remove_vpn_gateway_connection_local_cidr_value_error()
- # Disable retries and run test_get_load_balancer_listener_value_error.
+ # Disable retries and run test_remove_vpn_gateway_connection_local_cidr_value_error.
_service.disable_retries()
- self.test_get_load_balancer_listener_value_error()
+ self.test_remove_vpn_gateway_connection_local_cidr_value_error()
-class TestUpdateLoadBalancerListener():
+class TestCheckVpnGatewayConnectionLocalCidr():
"""
- Test Class for update_load_balancer_listener
+ Test Class for check_vpn_gateway_connection_local_cidr
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_load_balancer_listener_all_params(self):
+ def test_check_vpn_gateway_connection_local_cidr_all_params(self):
"""
- update_load_balancer_listener()
+ check_vpn_gateway_connection_local_cidr()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ responses.add(responses.GET,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
-
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
-
- # Construct a dict representation of a LoadBalancerPoolIdentityById model
- load_balancer_pool_identity_model = {}
- load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerIdentityById model
- load_balancer_listener_identity_model = {}
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model
- load_balancer_listener_https_redirect_patch_model = {}
- load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get'
-
- # Construct a dict representation of a LoadBalancerListenerPatch model
- load_balancer_listener_patch_model = {}
- load_balancer_listener_patch_model['accept_proxy_protocol'] = True
- load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model
- load_balancer_listener_patch_model['connection_limit'] = 2000
- load_balancer_listener_patch_model['default_pool'] = load_balancer_pool_identity_model
- load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model
- load_balancer_listener_patch_model['port'] = 443
- load_balancer_listener_patch_model['port_max'] = 499
- load_balancer_listener_patch_model['port_min'] = 443
- load_balancer_listener_patch_model['protocol'] = 'http'
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
- load_balancer_listener_patch = load_balancer_listener_patch_model
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.update_load_balancer_listener(
- load_balancer_id,
+ response = _service.check_vpn_gateway_connection_local_cidr(
+ vpn_gateway_id,
id,
- load_balancer_listener_patch,
+ cidr_prefix,
+ prefix_length,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == load_balancer_listener_patch
+ assert response.status_code == 204
- def test_update_load_balancer_listener_all_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_listener_all_params.
+ def test_check_vpn_gateway_connection_local_cidr_all_params_with_retries(self):
+ # Enable retries and run test_check_vpn_gateway_connection_local_cidr_all_params.
_service.enable_retries()
- self.test_update_load_balancer_listener_all_params()
+ self.test_check_vpn_gateway_connection_local_cidr_all_params()
- # Disable retries and run test_update_load_balancer_listener_all_params.
+ # Disable retries and run test_check_vpn_gateway_connection_local_cidr_all_params.
_service.disable_retries()
- self.test_update_load_balancer_listener_all_params()
+ self.test_check_vpn_gateway_connection_local_cidr_all_params()
@responses.activate
- def test_update_load_balancer_listener_value_error(self):
+ def test_check_vpn_gateway_connection_local_cidr_value_error(self):
"""
- test_update_load_balancer_listener_value_error()
+ test_check_vpn_gateway_connection_local_cidr_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString')
- mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ responses.add(responses.GET,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
-
- # Construct a dict representation of a CertificateInstanceIdentityByCRN model
- certificate_instance_identity_model = {}
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
-
- # Construct a dict representation of a LoadBalancerPoolIdentityById model
- load_balancer_pool_identity_model = {}
- load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerIdentityById model
- load_balancer_listener_identity_model = {}
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model
- load_balancer_listener_https_redirect_patch_model = {}
- load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get'
-
- # Construct a dict representation of a LoadBalancerListenerPatch model
- load_balancer_listener_patch_model = {}
- load_balancer_listener_patch_model['accept_proxy_protocol'] = True
- load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model
- load_balancer_listener_patch_model['connection_limit'] = 2000
- load_balancer_listener_patch_model['default_pool'] = load_balancer_pool_identity_model
- load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model
- load_balancer_listener_patch_model['port'] = 443
- load_balancer_listener_patch_model['port_max'] = 499
- load_balancer_listener_patch_model['port_min'] = 443
- load_balancer_listener_patch_model['protocol'] = 'http'
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
- load_balancer_listener_patch = load_balancer_listener_patch_model
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
+ "vpn_gateway_id": vpn_gateway_id,
"id": id,
- "load_balancer_listener_patch": load_balancer_listener_patch,
+ "cidr_prefix": cidr_prefix,
+ "prefix_length": prefix_length,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_load_balancer_listener(**req_copy)
+ _service.check_vpn_gateway_connection_local_cidr(**req_copy)
- def test_update_load_balancer_listener_value_error_with_retries(self):
- # Enable retries and run test_update_load_balancer_listener_value_error.
+ def test_check_vpn_gateway_connection_local_cidr_value_error_with_retries(self):
+ # Enable retries and run test_check_vpn_gateway_connection_local_cidr_value_error.
_service.enable_retries()
- self.test_update_load_balancer_listener_value_error()
+ self.test_check_vpn_gateway_connection_local_cidr_value_error()
- # Disable retries and run test_update_load_balancer_listener_value_error.
+ # Disable retries and run test_check_vpn_gateway_connection_local_cidr_value_error.
_service.disable_retries()
- self.test_update_load_balancer_listener_value_error()
+ self.test_check_vpn_gateway_connection_local_cidr_value_error()
-class TestListLoadBalancerListenerPolicies():
+class TestAddVpnGatewayConnectionLocalCidr():
"""
- Test Class for list_load_balancer_listener_policies
+ Test Class for add_vpn_gateway_connection_local_cidr
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_load_balancer_listener_policies_all_params(self):
+ def test_add_vpn_gateway_connection_local_cidr_all_params(self):
"""
- list_load_balancer_listener_policies()
+ add_vpn_gateway_connection_local_cidr()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies')
- mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ responses.add(responses.PUT,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
+ vpn_gateway_id = 'testString'
+ id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.list_load_balancer_listener_policies(
- load_balancer_id,
- listener_id,
+ response = _service.add_vpn_gateway_connection_local_cidr(
+ vpn_gateway_id,
+ id,
+ cidr_prefix,
+ prefix_length,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_list_load_balancer_listener_policies_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_listener_policies_all_params.
+ def test_add_vpn_gateway_connection_local_cidr_all_params_with_retries(self):
+ # Enable retries and run test_add_vpn_gateway_connection_local_cidr_all_params.
_service.enable_retries()
- self.test_list_load_balancer_listener_policies_all_params()
+ self.test_add_vpn_gateway_connection_local_cidr_all_params()
- # Disable retries and run test_list_load_balancer_listener_policies_all_params.
+ # Disable retries and run test_add_vpn_gateway_connection_local_cidr_all_params.
_service.disable_retries()
- self.test_list_load_balancer_listener_policies_all_params()
+ self.test_add_vpn_gateway_connection_local_cidr_all_params()
@responses.activate
- def test_list_load_balancer_listener_policies_value_error(self):
+ def test_add_vpn_gateway_connection_local_cidr_value_error(self):
"""
- test_list_load_balancer_listener_policies_value_error()
+ test_add_vpn_gateway_connection_local_cidr_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies')
- mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}'
- responses.add(responses.GET,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/local_cidrs/testString/testString')
+ responses.add(responses.PUT,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
+ vpn_gateway_id = 'testString'
+ id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
+ "vpn_gateway_id": vpn_gateway_id,
+ "id": id,
+ "cidr_prefix": cidr_prefix,
+ "prefix_length": prefix_length,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_load_balancer_listener_policies(**req_copy)
+ _service.add_vpn_gateway_connection_local_cidr(**req_copy)
- def test_list_load_balancer_listener_policies_value_error_with_retries(self):
- # Enable retries and run test_list_load_balancer_listener_policies_value_error.
+ def test_add_vpn_gateway_connection_local_cidr_value_error_with_retries(self):
+ # Enable retries and run test_add_vpn_gateway_connection_local_cidr_value_error.
_service.enable_retries()
- self.test_list_load_balancer_listener_policies_value_error()
+ self.test_add_vpn_gateway_connection_local_cidr_value_error()
- # Disable retries and run test_list_load_balancer_listener_policies_value_error.
+ # Disable retries and run test_add_vpn_gateway_connection_local_cidr_value_error.
_service.disable_retries()
- self.test_list_load_balancer_listener_policies_value_error()
+ self.test_add_vpn_gateway_connection_local_cidr_value_error()
-class TestCreateLoadBalancerListenerPolicy():
+class TestListVpnGatewayConnectionPeerCidrs():
"""
- Test Class for create_load_balancer_listener_policy
+ Test Class for list_vpn_gateway_connection_peer_cidrs
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_load_balancer_listener_policy_all_params(self):
+ def test_list_vpn_gateway_connection_peer_cidrs_all_params(self):
"""
- create_load_balancer_listener_policy()
+ list_vpn_gateway_connection_peer_cidrs()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies')
- mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
- responses.add(responses.POST,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs')
+ mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
- load_balancer_listener_policy_rule_prototype_model = {}
- load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
- load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
- load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
-
- # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
- load_balancer_listener_policy_target_prototype_model = {}
- load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ status=200)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- action = 'forward'
- priority = 5
- name = 'my-policy'
- rules = [load_balancer_listener_policy_rule_prototype_model]
- target = load_balancer_listener_policy_target_prototype_model
+ vpn_gateway_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.create_load_balancer_listener_policy(
- load_balancer_id,
- listener_id,
- action,
- priority,
- name=name,
- rules=rules,
- target=target,
+ response = _service.list_vpn_gateway_connection_peer_cidrs(
+ vpn_gateway_id,
+ id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['action'] == 'forward'
- assert req_body['priority'] == 5
- assert req_body['name'] == 'my-policy'
- assert req_body['rules'] == [load_balancer_listener_policy_rule_prototype_model]
- assert req_body['target'] == load_balancer_listener_policy_target_prototype_model
+ assert response.status_code == 200
- def test_create_load_balancer_listener_policy_all_params_with_retries(self):
- # Enable retries and run test_create_load_balancer_listener_policy_all_params.
+ def test_list_vpn_gateway_connection_peer_cidrs_all_params_with_retries(self):
+ # Enable retries and run test_list_vpn_gateway_connection_peer_cidrs_all_params.
_service.enable_retries()
- self.test_create_load_balancer_listener_policy_all_params()
+ self.test_list_vpn_gateway_connection_peer_cidrs_all_params()
- # Disable retries and run test_create_load_balancer_listener_policy_all_params.
+ # Disable retries and run test_list_vpn_gateway_connection_peer_cidrs_all_params.
_service.disable_retries()
- self.test_create_load_balancer_listener_policy_all_params()
+ self.test_list_vpn_gateway_connection_peer_cidrs_all_params()
@responses.activate
- def test_create_load_balancer_listener_policy_value_error(self):
+ def test_list_vpn_gateway_connection_peer_cidrs_value_error(self):
"""
- test_create_load_balancer_listener_policy_value_error()
+ test_list_vpn_gateway_connection_peer_cidrs_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies')
- mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
- responses.add(responses.POST,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs')
+ mock_response = '{"peer_cidrs": ["10.45.1.0/24"]}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
- load_balancer_listener_policy_rule_prototype_model = {}
- load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
- load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
- load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
-
- # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
- load_balancer_listener_policy_target_prototype_model = {}
- load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ status=200)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- action = 'forward'
- priority = 5
- name = 'my-policy'
- rules = [load_balancer_listener_policy_rule_prototype_model]
- target = load_balancer_listener_policy_target_prototype_model
+ vpn_gateway_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
- "action": action,
- "priority": priority,
+ "vpn_gateway_id": vpn_gateway_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_load_balancer_listener_policy(**req_copy)
+ _service.list_vpn_gateway_connection_peer_cidrs(**req_copy)
- def test_create_load_balancer_listener_policy_value_error_with_retries(self):
- # Enable retries and run test_create_load_balancer_listener_policy_value_error.
+ def test_list_vpn_gateway_connection_peer_cidrs_value_error_with_retries(self):
+ # Enable retries and run test_list_vpn_gateway_connection_peer_cidrs_value_error.
_service.enable_retries()
- self.test_create_load_balancer_listener_policy_value_error()
+ self.test_list_vpn_gateway_connection_peer_cidrs_value_error()
- # Disable retries and run test_create_load_balancer_listener_policy_value_error.
+ # Disable retries and run test_list_vpn_gateway_connection_peer_cidrs_value_error.
_service.disable_retries()
- self.test_create_load_balancer_listener_policy_value_error()
+ self.test_list_vpn_gateway_connection_peer_cidrs_value_error()
-class TestDeleteLoadBalancerListenerPolicy():
+class TestRemoveVpnGatewayConnectionPeerCidr():
"""
- Test Class for delete_load_balancer_listener_policy
+ Test Class for remove_vpn_gateway_connection_peer_cidr
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_load_balancer_listener_policy_all_params(self):
+ def test_remove_vpn_gateway_connection_peer_cidr_all_params(self):
"""
- delete_load_balancer_listener_policy()
+ remove_vpn_gateway_connection_peer_cidr()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString')
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.delete_load_balancer_listener_policy(
- load_balancer_id,
- listener_id,
+ response = _service.remove_vpn_gateway_connection_peer_cidr(
+ vpn_gateway_id,
id,
+ cidr_prefix,
+ prefix_length,
headers={}
)
@@ -26059,295 +23983,287 @@ def test_delete_load_balancer_listener_policy_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_load_balancer_listener_policy_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_listener_policy_all_params.
+ def test_remove_vpn_gateway_connection_peer_cidr_all_params_with_retries(self):
+ # Enable retries and run test_remove_vpn_gateway_connection_peer_cidr_all_params.
_service.enable_retries()
- self.test_delete_load_balancer_listener_policy_all_params()
+ self.test_remove_vpn_gateway_connection_peer_cidr_all_params()
- # Disable retries and run test_delete_load_balancer_listener_policy_all_params.
+ # Disable retries and run test_remove_vpn_gateway_connection_peer_cidr_all_params.
_service.disable_retries()
- self.test_delete_load_balancer_listener_policy_all_params()
+ self.test_remove_vpn_gateway_connection_peer_cidr_all_params()
@responses.activate
- def test_delete_load_balancer_listener_policy_value_error(self):
+ def test_remove_vpn_gateway_connection_peer_cidr_value_error(self):
"""
- test_delete_load_balancer_listener_policy_value_error()
+ test_remove_vpn_gateway_connection_peer_cidr_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString')
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
+ "vpn_gateway_id": vpn_gateway_id,
"id": id,
+ "cidr_prefix": cidr_prefix,
+ "prefix_length": prefix_length,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_load_balancer_listener_policy(**req_copy)
+ _service.remove_vpn_gateway_connection_peer_cidr(**req_copy)
- def test_delete_load_balancer_listener_policy_value_error_with_retries(self):
- # Enable retries and run test_delete_load_balancer_listener_policy_value_error.
+ def test_remove_vpn_gateway_connection_peer_cidr_value_error_with_retries(self):
+ # Enable retries and run test_remove_vpn_gateway_connection_peer_cidr_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_listener_policy_value_error()
+ self.test_remove_vpn_gateway_connection_peer_cidr_value_error()
- # Disable retries and run test_delete_load_balancer_listener_policy_value_error.
+ # Disable retries and run test_remove_vpn_gateway_connection_peer_cidr_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_listener_policy_value_error()
+ self.test_remove_vpn_gateway_connection_peer_cidr_value_error()
-class TestGetLoadBalancerListenerPolicy():
+class TestCheckVpnGatewayConnectionPeerCidr():
"""
- Test Class for get_load_balancer_listener_policy
+ Test Class for check_vpn_gateway_connection_peer_cidr
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_load_balancer_listener_policy_all_params(self):
+ def test_check_vpn_gateway_connection_peer_cidr_all_params(self):
"""
- get_load_balancer_listener_policy()
+ check_vpn_gateway_connection_peer_cidr()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString')
- mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
responses.add(responses.GET,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.get_load_balancer_listener_policy(
- load_balancer_id,
- listener_id,
+ response = _service.check_vpn_gateway_connection_peer_cidr(
+ vpn_gateway_id,
id,
+ cidr_prefix,
+ prefix_length,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
+ assert response.status_code == 204
- def test_get_load_balancer_listener_policy_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_listener_policy_all_params.
+ def test_check_vpn_gateway_connection_peer_cidr_all_params_with_retries(self):
+ # Enable retries and run test_check_vpn_gateway_connection_peer_cidr_all_params.
_service.enable_retries()
- self.test_get_load_balancer_listener_policy_all_params()
+ self.test_check_vpn_gateway_connection_peer_cidr_all_params()
- # Disable retries and run test_get_load_balancer_listener_policy_all_params.
+ # Disable retries and run test_check_vpn_gateway_connection_peer_cidr_all_params.
_service.disable_retries()
- self.test_get_load_balancer_listener_policy_all_params()
+ self.test_check_vpn_gateway_connection_peer_cidr_all_params()
@responses.activate
- def test_get_load_balancer_listener_policy_value_error(self):
+ def test_check_vpn_gateway_connection_peer_cidr_value_error(self):
"""
- test_get_load_balancer_listener_policy_value_error()
+ test_check_vpn_gateway_connection_peer_cidr_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString')
- mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
responses.add(responses.GET,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
+ "vpn_gateway_id": vpn_gateway_id,
"id": id,
+ "cidr_prefix": cidr_prefix,
+ "prefix_length": prefix_length,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_load_balancer_listener_policy(**req_copy)
+ _service.check_vpn_gateway_connection_peer_cidr(**req_copy)
- def test_get_load_balancer_listener_policy_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_listener_policy_value_error.
+ def test_check_vpn_gateway_connection_peer_cidr_value_error_with_retries(self):
+ # Enable retries and run test_check_vpn_gateway_connection_peer_cidr_value_error.
_service.enable_retries()
- self.test_get_load_balancer_listener_policy_value_error()
+ self.test_check_vpn_gateway_connection_peer_cidr_value_error()
- # Disable retries and run test_get_load_balancer_listener_policy_value_error.
+ # Disable retries and run test_check_vpn_gateway_connection_peer_cidr_value_error.
_service.disable_retries()
- self.test_get_load_balancer_listener_policy_value_error()
+ self.test_check_vpn_gateway_connection_peer_cidr_value_error()
-class TestUpdateLoadBalancerListenerPolicy():
+class TestAddVpnGatewayConnectionPeerCidr():
"""
- Test Class for update_load_balancer_listener_policy
+ Test Class for add_vpn_gateway_connection_peer_cidr
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_load_balancer_listener_policy_all_params(self):
+ def test_add_vpn_gateway_connection_peer_cidr_all_params(self):
"""
- update_load_balancer_listener_policy()
+ add_vpn_gateway_connection_peer_cidr()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString')
- mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ responses.add(responses.PUT,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
-
- # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
- load_balancer_listener_policy_target_patch_model = {}
- load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerPolicyPatch model
- load_balancer_listener_policy_patch_model = {}
- load_balancer_listener_policy_patch_model['name'] = 'my-policy'
- load_balancer_listener_policy_patch_model['priority'] = 5
- load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
- load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Invoke method
- response = _service.update_load_balancer_listener_policy(
- load_balancer_id,
- listener_id,
+ response = _service.add_vpn_gateway_connection_peer_cidr(
+ vpn_gateway_id,
id,
- load_balancer_listener_policy_patch,
+ cidr_prefix,
+ prefix_length,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == load_balancer_listener_policy_patch
+ assert response.status_code == 204
- def test_update_load_balancer_listener_policy_all_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_listener_policy_all_params.
+ def test_add_vpn_gateway_connection_peer_cidr_all_params_with_retries(self):
+ # Enable retries and run test_add_vpn_gateway_connection_peer_cidr_all_params.
_service.enable_retries()
- self.test_update_load_balancer_listener_policy_all_params()
+ self.test_add_vpn_gateway_connection_peer_cidr_all_params()
- # Disable retries and run test_update_load_balancer_listener_policy_all_params.
+ # Disable retries and run test_add_vpn_gateway_connection_peer_cidr_all_params.
_service.disable_retries()
- self.test_update_load_balancer_listener_policy_all_params()
+ self.test_add_vpn_gateway_connection_peer_cidr_all_params()
@responses.activate
- def test_update_load_balancer_listener_policy_value_error(self):
+ def test_add_vpn_gateway_connection_peer_cidr_value_error(self):
"""
- test_update_load_balancer_listener_policy_value_error()
+ test_add_vpn_gateway_connection_peer_cidr_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString')
- mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/vpn_gateways/testString/connections/testString/peer_cidrs/testString/testString')
+ responses.add(responses.PUT,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
-
- # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
- load_balancer_listener_policy_target_patch_model = {}
- load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a dict representation of a LoadBalancerListenerPolicyPatch model
- load_balancer_listener_policy_patch_model = {}
- load_balancer_listener_policy_patch_model['name'] = 'my-policy'
- load_balancer_listener_policy_patch_model['priority'] = 5
- load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model
+ status=204)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
+ vpn_gateway_id = 'testString'
id = 'testString'
- load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model
+ cidr_prefix = 'testString'
+ prefix_length = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
+ "vpn_gateway_id": vpn_gateway_id,
"id": id,
- "load_balancer_listener_policy_patch": load_balancer_listener_policy_patch,
+ "cidr_prefix": cidr_prefix,
+ "prefix_length": prefix_length,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_load_balancer_listener_policy(**req_copy)
+ _service.add_vpn_gateway_connection_peer_cidr(**req_copy)
- def test_update_load_balancer_listener_policy_value_error_with_retries(self):
- # Enable retries and run test_update_load_balancer_listener_policy_value_error.
+ def test_add_vpn_gateway_connection_peer_cidr_value_error_with_retries(self):
+ # Enable retries and run test_add_vpn_gateway_connection_peer_cidr_value_error.
_service.enable_retries()
- self.test_update_load_balancer_listener_policy_value_error()
+ self.test_add_vpn_gateway_connection_peer_cidr_value_error()
- # Disable retries and run test_update_load_balancer_listener_policy_value_error.
+ # Disable retries and run test_add_vpn_gateway_connection_peer_cidr_value_error.
_service.disable_retries()
- self.test_update_load_balancer_listener_policy_value_error()
+ self.test_add_vpn_gateway_connection_peer_cidr_value_error()
-class TestListLoadBalancerListenerPolicyRules():
+# endregion
+##############################################################################
+# End of Service: VPNGateways
+##############################################################################
+
+##############################################################################
+# Start of Service: LoadBalancers
+##############################################################################
+# region
+
+class TestNewInstance():
"""
- Test Class for list_load_balancer_listener_policy_rules
+ Test Class for new_instance
"""
- def preprocess_url(self, request_url: str):
+ 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):
"""
- Preprocess the request URL to ensure the mock response will be found.
+ new_instance_without_required_params()
"""
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ 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 TestListLoadBalancerProfiles():
+ """
+ Test Class for list_load_balancer_profiles
+ """
@responses.activate
- def test_list_load_balancer_listener_policy_rules_all_params(self):
+ def test_list_load_balancer_profiles_all_params(self):
"""
- list_load_balancer_listener_policy_rules()
+ list_load_balancer_profiles()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules')
- mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}]}'
+ url = preprocess_url('/load_balancer/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -26355,306 +24271,187 @@ def test_list_load_balancer_listener_policy_rules_all_params(self):
status=200)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
+ start = 'testString'
+ limit = 1
# Invoke method
- response = _service.list_load_balancer_listener_policy_rules(
- load_balancer_id,
- listener_id,
- policy_id,
+ response = _service.list_load_balancer_profiles(
+ start=start,
+ limit=limit,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?',1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
- def test_list_load_balancer_listener_policy_rules_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_listener_policy_rules_all_params.
+ def test_list_load_balancer_profiles_all_params_with_retries(self):
+ # Enable retries and run test_list_load_balancer_profiles_all_params.
_service.enable_retries()
- self.test_list_load_balancer_listener_policy_rules_all_params()
+ self.test_list_load_balancer_profiles_all_params()
- # Disable retries and run test_list_load_balancer_listener_policy_rules_all_params.
+ # Disable retries and run test_list_load_balancer_profiles_all_params.
_service.disable_retries()
- self.test_list_load_balancer_listener_policy_rules_all_params()
+ self.test_list_load_balancer_profiles_all_params()
@responses.activate
- def test_list_load_balancer_listener_policy_rules_value_error(self):
+ def test_list_load_balancer_profiles_required_params(self):
"""
- test_list_load_balancer_listener_policy_rules_value_error()
+ test_list_load_balancer_profiles_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules')
- mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}]}'
+ url = preprocess_url('/load_balancer/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
- "policy_id": policy_id,
- }
- for param in req_param_dict.keys():
- req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.list_load_balancer_listener_policy_rules(**req_copy)
-
-
- def test_list_load_balancer_listener_policy_rules_value_error_with_retries(self):
- # Enable retries and run test_list_load_balancer_listener_policy_rules_value_error.
- _service.enable_retries()
- self.test_list_load_balancer_listener_policy_rules_value_error()
-
- # Disable retries and run test_list_load_balancer_listener_policy_rules_value_error.
- _service.disable_retries()
- self.test_list_load_balancer_listener_policy_rules_value_error()
-
-class TestCreateLoadBalancerListenerPolicyRule():
- """
- Test Class for create_load_balancer_listener_policy_rule
- """
-
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
- @responses.activate
- def test_create_load_balancer_listener_policy_rule_all_params(self):
- """
- create_load_balancer_listener_policy_rule()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules')
- mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
- responses.add(responses.POST,
- url,
- body=mock_response,
- content_type='application/json',
- status=201)
-
- # Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- condition = 'contains'
- type = 'body'
- value = 'testString'
- field = 'MY-APP-HEADER'
-
# Invoke method
- response = _service.create_load_balancer_listener_policy_rule(
- load_balancer_id,
- listener_id,
- policy_id,
- condition,
- type,
- value,
- field=field,
- headers={}
- )
+ response = _service.list_load_balancer_profiles()
+
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['condition'] == 'contains'
- assert req_body['type'] == 'body'
- assert req_body['value'] == 'testString'
- assert req_body['field'] == 'MY-APP-HEADER'
+ assert response.status_code == 200
- def test_create_load_balancer_listener_policy_rule_all_params_with_retries(self):
- # Enable retries and run test_create_load_balancer_listener_policy_rule_all_params.
+ def test_list_load_balancer_profiles_required_params_with_retries(self):
+ # Enable retries and run test_list_load_balancer_profiles_required_params.
_service.enable_retries()
- self.test_create_load_balancer_listener_policy_rule_all_params()
+ self.test_list_load_balancer_profiles_required_params()
- # Disable retries and run test_create_load_balancer_listener_policy_rule_all_params.
+ # Disable retries and run test_list_load_balancer_profiles_required_params.
_service.disable_retries()
- self.test_create_load_balancer_listener_policy_rule_all_params()
+ self.test_list_load_balancer_profiles_required_params()
@responses.activate
- def test_create_load_balancer_listener_policy_rule_value_error(self):
+ def test_list_load_balancer_profiles_value_error(self):
"""
- test_create_load_balancer_listener_policy_rule_value_error()
+ test_list_load_balancer_profiles_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules')
- mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
- responses.add(responses.POST,
+ url = preprocess_url('/load_balancer/profiles')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "profiles": [{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}], "total_count": 132}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- condition = 'contains'
- type = 'body'
- value = 'testString'
- field = 'MY-APP-HEADER'
+ status=200)
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
- "policy_id": policy_id,
- "condition": condition,
- "type": type,
- "value": value,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_load_balancer_listener_policy_rule(**req_copy)
+ _service.list_load_balancer_profiles(**req_copy)
- def test_create_load_balancer_listener_policy_rule_value_error_with_retries(self):
- # Enable retries and run test_create_load_balancer_listener_policy_rule_value_error.
+ def test_list_load_balancer_profiles_value_error_with_retries(self):
+ # Enable retries and run test_list_load_balancer_profiles_value_error.
_service.enable_retries()
- self.test_create_load_balancer_listener_policy_rule_value_error()
+ self.test_list_load_balancer_profiles_value_error()
- # Disable retries and run test_create_load_balancer_listener_policy_rule_value_error.
+ # Disable retries and run test_list_load_balancer_profiles_value_error.
_service.disable_retries()
- self.test_create_load_balancer_listener_policy_rule_value_error()
+ self.test_list_load_balancer_profiles_value_error()
-class TestDeleteLoadBalancerListenerPolicyRule():
+class TestGetLoadBalancerProfile():
"""
- Test Class for delete_load_balancer_listener_policy_rule
+ Test Class for get_load_balancer_profile
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_load_balancer_listener_policy_rule_all_params(self):
+ def test_get_load_balancer_profile_all_params(self):
"""
- delete_load_balancer_listener_policy_rule()
+ get_load_balancer_profile()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/load_balancer/profiles/testString')
+ mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}'
+ responses.add(responses.GET,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- id = 'testString'
+ name = 'testString'
# Invoke method
- response = _service.delete_load_balancer_listener_policy_rule(
- load_balancer_id,
- listener_id,
- policy_id,
- id,
+ response = _service.get_load_balancer_profile(
+ name,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
- def test_delete_load_balancer_listener_policy_rule_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_listener_policy_rule_all_params.
+ def test_get_load_balancer_profile_all_params_with_retries(self):
+ # Enable retries and run test_get_load_balancer_profile_all_params.
_service.enable_retries()
- self.test_delete_load_balancer_listener_policy_rule_all_params()
+ self.test_get_load_balancer_profile_all_params()
- # Disable retries and run test_delete_load_balancer_listener_policy_rule_all_params.
+ # Disable retries and run test_get_load_balancer_profile_all_params.
_service.disable_retries()
- self.test_delete_load_balancer_listener_policy_rule_all_params()
+ self.test_get_load_balancer_profile_all_params()
@responses.activate
- def test_delete_load_balancer_listener_policy_rule_value_error(self):
+ def test_get_load_balancer_profile_value_error(self):
"""
- test_delete_load_balancer_listener_policy_rule_value_error()
+ test_get_load_balancer_profile_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/load_balancer/profiles/testString')
+ mock_response = '{"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "logging_supported": {"type": "fixed", "value": ["datapath"]}, "name": "network-fixed", "route_mode_supported": {"type": "fixed", "value": true}, "security_groups_supported": {"type": "fixed", "value": true}}'
+ responses.add(responses.GET,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- id = 'testString'
+ name = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
- "policy_id": policy_id,
- "id": id,
+ "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.delete_load_balancer_listener_policy_rule(**req_copy)
+ _service.get_load_balancer_profile(**req_copy)
- def test_delete_load_balancer_listener_policy_rule_value_error_with_retries(self):
- # Enable retries and run test_delete_load_balancer_listener_policy_rule_value_error.
+ def test_get_load_balancer_profile_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_profile_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_listener_policy_rule_value_error()
+ self.test_get_load_balancer_profile_value_error()
- # Disable retries and run test_delete_load_balancer_listener_policy_rule_value_error.
+ # Disable retries and run test_get_load_balancer_profile_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_listener_policy_rule_value_error()
+ self.test_get_load_balancer_profile_value_error()
-class TestGetLoadBalancerListenerPolicyRule():
+class TestListLoadBalancers():
"""
- Test Class for get_load_balancer_listener_policy_rule
+ Test Class for list_load_balancers
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_load_balancer_listener_policy_rule_all_params(self):
+ def test_list_load_balancers_all_params(self):
"""
- get_load_balancer_listener_policy_rule()
+ list_load_balancers()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
- mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
+ url = preprocess_url('/load_balancers')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -26662,313 +24459,141 @@ def test_get_load_balancer_listener_policy_rule_all_params(self):
status=200)
# Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- id = 'testString'
+ start = 'testString'
+ limit = 1
# Invoke method
- response = _service.get_load_balancer_listener_policy_rule(
- load_balancer_id,
- listener_id,
- policy_id,
- id,
+ response = _service.list_load_balancers(
+ start=start,
+ limit=limit,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?',1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
- def test_get_load_balancer_listener_policy_rule_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_listener_policy_rule_all_params.
+ def test_list_load_balancers_all_params_with_retries(self):
+ # Enable retries and run test_list_load_balancers_all_params.
_service.enable_retries()
- self.test_get_load_balancer_listener_policy_rule_all_params()
+ self.test_list_load_balancers_all_params()
- # Disable retries and run test_get_load_balancer_listener_policy_rule_all_params.
+ # Disable retries and run test_list_load_balancers_all_params.
_service.disable_retries()
- self.test_get_load_balancer_listener_policy_rule_all_params()
+ self.test_list_load_balancers_all_params()
@responses.activate
- def test_get_load_balancer_listener_policy_rule_value_error(self):
+ def test_list_load_balancers_required_params(self):
"""
- test_get_load_balancer_listener_policy_rule_value_error()
+ test_list_load_balancers_required_params()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
- mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
+ url = preprocess_url('/load_balancers')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- id = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
- "policy_id": policy_id,
- "id": id,
- }
- for param in req_param_dict.keys():
- req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.get_load_balancer_listener_policy_rule(**req_copy)
-
-
- def test_get_load_balancer_listener_policy_rule_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_listener_policy_rule_value_error.
- _service.enable_retries()
- self.test_get_load_balancer_listener_policy_rule_value_error()
-
- # Disable retries and run test_get_load_balancer_listener_policy_rule_value_error.
- _service.disable_retries()
- self.test_get_load_balancer_listener_policy_rule_value_error()
-
-class TestUpdateLoadBalancerListenerPolicyRule():
- """
- Test Class for update_load_balancer_listener_policy_rule
- """
-
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
- @responses.activate
- def test_update_load_balancer_listener_policy_rule_all_params(self):
- """
- update_load_balancer_listener_policy_rule()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
- mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
- responses.add(responses.PATCH,
- url,
- body=mock_response,
- content_type='application/json',
- status=200)
-
- # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model
- load_balancer_listener_policy_rule_patch_model = {}
- load_balancer_listener_policy_rule_patch_model['condition'] = 'contains'
- load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_patch_model['type'] = 'body'
- load_balancer_listener_policy_rule_patch_model['value'] = 'testString'
-
- # Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- id = 'testString'
- load_balancer_listener_policy_rule_patch = load_balancer_listener_policy_rule_patch_model
-
# Invoke method
- response = _service.update_load_balancer_listener_policy_rule(
- load_balancer_id,
- listener_id,
- policy_id,
- id,
- load_balancer_listener_policy_rule_patch,
- headers={}
- )
+ response = _service.list_load_balancers()
+
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == load_balancer_listener_policy_rule_patch
- def test_update_load_balancer_listener_policy_rule_all_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_listener_policy_rule_all_params.
+ def test_list_load_balancers_required_params_with_retries(self):
+ # Enable retries and run test_list_load_balancers_required_params.
_service.enable_retries()
- self.test_update_load_balancer_listener_policy_rule_all_params()
+ self.test_list_load_balancers_required_params()
- # Disable retries and run test_update_load_balancer_listener_policy_rule_all_params.
+ # Disable retries and run test_list_load_balancers_required_params.
_service.disable_retries()
- self.test_update_load_balancer_listener_policy_rule_all_params()
+ self.test_list_load_balancers_required_params()
@responses.activate
- def test_update_load_balancer_listener_policy_rule_value_error(self):
+ def test_list_load_balancers_value_error(self):
"""
- test_update_load_balancer_listener_policy_rule_value_error()
+ test_list_load_balancers_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
- mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
- responses.add(responses.PATCH,
+ url = preprocess_url('/load_balancers')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20"}, "limit": 20, "load_balancers": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}], "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model
- load_balancer_listener_policy_rule_patch_model = {}
- load_balancer_listener_policy_rule_patch_model['condition'] = 'contains'
- load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_patch_model['type'] = 'body'
- load_balancer_listener_policy_rule_patch_model['value'] = 'testString'
-
- # Set up parameter values
- load_balancer_id = 'testString'
- listener_id = 'testString'
- policy_id = 'testString'
- id = 'testString'
- load_balancer_listener_policy_rule_patch = load_balancer_listener_policy_rule_patch_model
-
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "listener_id": listener_id,
- "policy_id": policy_id,
- "id": id,
- "load_balancer_listener_policy_rule_patch": load_balancer_listener_policy_rule_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_load_balancer_listener_policy_rule(**req_copy)
+ _service.list_load_balancers(**req_copy)
- def test_update_load_balancer_listener_policy_rule_value_error_with_retries(self):
- # Enable retries and run test_update_load_balancer_listener_policy_rule_value_error.
+ def test_list_load_balancers_value_error_with_retries(self):
+ # Enable retries and run test_list_load_balancers_value_error.
_service.enable_retries()
- self.test_update_load_balancer_listener_policy_rule_value_error()
+ self.test_list_load_balancers_value_error()
- # Disable retries and run test_update_load_balancer_listener_policy_rule_value_error.
+ # Disable retries and run test_list_load_balancers_value_error.
_service.disable_retries()
- self.test_update_load_balancer_listener_policy_rule_value_error()
+ self.test_list_load_balancers_value_error()
-class TestListLoadBalancerPools():
+class TestCreateLoadBalancer():
"""
- Test Class for list_load_balancer_pools
+ Test Class for create_load_balancer
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
- @responses.activate
- def test_list_load_balancer_pools_all_params(self):
- """
- list_load_balancer_pools()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools')
- mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}'
- responses.add(responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200)
-
- # Set up parameter values
- load_balancer_id = 'testString'
-
- # Invoke method
- response = _service.list_load_balancer_pools(
- load_balancer_id,
- headers={}
- )
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- def test_list_load_balancer_pools_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_pools_all_params.
- _service.enable_retries()
- self.test_list_load_balancer_pools_all_params()
-
- # Disable retries and run test_list_load_balancer_pools_all_params.
- _service.disable_retries()
- self.test_list_load_balancer_pools_all_params()
-
@responses.activate
- def test_list_load_balancer_pools_value_error(self):
+ def test_create_load_balancer_all_params(self):
"""
- test_list_load_balancer_pools_value_error()
+ create_load_balancer()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools')
- mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}'
- responses.add(responses.GET,
+ url = preprocess_url('/load_balancers')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=200)
-
- # Set up parameter values
- load_balancer_id = 'testString'
-
- # Pass in all but one required param and check for a ValueError
- req_param_dict = {
- "load_balancer_id": load_balancer_id,
- }
- for param in req_param_dict.keys():
- req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
- with pytest.raises(ValueError):
- _service.list_load_balancer_pools(**req_copy)
-
+ status=201)
- def test_list_load_balancer_pools_value_error_with_retries(self):
- # Enable retries and run test_list_load_balancer_pools_value_error.
- _service.enable_retries()
- self.test_list_load_balancer_pools_value_error()
+ # Construct a dict representation of a SubnetIdentityById model
+ subnet_identity_model = {}
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Disable retries and run test_list_load_balancer_pools_value_error.
- _service.disable_retries()
- self.test_list_load_balancer_pools_value_error()
+ # Construct a dict representation of a LoadBalancerPoolIdentityByName model
+ load_balancer_pool_identity_by_name_model = {}
+ load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
-class TestCreateLoadBalancerPool():
- """
- Test Class for create_load_balancer_pool
- """
+ # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
+ load_balancer_listener_prototype_load_balancer_context_model = {}
+ load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True
+ load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000
+ load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model
+ load_balancer_listener_prototype_load_balancer_context_model['port'] = 443
+ load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499
+ load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443
+ load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http'
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
+ # Construct a dict representation of a LoadBalancerLoggingDatapath model
+ load_balancer_logging_datapath_model = {}
+ load_balancer_logging_datapath_model['active'] = True
- @responses.activate
- def test_create_load_balancer_pool_all_params(self):
- """
- create_load_balancer_pool()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools')
- mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
- responses.add(responses.POST,
- url,
- body=mock_response,
- content_type='application/json',
- status=201)
+ # Construct a dict representation of a LoadBalancerLogging model
+ load_balancer_logging_model = {}
+ load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
# Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model
load_balancer_pool_health_monitor_prototype_model = {}
@@ -26994,26 +24619,52 @@ def test_create_load_balancer_pool_all_params(self):
load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name'
load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie'
+ # Construct a dict representation of a LoadBalancerPoolPrototype model
+ load_balancer_pool_prototype_model = {}
+ load_balancer_pool_prototype_model['algorithm'] = 'least_connections'
+ load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model
+ load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model]
+ load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_prototype_model['protocol'] = 'http'
+ load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled'
+ load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model
+
+ # Construct a dict representation of a LoadBalancerProfileIdentityByName model
+ load_balancer_profile_identity_model = {}
+ load_balancer_profile_identity_model['name'] = 'network-fixed'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
# Set up parameter values
- load_balancer_id = 'testString'
- algorithm = 'least_connections'
- health_monitor = load_balancer_pool_health_monitor_prototype_model
- protocol = 'http'
- members = [load_balancer_pool_member_prototype_model]
- name = 'my-load-balancer-pool'
- proxy_protocol = 'disabled'
- session_persistence = load_balancer_pool_session_persistence_prototype_model
+ is_public = True
+ subnets = [subnet_identity_model]
+ listeners = [load_balancer_listener_prototype_load_balancer_context_model]
+ logging = load_balancer_logging_model
+ name = 'my-load-balancer'
+ pools = [load_balancer_pool_prototype_model]
+ profile = load_balancer_profile_identity_model
+ resource_group = resource_group_identity_model
+ route_mode = True
+ security_groups = [security_group_identity_model]
# Invoke method
- response = _service.create_load_balancer_pool(
- load_balancer_id,
- algorithm,
- health_monitor,
- protocol,
- members=members,
+ response = _service.create_load_balancer(
+ is_public,
+ subnets,
+ listeners=listeners,
+ logging=logging,
name=name,
- proxy_protocol=proxy_protocol,
- session_persistence=session_persistence,
+ pools=pools,
+ profile=profile,
+ resource_group=resource_group,
+ route_mode=route_mode,
+ security_groups=security_groups,
headers={}
)
@@ -27022,37 +24673,66 @@ def test_create_load_balancer_pool_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['algorithm'] == 'least_connections'
- assert req_body['health_monitor'] == load_balancer_pool_health_monitor_prototype_model
- assert req_body['protocol'] == 'http'
- assert req_body['members'] == [load_balancer_pool_member_prototype_model]
- assert req_body['name'] == 'my-load-balancer-pool'
- assert req_body['proxy_protocol'] == 'disabled'
- assert req_body['session_persistence'] == load_balancer_pool_session_persistence_prototype_model
+ assert req_body['is_public'] == True
+ assert req_body['subnets'] == [subnet_identity_model]
+ assert req_body['listeners'] == [load_balancer_listener_prototype_load_balancer_context_model]
+ assert req_body['logging'] == load_balancer_logging_model
+ assert req_body['name'] == 'my-load-balancer'
+ assert req_body['pools'] == [load_balancer_pool_prototype_model]
+ assert req_body['profile'] == load_balancer_profile_identity_model
+ assert req_body['resource_group'] == resource_group_identity_model
+ assert req_body['route_mode'] == True
+ assert req_body['security_groups'] == [security_group_identity_model]
- def test_create_load_balancer_pool_all_params_with_retries(self):
- # Enable retries and run test_create_load_balancer_pool_all_params.
+ def test_create_load_balancer_all_params_with_retries(self):
+ # Enable retries and run test_create_load_balancer_all_params.
_service.enable_retries()
- self.test_create_load_balancer_pool_all_params()
+ self.test_create_load_balancer_all_params()
- # Disable retries and run test_create_load_balancer_pool_all_params.
+ # Disable retries and run test_create_load_balancer_all_params.
_service.disable_retries()
- self.test_create_load_balancer_pool_all_params()
+ self.test_create_load_balancer_all_params()
@responses.activate
- def test_create_load_balancer_pool_value_error(self):
+ def test_create_load_balancer_value_error(self):
"""
- test_create_load_balancer_pool_value_error()
+ test_create_load_balancer_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools')
- mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
+ url = preprocess_url('/load_balancers')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
+ # 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 LoadBalancerPoolIdentityByName model
+ load_balancer_pool_identity_by_name_model = {}
+ load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
+
+ # Construct a dict representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
+ load_balancer_listener_prototype_load_balancer_context_model = {}
+ load_balancer_listener_prototype_load_balancer_context_model['accept_proxy_protocol'] = True
+ load_balancer_listener_prototype_load_balancer_context_model['connection_limit'] = 2000
+ load_balancer_listener_prototype_load_balancer_context_model['default_pool'] = load_balancer_pool_identity_by_name_model
+ load_balancer_listener_prototype_load_balancer_context_model['port'] = 443
+ load_balancer_listener_prototype_load_balancer_context_model['port_max'] = 499
+ load_balancer_listener_prototype_load_balancer_context_model['port_min'] = 443
+ load_balancer_listener_prototype_load_balancer_context_model['protocol'] = 'http'
+
+ # Construct a dict representation of a LoadBalancerLoggingDatapath model
+ load_balancer_logging_datapath_model = {}
+ load_balancer_logging_datapath_model['active'] = True
+
+ # Construct a dict representation of a LoadBalancerLogging model
+ load_balancer_logging_model = {}
+ load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
+
# Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model
load_balancer_pool_health_monitor_prototype_model = {}
load_balancer_pool_health_monitor_prototype_model['delay'] = 5
@@ -27077,72 +24757,81 @@ def test_create_load_balancer_pool_value_error(self):
load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name'
load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie'
+ # Construct a dict representation of a LoadBalancerPoolPrototype model
+ load_balancer_pool_prototype_model = {}
+ load_balancer_pool_prototype_model['algorithm'] = 'least_connections'
+ load_balancer_pool_prototype_model['health_monitor'] = load_balancer_pool_health_monitor_prototype_model
+ load_balancer_pool_prototype_model['members'] = [load_balancer_pool_member_prototype_model]
+ load_balancer_pool_prototype_model['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_prototype_model['protocol'] = 'http'
+ load_balancer_pool_prototype_model['proxy_protocol'] = 'disabled'
+ load_balancer_pool_prototype_model['session_persistence'] = load_balancer_pool_session_persistence_prototype_model
+
+ # Construct a dict representation of a LoadBalancerProfileIdentityByName model
+ load_balancer_profile_identity_model = {}
+ load_balancer_profile_identity_model['name'] = 'network-fixed'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
# Set up parameter values
- load_balancer_id = 'testString'
- algorithm = 'least_connections'
- health_monitor = load_balancer_pool_health_monitor_prototype_model
- protocol = 'http'
- members = [load_balancer_pool_member_prototype_model]
- name = 'my-load-balancer-pool'
- proxy_protocol = 'disabled'
- session_persistence = load_balancer_pool_session_persistence_prototype_model
+ is_public = True
+ subnets = [subnet_identity_model]
+ listeners = [load_balancer_listener_prototype_load_balancer_context_model]
+ logging = load_balancer_logging_model
+ name = 'my-load-balancer'
+ pools = [load_balancer_pool_prototype_model]
+ profile = load_balancer_profile_identity_model
+ resource_group = resource_group_identity_model
+ route_mode = True
+ security_groups = [security_group_identity_model]
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "algorithm": algorithm,
- "health_monitor": health_monitor,
- "protocol": protocol,
+ "is_public": is_public,
+ "subnets": subnets,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_load_balancer_pool(**req_copy)
+ _service.create_load_balancer(**req_copy)
- def test_create_load_balancer_pool_value_error_with_retries(self):
- # Enable retries and run test_create_load_balancer_pool_value_error.
+ def test_create_load_balancer_value_error_with_retries(self):
+ # Enable retries and run test_create_load_balancer_value_error.
_service.enable_retries()
- self.test_create_load_balancer_pool_value_error()
+ self.test_create_load_balancer_value_error()
- # Disable retries and run test_create_load_balancer_pool_value_error.
+ # Disable retries and run test_create_load_balancer_value_error.
_service.disable_retries()
- self.test_create_load_balancer_pool_value_error()
+ self.test_create_load_balancer_value_error()
-class TestDeleteLoadBalancerPool():
+class TestDeleteLoadBalancer():
"""
- Test Class for delete_load_balancer_pool
+ Test Class for delete_load_balancer
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_load_balancer_pool_all_params(self):
+ def test_delete_load_balancer_all_params(self):
"""
- delete_load_balancer_pool()
+ delete_load_balancer()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString')
+ url = preprocess_url('/load_balancers/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- load_balancer_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_load_balancer_pool(
- load_balancer_id,
+ response = _service.delete_load_balancer(
id,
headers={}
)
@@ -27151,74 +24840,61 @@ def test_delete_load_balancer_pool_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_load_balancer_pool_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_pool_all_params.
+ def test_delete_load_balancer_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_all_params.
_service.enable_retries()
- self.test_delete_load_balancer_pool_all_params()
+ self.test_delete_load_balancer_all_params()
- # Disable retries and run test_delete_load_balancer_pool_all_params.
+ # Disable retries and run test_delete_load_balancer_all_params.
_service.disable_retries()
- self.test_delete_load_balancer_pool_all_params()
+ self.test_delete_load_balancer_all_params()
@responses.activate
- def test_delete_load_balancer_pool_value_error(self):
+ def test_delete_load_balancer_value_error(self):
"""
- test_delete_load_balancer_pool_value_error()
+ test_delete_load_balancer_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString')
+ url = preprocess_url('/load_balancers/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
- load_balancer_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_load_balancer_pool(**req_copy)
+ _service.delete_load_balancer(**req_copy)
- def test_delete_load_balancer_pool_value_error_with_retries(self):
- # Enable retries and run test_delete_load_balancer_pool_value_error.
+ def test_delete_load_balancer_value_error_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_pool_value_error()
+ self.test_delete_load_balancer_value_error()
- # Disable retries and run test_delete_load_balancer_pool_value_error.
+ # Disable retries and run test_delete_load_balancer_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_pool_value_error()
+ self.test_delete_load_balancer_value_error()
-class TestGetLoadBalancerPool():
+class TestGetLoadBalancer():
"""
- Test Class for get_load_balancer_pool
+ Test Class for get_load_balancer
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_load_balancer_pool_all_params(self):
+ def test_get_load_balancer_all_params(self):
"""
- get_load_balancer_pool()
+ get_load_balancer()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString')
- mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
+ url = preprocess_url('/load_balancers/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -27226,12 +24902,10 @@ def test_get_load_balancer_pool_all_params(self):
status=200)
# Set up parameter values
- load_balancer_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_load_balancer_pool(
- load_balancer_id,
+ response = _service.get_load_balancer(
id,
headers={}
)
@@ -27240,23 +24914,23 @@ def test_get_load_balancer_pool_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_load_balancer_pool_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_pool_all_params.
+ def test_get_load_balancer_all_params_with_retries(self):
+ # Enable retries and run test_get_load_balancer_all_params.
_service.enable_retries()
- self.test_get_load_balancer_pool_all_params()
+ self.test_get_load_balancer_all_params()
- # Disable retries and run test_get_load_balancer_pool_all_params.
+ # Disable retries and run test_get_load_balancer_all_params.
_service.disable_retries()
- self.test_get_load_balancer_pool_all_params()
+ self.test_get_load_balancer_all_params()
@responses.activate
- def test_get_load_balancer_pool_value_error(self):
+ def test_get_load_balancer_value_error(self):
"""
- test_get_load_balancer_pool_value_error()
+ test_get_load_balancer_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString')
- mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
+ url = preprocess_url('/load_balancers/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -27264,92 +24938,67 @@ def test_get_load_balancer_pool_value_error(self):
status=200)
# Set up parameter values
- load_balancer_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_load_balancer_pool(**req_copy)
+ _service.get_load_balancer(**req_copy)
- def test_get_load_balancer_pool_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_pool_value_error.
+ def test_get_load_balancer_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_value_error.
_service.enable_retries()
- self.test_get_load_balancer_pool_value_error()
+ self.test_get_load_balancer_value_error()
- # Disable retries and run test_get_load_balancer_pool_value_error.
+ # Disable retries and run test_get_load_balancer_value_error.
_service.disable_retries()
- self.test_get_load_balancer_pool_value_error()
+ self.test_get_load_balancer_value_error()
-class TestUpdateLoadBalancerPool():
+class TestUpdateLoadBalancer():
"""
- Test Class for update_load_balancer_pool
+ Test Class for update_load_balancer
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_load_balancer_pool_all_params(self):
+ def test_update_load_balancer_all_params(self):
"""
- update_load_balancer_pool()
+ update_load_balancer()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString')
- mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
+ url = preprocess_url('/load_balancers/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a LoadBalancerPoolHealthMonitorPatch model
- load_balancer_pool_health_monitor_patch_model = {}
- load_balancer_pool_health_monitor_patch_model['delay'] = 5
- load_balancer_pool_health_monitor_patch_model['max_retries'] = 2
- load_balancer_pool_health_monitor_patch_model['port'] = 22
- load_balancer_pool_health_monitor_patch_model['timeout'] = 2
- load_balancer_pool_health_monitor_patch_model['type'] = 'http'
- load_balancer_pool_health_monitor_patch_model['url_path'] = '/'
+ # Construct a dict representation of a LoadBalancerLoggingDatapath model
+ load_balancer_logging_datapath_model = {}
+ load_balancer_logging_datapath_model['active'] = True
- # Construct a dict representation of a LoadBalancerPoolSessionPersistencePatch model
- load_balancer_pool_session_persistence_patch_model = {}
- load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie'
+ # Construct a dict representation of a LoadBalancerLogging model
+ load_balancer_logging_model = {}
+ load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
- # Construct a dict representation of a LoadBalancerPoolPatch model
- load_balancer_pool_patch_model = {}
- load_balancer_pool_patch_model['algorithm'] = 'least_connections'
- load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model
- load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool'
- load_balancer_pool_patch_model['protocol'] = 'http'
- load_balancer_pool_patch_model['proxy_protocol'] = 'disabled'
- load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model
+ # Construct a dict representation of a LoadBalancerPatch model
+ load_balancer_patch_model = {}
+ load_balancer_patch_model['logging'] = load_balancer_logging_model
+ load_balancer_patch_model['name'] = 'my-load-balancer'
# Set up parameter values
- load_balancer_id = 'testString'
id = 'testString'
- load_balancer_pool_patch = load_balancer_pool_patch_model
+ load_balancer_patch = load_balancer_patch_model
# Invoke method
- response = _service.update_load_balancer_pool(
- load_balancer_id,
+ response = _service.update_load_balancer(
id,
- load_balancer_pool_patch,
+ load_balancer_patch,
headers={}
)
@@ -27358,104 +25007,81 @@ def test_update_load_balancer_pool_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == load_balancer_pool_patch
+ assert req_body == load_balancer_patch
- def test_update_load_balancer_pool_all_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_pool_all_params.
+ def test_update_load_balancer_all_params_with_retries(self):
+ # Enable retries and run test_update_load_balancer_all_params.
_service.enable_retries()
- self.test_update_load_balancer_pool_all_params()
+ self.test_update_load_balancer_all_params()
- # Disable retries and run test_update_load_balancer_pool_all_params.
+ # Disable retries and run test_update_load_balancer_all_params.
_service.disable_retries()
- self.test_update_load_balancer_pool_all_params()
+ self.test_update_load_balancer_all_params()
@responses.activate
- def test_update_load_balancer_pool_value_error(self):
+ def test_update_load_balancer_value_error(self):
"""
- test_update_load_balancer_pool_value_error()
+ test_update_load_balancer_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString')
- mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
+ url = preprocess_url('/load_balancers/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "hostname": "my-load-balancer-123456-us-south-1.lb.bluemix.net", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "id": "dd754295-e9e0-4c9d-bf6c-58fbc59e5727", "is_public": true, "listeners": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "logging": {"datapath": {"active": true}}, "name": "my-load-balancer", "operating_status": "offline", "pools": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}], "private_ips": [{"address": "192.168.3.4"}], "profile": {"family": "network", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed", "name": "network-fixed"}, "provisioning_status": "active", "public_ips": [{"address": "192.168.3.4"}], "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "route_mode": true, "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "security_groups_supported": false, "subnets": [{"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "id": "7ec86020-1c6e-4889-b3f0-a15f2e50f87e", "name": "my-subnet"}]}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a LoadBalancerPoolHealthMonitorPatch model
- load_balancer_pool_health_monitor_patch_model = {}
- load_balancer_pool_health_monitor_patch_model['delay'] = 5
- load_balancer_pool_health_monitor_patch_model['max_retries'] = 2
- load_balancer_pool_health_monitor_patch_model['port'] = 22
- load_balancer_pool_health_monitor_patch_model['timeout'] = 2
- load_balancer_pool_health_monitor_patch_model['type'] = 'http'
- load_balancer_pool_health_monitor_patch_model['url_path'] = '/'
+ # Construct a dict representation of a LoadBalancerLoggingDatapath model
+ load_balancer_logging_datapath_model = {}
+ load_balancer_logging_datapath_model['active'] = True
- # Construct a dict representation of a LoadBalancerPoolSessionPersistencePatch model
- load_balancer_pool_session_persistence_patch_model = {}
- load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie'
+ # Construct a dict representation of a LoadBalancerLogging model
+ load_balancer_logging_model = {}
+ load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
- # Construct a dict representation of a LoadBalancerPoolPatch model
- load_balancer_pool_patch_model = {}
- load_balancer_pool_patch_model['algorithm'] = 'least_connections'
- load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model
- load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool'
- load_balancer_pool_patch_model['protocol'] = 'http'
- load_balancer_pool_patch_model['proxy_protocol'] = 'disabled'
- load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model
+ # Construct a dict representation of a LoadBalancerPatch model
+ load_balancer_patch_model = {}
+ load_balancer_patch_model['logging'] = load_balancer_logging_model
+ load_balancer_patch_model['name'] = 'my-load-balancer'
# Set up parameter values
- load_balancer_id = 'testString'
id = 'testString'
- load_balancer_pool_patch = load_balancer_pool_patch_model
+ load_balancer_patch = load_balancer_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
"id": id,
- "load_balancer_pool_patch": load_balancer_pool_patch,
+ "load_balancer_patch": load_balancer_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_load_balancer_pool(**req_copy)
+ _service.update_load_balancer(**req_copy)
- def test_update_load_balancer_pool_value_error_with_retries(self):
- # Enable retries and run test_update_load_balancer_pool_value_error.
+ def test_update_load_balancer_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_value_error.
_service.enable_retries()
- self.test_update_load_balancer_pool_value_error()
+ self.test_update_load_balancer_value_error()
- # Disable retries and run test_update_load_balancer_pool_value_error.
+ # Disable retries and run test_update_load_balancer_value_error.
_service.disable_retries()
- self.test_update_load_balancer_pool_value_error()
+ self.test_update_load_balancer_value_error()
-class TestListLoadBalancerPoolMembers():
+class TestGetLoadBalancerStatistics():
"""
- Test Class for list_load_balancer_pool_members
+ Test Class for get_load_balancer_statistics
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_load_balancer_pool_members_all_params(self):
+ def test_get_load_balancer_statistics_all_params(self):
"""
- list_load_balancer_pool_members()
+ get_load_balancer_statistics()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members')
- mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}'
+ url = preprocess_url('/load_balancers/testString/statistics')
+ mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -27463,13 +25089,11 @@ def test_list_load_balancer_pool_members_all_params(self):
status=200)
# Set up parameter values
- load_balancer_id = 'testString'
- pool_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_load_balancer_pool_members(
- load_balancer_id,
- pool_id,
+ response = _service.get_load_balancer_statistics(
+ id,
headers={}
)
@@ -27477,23 +25101,23 @@ def test_list_load_balancer_pool_members_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_list_load_balancer_pool_members_all_params_with_retries(self):
- # Enable retries and run test_list_load_balancer_pool_members_all_params.
+ def test_get_load_balancer_statistics_all_params_with_retries(self):
+ # Enable retries and run test_get_load_balancer_statistics_all_params.
_service.enable_retries()
- self.test_list_load_balancer_pool_members_all_params()
+ self.test_get_load_balancer_statistics_all_params()
- # Disable retries and run test_list_load_balancer_pool_members_all_params.
+ # Disable retries and run test_get_load_balancer_statistics_all_params.
_service.disable_retries()
- self.test_list_load_balancer_pool_members_all_params()
+ self.test_get_load_balancer_statistics_all_params()
@responses.activate
- def test_list_load_balancer_pool_members_value_error(self):
+ def test_get_load_balancer_statistics_value_error(self):
"""
- test_list_load_balancer_pool_members_value_error()
+ test_get_load_balancer_statistics_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members')
- mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}'
+ url = preprocess_url('/load_balancers/testString/statistics')
+ mock_response = '{"active_connections": 797, "connection_rate": 91.121, "data_processed_this_month": 10093173145, "throughput": 167.278}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -27501,300 +25125,321 @@ def test_list_load_balancer_pool_members_value_error(self):
status=200)
# Set up parameter values
- load_balancer_id = 'testString'
- pool_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "load_balancer_id": load_balancer_id,
- "pool_id": pool_id,
+ "id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_load_balancer_pool_members(**req_copy)
+ _service.get_load_balancer_statistics(**req_copy)
- def test_list_load_balancer_pool_members_value_error_with_retries(self):
- # Enable retries and run test_list_load_balancer_pool_members_value_error.
+ def test_get_load_balancer_statistics_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_statistics_value_error.
_service.enable_retries()
- self.test_list_load_balancer_pool_members_value_error()
+ self.test_get_load_balancer_statistics_value_error()
- # Disable retries and run test_list_load_balancer_pool_members_value_error.
+ # Disable retries and run test_get_load_balancer_statistics_value_error.
_service.disable_retries()
- self.test_list_load_balancer_pool_members_value_error()
+ self.test_get_load_balancer_statistics_value_error()
-class TestCreateLoadBalancerPoolMember():
+class TestListLoadBalancerListeners():
"""
- Test Class for create_load_balancer_pool_member
+ Test Class for list_load_balancer_listeners
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_load_balancer_pool_member_all_params(self):
+ def test_list_load_balancer_listeners_all_params(self):
"""
- create_load_balancer_pool_member()
+ list_load_balancer_listeners()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
- responses.add(responses.POST,
+ url = preprocess_url('/load_balancers/testString/listeners')
+ mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
- load_balancer_pool_member_target_prototype_model = {}
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ status=200)
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
- port = 80
- target = load_balancer_pool_member_target_prototype_model
- weight = 50
# Invoke method
- response = _service.create_load_balancer_pool_member(
+ response = _service.list_load_balancer_listeners(
load_balancer_id,
- pool_id,
- port,
- target,
- weight=weight,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 201
- # Validate body params
- req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['port'] == 80
- assert req_body['target'] == load_balancer_pool_member_target_prototype_model
- assert req_body['weight'] == 50
+ assert response.status_code == 200
- def test_create_load_balancer_pool_member_all_params_with_retries(self):
- # Enable retries and run test_create_load_balancer_pool_member_all_params.
+ def test_list_load_balancer_listeners_all_params_with_retries(self):
+ # Enable retries and run test_list_load_balancer_listeners_all_params.
_service.enable_retries()
- self.test_create_load_balancer_pool_member_all_params()
+ self.test_list_load_balancer_listeners_all_params()
- # Disable retries and run test_create_load_balancer_pool_member_all_params.
+ # Disable retries and run test_list_load_balancer_listeners_all_params.
_service.disable_retries()
- self.test_create_load_balancer_pool_member_all_params()
+ self.test_list_load_balancer_listeners_all_params()
@responses.activate
- def test_create_load_balancer_pool_member_value_error(self):
+ def test_list_load_balancer_listeners_value_error(self):
"""
- test_create_load_balancer_pool_member_value_error()
+ test_list_load_balancer_listeners_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
- responses.add(responses.POST,
+ url = preprocess_url('/load_balancers/testString/listeners')
+ mock_response = '{"listeners": [{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}]}'
+ responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
- status=201)
-
- # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
- load_balancer_pool_member_target_prototype_model = {}
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ status=200)
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
- port = 80
- target = load_balancer_pool_member_target_prototype_model
- weight = 50
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"load_balancer_id": load_balancer_id,
- "pool_id": pool_id,
- "port": port,
- "target": target,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_load_balancer_pool_member(**req_copy)
+ _service.list_load_balancer_listeners(**req_copy)
- def test_create_load_balancer_pool_member_value_error_with_retries(self):
- # Enable retries and run test_create_load_balancer_pool_member_value_error.
+ def test_list_load_balancer_listeners_value_error_with_retries(self):
+ # Enable retries and run test_list_load_balancer_listeners_value_error.
_service.enable_retries()
- self.test_create_load_balancer_pool_member_value_error()
+ self.test_list_load_balancer_listeners_value_error()
- # Disable retries and run test_create_load_balancer_pool_member_value_error.
+ # Disable retries and run test_list_load_balancer_listeners_value_error.
_service.disable_retries()
- self.test_create_load_balancer_pool_member_value_error()
+ self.test_list_load_balancer_listeners_value_error()
-class TestReplaceLoadBalancerPoolMembers():
+class TestCreateLoadBalancerListener():
"""
- Test Class for replace_load_balancer_pool_members
+ Test Class for create_load_balancer_listener
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_replace_load_balancer_pool_members_all_params(self):
+ def test_create_load_balancer_listener_all_params(self):
"""
- replace_load_balancer_pool_members()
+ create_load_balancer_listener()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members')
- mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}'
- responses.add(responses.PUT,
+ url = preprocess_url('/load_balancers/testString/listeners')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=202)
+ status=201)
- # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
- load_balancer_pool_member_target_prototype_model = {}
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct a dict representation of a CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
- # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
- load_balancer_pool_member_prototype_model = {}
- load_balancer_pool_member_prototype_model['port'] = 80
- load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
- load_balancer_pool_member_prototype_model['weight'] = 50
+ # Construct a dict representation of a LoadBalancerPoolIdentityById model
+ load_balancer_pool_identity_model = {}
+ load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerIdentityById model
+ load_balancer_listener_identity_model = {}
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model
+ load_balancer_listener_https_redirect_prototype_model = {}
+ load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301
+ load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
+ load_balancer_listener_policy_rule_prototype_model = {}
+ load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
+ load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
+ load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
+ load_balancer_listener_policy_target_prototype_model = {}
+ load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model
+ load_balancer_listener_policy_prototype_model = {}
+ load_balancer_listener_policy_prototype_model['action'] = 'forward'
+ load_balancer_listener_policy_prototype_model['name'] = 'my-policy'
+ load_balancer_listener_policy_prototype_model['priority'] = 5
+ load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model]
+ load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
- members = [load_balancer_pool_member_prototype_model]
+ protocol = 'http'
+ accept_proxy_protocol = True
+ certificate_instance = certificate_instance_identity_model
+ connection_limit = 2000
+ default_pool = load_balancer_pool_identity_model
+ https_redirect = load_balancer_listener_https_redirect_prototype_model
+ policies = [load_balancer_listener_policy_prototype_model]
+ port = 443
+ port_max = 499
+ port_min = 443
# Invoke method
- response = _service.replace_load_balancer_pool_members(
+ response = _service.create_load_balancer_listener(
load_balancer_id,
- pool_id,
- members,
+ protocol,
+ accept_proxy_protocol=accept_proxy_protocol,
+ certificate_instance=certificate_instance,
+ connection_limit=connection_limit,
+ default_pool=default_pool,
+ https_redirect=https_redirect,
+ policies=policies,
+ port=port,
+ port_max=port_max,
+ port_min=port_min,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 202
+ assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['members'] == [load_balancer_pool_member_prototype_model]
+ assert req_body['protocol'] == 'http'
+ assert req_body['accept_proxy_protocol'] == True
+ assert req_body['certificate_instance'] == certificate_instance_identity_model
+ assert req_body['connection_limit'] == 2000
+ assert req_body['default_pool'] == load_balancer_pool_identity_model
+ assert req_body['https_redirect'] == load_balancer_listener_https_redirect_prototype_model
+ assert req_body['policies'] == [load_balancer_listener_policy_prototype_model]
+ assert req_body['port'] == 443
+ assert req_body['port_max'] == 499
+ assert req_body['port_min'] == 443
- def test_replace_load_balancer_pool_members_all_params_with_retries(self):
- # Enable retries and run test_replace_load_balancer_pool_members_all_params.
+ def test_create_load_balancer_listener_all_params_with_retries(self):
+ # Enable retries and run test_create_load_balancer_listener_all_params.
_service.enable_retries()
- self.test_replace_load_balancer_pool_members_all_params()
+ self.test_create_load_balancer_listener_all_params()
- # Disable retries and run test_replace_load_balancer_pool_members_all_params.
+ # Disable retries and run test_create_load_balancer_listener_all_params.
_service.disable_retries()
- self.test_replace_load_balancer_pool_members_all_params()
+ self.test_create_load_balancer_listener_all_params()
@responses.activate
- def test_replace_load_balancer_pool_members_value_error(self):
+ def test_create_load_balancer_listener_value_error(self):
"""
- test_replace_load_balancer_pool_members_value_error()
+ test_create_load_balancer_listener_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members')
- mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}'
- responses.add(responses.PUT,
+ url = preprocess_url('/load_balancers/testString/listeners')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
- status=202)
+ status=201)
- # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
- load_balancer_pool_member_target_prototype_model = {}
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct a dict representation of a CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
- # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
- load_balancer_pool_member_prototype_model = {}
- load_balancer_pool_member_prototype_model['port'] = 80
- load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
- load_balancer_pool_member_prototype_model['weight'] = 50
+ # Construct a dict representation of a LoadBalancerPoolIdentityById model
+ load_balancer_pool_identity_model = {}
+ load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerIdentityById model
+ load_balancer_listener_identity_model = {}
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPrototype model
+ load_balancer_listener_https_redirect_prototype_model = {}
+ load_balancer_listener_https_redirect_prototype_model['http_status_code'] = 301
+ load_balancer_listener_https_redirect_prototype_model['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_https_redirect_prototype_model['uri'] = '/example?doc=get'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
+ load_balancer_listener_policy_rule_prototype_model = {}
+ load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
+ load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
+ load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
+ load_balancer_listener_policy_target_prototype_model = {}
+ load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyPrototype model
+ load_balancer_listener_policy_prototype_model = {}
+ load_balancer_listener_policy_prototype_model['action'] = 'forward'
+ load_balancer_listener_policy_prototype_model['name'] = 'my-policy'
+ load_balancer_listener_policy_prototype_model['priority'] = 5
+ load_balancer_listener_policy_prototype_model['rules'] = [load_balancer_listener_policy_rule_prototype_model]
+ load_balancer_listener_policy_prototype_model['target'] = load_balancer_listener_policy_target_prototype_model
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
- members = [load_balancer_pool_member_prototype_model]
+ protocol = 'http'
+ accept_proxy_protocol = True
+ certificate_instance = certificate_instance_identity_model
+ connection_limit = 2000
+ default_pool = load_balancer_pool_identity_model
+ https_redirect = load_balancer_listener_https_redirect_prototype_model
+ policies = [load_balancer_listener_policy_prototype_model]
+ port = 443
+ port_max = 499
+ port_min = 443
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"load_balancer_id": load_balancer_id,
- "pool_id": pool_id,
- "members": members,
+ "protocol": protocol,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.replace_load_balancer_pool_members(**req_copy)
+ _service.create_load_balancer_listener(**req_copy)
- def test_replace_load_balancer_pool_members_value_error_with_retries(self):
- # Enable retries and run test_replace_load_balancer_pool_members_value_error.
+ def test_create_load_balancer_listener_value_error_with_retries(self):
+ # Enable retries and run test_create_load_balancer_listener_value_error.
_service.enable_retries()
- self.test_replace_load_balancer_pool_members_value_error()
+ self.test_create_load_balancer_listener_value_error()
- # Disable retries and run test_replace_load_balancer_pool_members_value_error.
+ # Disable retries and run test_create_load_balancer_listener_value_error.
_service.disable_retries()
- self.test_replace_load_balancer_pool_members_value_error()
+ self.test_create_load_balancer_listener_value_error()
-class TestDeleteLoadBalancerPoolMember():
+class TestDeleteLoadBalancerListener():
"""
- Test Class for delete_load_balancer_pool_member
+ Test Class for delete_load_balancer_listener
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_load_balancer_pool_member_all_params(self):
+ def test_delete_load_balancer_listener_all_params(self):
"""
- delete_load_balancer_pool_member()
+ delete_load_balancer_listener()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString')
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_load_balancer_pool_member(
+ response = _service.delete_load_balancer_listener(
load_balancer_id,
- pool_id,
id,
headers={}
)
@@ -27803,76 +25448,63 @@ def test_delete_load_balancer_pool_member_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_load_balancer_pool_member_all_params_with_retries(self):
- # Enable retries and run test_delete_load_balancer_pool_member_all_params.
+ def test_delete_load_balancer_listener_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_all_params.
_service.enable_retries()
- self.test_delete_load_balancer_pool_member_all_params()
+ self.test_delete_load_balancer_listener_all_params()
- # Disable retries and run test_delete_load_balancer_pool_member_all_params.
+ # Disable retries and run test_delete_load_balancer_listener_all_params.
_service.disable_retries()
- self.test_delete_load_balancer_pool_member_all_params()
+ self.test_delete_load_balancer_listener_all_params()
@responses.activate
- def test_delete_load_balancer_pool_member_value_error(self):
+ def test_delete_load_balancer_listener_value_error(self):
"""
- test_delete_load_balancer_pool_member_value_error()
+ test_delete_load_balancer_listener_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString')
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"load_balancer_id": load_balancer_id,
- "pool_id": pool_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_load_balancer_pool_member(**req_copy)
+ _service.delete_load_balancer_listener(**req_copy)
- def test_delete_load_balancer_pool_member_value_error_with_retries(self):
- # Enable retries and run test_delete_load_balancer_pool_member_value_error.
+ def test_delete_load_balancer_listener_value_error_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_value_error.
_service.enable_retries()
- self.test_delete_load_balancer_pool_member_value_error()
+ self.test_delete_load_balancer_listener_value_error()
- # Disable retries and run test_delete_load_balancer_pool_member_value_error.
+ # Disable retries and run test_delete_load_balancer_listener_value_error.
_service.disable_retries()
- self.test_delete_load_balancer_pool_member_value_error()
+ self.test_delete_load_balancer_listener_value_error()
-class TestGetLoadBalancerPoolMember():
+class TestGetLoadBalancerListener():
"""
- Test Class for get_load_balancer_pool_member
+ Test Class for get_load_balancer_listener
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_load_balancer_pool_member_all_params(self):
+ def test_get_load_balancer_listener_all_params(self):
"""
- get_load_balancer_pool_member()
+ get_load_balancer_listener()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -27881,13 +25513,11 @@ def test_get_load_balancer_pool_member_all_params(self):
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_load_balancer_pool_member(
+ response = _service.get_load_balancer_listener(
load_balancer_id,
- pool_id,
id,
headers={}
)
@@ -27896,23 +25526,23 @@ def test_get_load_balancer_pool_member_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_load_balancer_pool_member_all_params_with_retries(self):
- # Enable retries and run test_get_load_balancer_pool_member_all_params.
+ def test_get_load_balancer_listener_all_params_with_retries(self):
+ # Enable retries and run test_get_load_balancer_listener_all_params.
_service.enable_retries()
- self.test_get_load_balancer_pool_member_all_params()
+ self.test_get_load_balancer_listener_all_params()
- # Disable retries and run test_get_load_balancer_pool_member_all_params.
+ # Disable retries and run test_get_load_balancer_listener_all_params.
_service.disable_retries()
- self.test_get_load_balancer_pool_member_all_params()
+ self.test_get_load_balancer_listener_all_params()
@responses.activate
- def test_get_load_balancer_pool_member_value_error(self):
+ def test_get_load_balancer_listener_value_error(self):
"""
- test_get_load_balancer_pool_member_value_error()
+ test_get_load_balancer_listener_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -27921,82 +25551,87 @@ def test_get_load_balancer_pool_member_value_error(self):
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"load_balancer_id": load_balancer_id,
- "pool_id": pool_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_load_balancer_pool_member(**req_copy)
+ _service.get_load_balancer_listener(**req_copy)
- def test_get_load_balancer_pool_member_value_error_with_retries(self):
- # Enable retries and run test_get_load_balancer_pool_member_value_error.
+ def test_get_load_balancer_listener_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_listener_value_error.
_service.enable_retries()
- self.test_get_load_balancer_pool_member_value_error()
+ self.test_get_load_balancer_listener_value_error()
- # Disable retries and run test_get_load_balancer_pool_member_value_error.
+ # Disable retries and run test_get_load_balancer_listener_value_error.
_service.disable_retries()
- self.test_get_load_balancer_pool_member_value_error()
+ self.test_get_load_balancer_listener_value_error()
-class TestUpdateLoadBalancerPoolMember():
+class TestUpdateLoadBalancerListener():
"""
- Test Class for update_load_balancer_pool_member
+ Test Class for update_load_balancer_listener
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_load_balancer_pool_member_all_params(self):
+ def test_update_load_balancer_listener_all_params(self):
"""
- update_load_balancer_pool_member()
+ update_load_balancer_listener()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
- load_balancer_pool_member_target_prototype_model = {}
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct a dict representation of a CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
- # Construct a dict representation of a LoadBalancerPoolMemberPatch model
- load_balancer_pool_member_patch_model = {}
- load_balancer_pool_member_patch_model['port'] = 80
- load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model
- load_balancer_pool_member_patch_model['weight'] = 50
+ # Construct a dict representation of a LoadBalancerPoolIdentityById model
+ load_balancer_pool_identity_model = {}
+ load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerIdentityById model
+ load_balancer_listener_identity_model = {}
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model
+ load_balancer_listener_https_redirect_patch_model = {}
+ load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301
+ load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get'
+
+ # Construct a dict representation of a LoadBalancerListenerPatch model
+ load_balancer_listener_patch_model = {}
+ load_balancer_listener_patch_model['accept_proxy_protocol'] = True
+ load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model
+ load_balancer_listener_patch_model['connection_limit'] = 2000
+ load_balancer_listener_patch_model['default_pool'] = load_balancer_pool_identity_model
+ load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model
+ load_balancer_listener_patch_model['port'] = 443
+ load_balancer_listener_patch_model['port_max'] = 499
+ load_balancer_listener_patch_model['port_min'] = 443
+ load_balancer_listener_patch_model['protocol'] = 'http'
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
id = 'testString'
- load_balancer_pool_member_patch = load_balancer_pool_member_patch_model
+ load_balancer_listener_patch = load_balancer_listener_patch_model
# Invoke method
- response = _service.update_load_balancer_pool_member(
+ response = _service.update_load_balancer_listener(
load_balancer_id,
- pool_id,
id,
- load_balancer_pool_member_patch,
+ load_balancer_listener_patch,
headers={}
)
@@ -28005,139 +25640,100 @@ def test_update_load_balancer_pool_member_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == load_balancer_pool_member_patch
+ assert req_body == load_balancer_listener_patch
- def test_update_load_balancer_pool_member_all_params_with_retries(self):
- # Enable retries and run test_update_load_balancer_pool_member_all_params.
+ def test_update_load_balancer_listener_all_params_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_all_params.
_service.enable_retries()
- self.test_update_load_balancer_pool_member_all_params()
+ self.test_update_load_balancer_listener_all_params()
- # Disable retries and run test_update_load_balancer_pool_member_all_params.
+ # Disable retries and run test_update_load_balancer_listener_all_params.
_service.disable_retries()
- self.test_update_load_balancer_pool_member_all_params()
+ self.test_update_load_balancer_listener_all_params()
@responses.activate
- def test_update_load_balancer_pool_member_value_error(self):
+ def test_update_load_balancer_listener_value_error(self):
"""
- test_update_load_balancer_pool_member_value_error()
+ test_update_load_balancer_listener_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/load_balancers/testString/pools/testString/members/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString')
+ mock_response = '{"accept_proxy_protocol": true, "certificate_instance": {"crn": "crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758"}, "connection_limit": 2000, "created_at": "2019-01-01T12:00:00.000Z", "default_pool": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "https_redirect": {"http_status_code": 301, "listener": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}, "uri": "/example?doc=get"}, "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "policies": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "port": 443, "port_max": 499, "port_min": 443, "protocol": "http", "provisioning_status": "active"}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
- load_balancer_pool_member_target_prototype_model = {}
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ # Construct a dict representation of a CertificateInstanceIdentityByCRN model
+ certificate_instance_identity_model = {}
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
- # Construct a dict representation of a LoadBalancerPoolMemberPatch model
- load_balancer_pool_member_patch_model = {}
- load_balancer_pool_member_patch_model['port'] = 80
- load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model
- load_balancer_pool_member_patch_model['weight'] = 50
+ # Construct a dict representation of a LoadBalancerPoolIdentityById model
+ load_balancer_pool_identity_model = {}
+ load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerIdentityById model
+ load_balancer_listener_identity_model = {}
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerHTTPSRedirectPatch model
+ load_balancer_listener_https_redirect_patch_model = {}
+ load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301
+ load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get'
+
+ # Construct a dict representation of a LoadBalancerListenerPatch model
+ load_balancer_listener_patch_model = {}
+ load_balancer_listener_patch_model['accept_proxy_protocol'] = True
+ load_balancer_listener_patch_model['certificate_instance'] = certificate_instance_identity_model
+ load_balancer_listener_patch_model['connection_limit'] = 2000
+ load_balancer_listener_patch_model['default_pool'] = load_balancer_pool_identity_model
+ load_balancer_listener_patch_model['https_redirect'] = load_balancer_listener_https_redirect_patch_model
+ load_balancer_listener_patch_model['port'] = 443
+ load_balancer_listener_patch_model['port_max'] = 499
+ load_balancer_listener_patch_model['port_min'] = 443
+ load_balancer_listener_patch_model['protocol'] = 'http'
# Set up parameter values
load_balancer_id = 'testString'
- pool_id = 'testString'
id = 'testString'
- load_balancer_pool_member_patch = load_balancer_pool_member_patch_model
+ load_balancer_listener_patch = load_balancer_listener_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
"load_balancer_id": load_balancer_id,
- "pool_id": pool_id,
"id": id,
- "load_balancer_pool_member_patch": load_balancer_pool_member_patch,
+ "load_balancer_listener_patch": load_balancer_listener_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_load_balancer_pool_member(**req_copy)
+ _service.update_load_balancer_listener(**req_copy)
- def test_update_load_balancer_pool_member_value_error_with_retries(self):
- # Enable retries and run test_update_load_balancer_pool_member_value_error.
+ def test_update_load_balancer_listener_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_value_error.
_service.enable_retries()
- self.test_update_load_balancer_pool_member_value_error()
+ self.test_update_load_balancer_listener_value_error()
- # Disable retries and run test_update_load_balancer_pool_member_value_error.
+ # Disable retries and run test_update_load_balancer_listener_value_error.
_service.disable_retries()
- self.test_update_load_balancer_pool_member_value_error()
-
-# endregion
-##############################################################################
-# End of Service: LoadBalancers
-##############################################################################
-
-##############################################################################
-# Start of Service: EndpointGateways
-##############################################################################
-# region
-
-class TestNewInstance():
- """
- Test Class for new_instance
- """
-
- def test_new_instance(self):
- """
- new_instance()
- """
- os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
-
- service = VpcV1.new_instance(
- version=version,
- service_name='TEST_SERVICE',
- )
-
- assert service is not None
- assert isinstance(service, VpcV1)
-
- def test_new_instance_without_authenticator(self):
- """
- new_instance_without_authenticator()
- """
- with pytest.raises(ValueError, match='authenticator must be provided'):
- service = VpcV1.new_instance(
- version=version,
- )
+ self.test_update_load_balancer_listener_value_error()
- def test_new_instance_required_param_none(self):
- """
- new_instance_required_param_none()
- """
- with pytest.raises(ValueError, match='version must be provided'):
- service = VpcV1.new_instance(
- version=None,
- )
-class TestListEndpointGateways():
+class TestListLoadBalancerListenerPolicies():
"""
- Test Class for list_endpoint_gateways
+ Test Class for list_load_balancer_listener_policies
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_endpoint_gateways_all_params(self):
+ def test_list_load_balancer_listener_policies_all_params(self):
"""
- list_endpoint_gateways()
+ list_load_balancer_listener_policies()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways')
- mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies')
+ mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -28145,164 +25741,115 @@ def test_list_endpoint_gateways_all_params(self):
status=200)
# Set up parameter values
- name = 'testString'
- start = 'testString'
- limit = 1
- resource_group_id = 'testString'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
# Invoke method
- response = _service.list_endpoint_gateways(
- name=name,
- start=start,
- limit=limit,
- resource_group_id=resource_group_id,
+ response = _service.list_load_balancer_listener_policies(
+ load_balancer_id,
+ listener_id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate query params
- query_string = responses.calls[0].request.url.split('?',1)[1]
- query_string = urllib.parse.unquote_plus(query_string)
- assert 'name={}'.format(name) in query_string
- assert 'start={}'.format(start) in query_string
- assert 'limit={}'.format(limit) in query_string
- assert 'resource_group.id={}'.format(resource_group_id) in query_string
- def test_list_endpoint_gateways_all_params_with_retries(self):
- # Enable retries and run test_list_endpoint_gateways_all_params.
+ def test_list_load_balancer_listener_policies_all_params_with_retries(self):
+ # Enable retries and run test_list_load_balancer_listener_policies_all_params.
_service.enable_retries()
- self.test_list_endpoint_gateways_all_params()
+ self.test_list_load_balancer_listener_policies_all_params()
- # Disable retries and run test_list_endpoint_gateways_all_params.
+ # Disable retries and run test_list_load_balancer_listener_policies_all_params.
_service.disable_retries()
- self.test_list_endpoint_gateways_all_params()
+ self.test_list_load_balancer_listener_policies_all_params()
@responses.activate
- def test_list_endpoint_gateways_required_params(self):
+ def test_list_load_balancer_listener_policies_value_error(self):
"""
- test_list_endpoint_gateways_required_params()
+ test_list_load_balancer_listener_policies_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways')
- mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies')
+ mock_response = '{"policies": [{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}]}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Invoke method
- response = _service.list_endpoint_gateways()
-
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- def test_list_endpoint_gateways_required_params_with_retries(self):
- # Enable retries and run test_list_endpoint_gateways_required_params.
- _service.enable_retries()
- self.test_list_endpoint_gateways_required_params()
-
- # Disable retries and run test_list_endpoint_gateways_required_params.
- _service.disable_retries()
- self.test_list_endpoint_gateways_required_params()
-
- @responses.activate
- def test_list_endpoint_gateways_value_error(self):
- """
- test_list_endpoint_gateways_value_error()
- """
- # Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways')
- mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}'
- responses.add(responses.GET,
- url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_endpoint_gateways(**req_copy)
+ _service.list_load_balancer_listener_policies(**req_copy)
- def test_list_endpoint_gateways_value_error_with_retries(self):
- # Enable retries and run test_list_endpoint_gateways_value_error.
+ def test_list_load_balancer_listener_policies_value_error_with_retries(self):
+ # Enable retries and run test_list_load_balancer_listener_policies_value_error.
_service.enable_retries()
- self.test_list_endpoint_gateways_value_error()
+ self.test_list_load_balancer_listener_policies_value_error()
- # Disable retries and run test_list_endpoint_gateways_value_error.
+ # Disable retries and run test_list_load_balancer_listener_policies_value_error.
_service.disable_retries()
- self.test_list_endpoint_gateways_value_error()
+ self.test_list_load_balancer_listener_policies_value_error()
-class TestCreateEndpointGateway():
+class TestCreateLoadBalancerListenerPolicy():
"""
- Test Class for create_endpoint_gateway
+ Test Class for create_load_balancer_listener_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_endpoint_gateway_all_params(self):
+ def test_create_load_balancer_listener_policy_all_params(self):
"""
- create_endpoint_gateway()
+ create_load_balancer_listener_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies')
+ mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model
- endpoint_gateway_target_prototype_model = {}
- endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service'
- endpoint_gateway_target_prototype_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
-
- # Construct a dict representation of a VPCIdentityById model
- vpc_identity_model = {}
- vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf'
-
- # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model
- endpoint_gateway_reserved_ip_model = {}
- endpoint_gateway_reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
+ load_balancer_listener_policy_rule_prototype_model = {}
+ load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
+ load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
+ load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
+ load_balancer_listener_policy_target_prototype_model = {}
+ load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
# Set up parameter values
- target = endpoint_gateway_target_prototype_model
- vpc = vpc_identity_model
- ips = [endpoint_gateway_reserved_ip_model]
- name = 'testString'
- resource_group = resource_group_identity_model
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ action = 'forward'
+ priority = 5
+ name = 'my-policy'
+ rules = [load_balancer_listener_policy_rule_prototype_model]
+ target = load_balancer_listener_policy_target_prototype_model
# Invoke method
- response = _service.create_endpoint_gateway(
- target,
- vpc,
- ips=ips,
+ response = _service.create_load_balancer_listener_policy(
+ load_balancer_id,
+ listener_id,
+ action,
+ priority,
name=name,
- resource_group=resource_group,
+ rules=rules,
+ target=target,
headers={}
)
@@ -28311,187 +25858,169 @@ def test_create_endpoint_gateway_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['target'] == endpoint_gateway_target_prototype_model
- assert req_body['vpc'] == vpc_identity_model
- assert req_body['ips'] == [endpoint_gateway_reserved_ip_model]
- assert req_body['name'] == 'testString'
- assert req_body['resource_group'] == resource_group_identity_model
+ assert req_body['action'] == 'forward'
+ assert req_body['priority'] == 5
+ assert req_body['name'] == 'my-policy'
+ assert req_body['rules'] == [load_balancer_listener_policy_rule_prototype_model]
+ assert req_body['target'] == load_balancer_listener_policy_target_prototype_model
- def test_create_endpoint_gateway_all_params_with_retries(self):
- # Enable retries and run test_create_endpoint_gateway_all_params.
+ def test_create_load_balancer_listener_policy_all_params_with_retries(self):
+ # Enable retries and run test_create_load_balancer_listener_policy_all_params.
_service.enable_retries()
- self.test_create_endpoint_gateway_all_params()
+ self.test_create_load_balancer_listener_policy_all_params()
- # Disable retries and run test_create_endpoint_gateway_all_params.
+ # Disable retries and run test_create_load_balancer_listener_policy_all_params.
_service.disable_retries()
- self.test_create_endpoint_gateway_all_params()
+ self.test_create_load_balancer_listener_policy_all_params()
@responses.activate
- def test_create_endpoint_gateway_value_error(self):
+ def test_create_load_balancer_listener_policy_value_error(self):
"""
- test_create_endpoint_gateway_value_error()
+ test_create_load_balancer_listener_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies')
+ mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model
- endpoint_gateway_target_prototype_model = {}
- endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service'
- endpoint_gateway_target_prototype_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
-
- # Construct a dict representation of a VPCIdentityById model
- vpc_identity_model = {}
- vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf'
-
- # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model
- endpoint_gateway_reserved_ip_model = {}
- endpoint_gateway_reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ # Construct a dict representation of a LoadBalancerListenerPolicyRulePrototype model
+ load_balancer_listener_policy_rule_prototype_model = {}
+ load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
+ load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
+ load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
+ load_balancer_listener_policy_target_prototype_model = {}
+ load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
# Set up parameter values
- target = endpoint_gateway_target_prototype_model
- vpc = vpc_identity_model
- ips = [endpoint_gateway_reserved_ip_model]
- name = 'testString'
- resource_group = resource_group_identity_model
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ action = 'forward'
+ priority = 5
+ name = 'my-policy'
+ rules = [load_balancer_listener_policy_rule_prototype_model]
+ target = load_balancer_listener_policy_target_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "target": target,
- "vpc": vpc,
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
+ "action": action,
+ "priority": priority,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_endpoint_gateway(**req_copy)
+ _service.create_load_balancer_listener_policy(**req_copy)
- def test_create_endpoint_gateway_value_error_with_retries(self):
- # Enable retries and run test_create_endpoint_gateway_value_error.
+ def test_create_load_balancer_listener_policy_value_error_with_retries(self):
+ # Enable retries and run test_create_load_balancer_listener_policy_value_error.
_service.enable_retries()
- self.test_create_endpoint_gateway_value_error()
+ self.test_create_load_balancer_listener_policy_value_error()
- # Disable retries and run test_create_endpoint_gateway_value_error.
+ # Disable retries and run test_create_load_balancer_listener_policy_value_error.
_service.disable_retries()
- self.test_create_endpoint_gateway_value_error()
+ self.test_create_load_balancer_listener_policy_value_error()
-class TestListEndpointGatewayIps():
+class TestDeleteLoadBalancerListenerPolicy():
"""
- Test Class for list_endpoint_gateway_ips
+ Test Class for delete_load_balancer_listener_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_endpoint_gateway_ips_all_params(self):
+ def test_delete_load_balancer_listener_policy_all_params(self):
"""
- list_endpoint_gateway_ips()
+ delete_load_balancer_listener_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}'
- responses.add(responses.GET,
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- endpoint_gateway_id = 'testString'
- start = 'testString'
- limit = 1
- sort = 'name'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ id = 'testString'
# Invoke method
- response = _service.list_endpoint_gateway_ips(
- endpoint_gateway_id,
- start=start,
- limit=limit,
- sort=sort,
+ response = _service.delete_load_balancer_listener_policy(
+ load_balancer_id,
+ listener_id,
+ id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 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
+ assert response.status_code == 204
- def test_list_endpoint_gateway_ips_all_params_with_retries(self):
- # Enable retries and run test_list_endpoint_gateway_ips_all_params.
+ def test_delete_load_balancer_listener_policy_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_policy_all_params.
_service.enable_retries()
- self.test_list_endpoint_gateway_ips_all_params()
+ self.test_delete_load_balancer_listener_policy_all_params()
- # Disable retries and run test_list_endpoint_gateway_ips_all_params.
+ # Disable retries and run test_delete_load_balancer_listener_policy_all_params.
_service.disable_retries()
- self.test_list_endpoint_gateway_ips_all_params()
+ self.test_delete_load_balancer_listener_policy_all_params()
@responses.activate
- def test_list_endpoint_gateway_ips_required_params(self):
+ def test_delete_load_balancer_listener_policy_value_error(self):
"""
- test_list_endpoint_gateway_ips_required_params()
+ test_delete_load_balancer_listener_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}'
- responses.add(responses.GET,
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
+ responses.add(responses.DELETE,
url,
- body=mock_response,
- content_type='application/json',
- status=200)
+ status=204)
# Set up parameter values
- endpoint_gateway_id = 'testString'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ id = 'testString'
- # Invoke method
- response = _service.list_endpoint_gateway_ips(
- endpoint_gateway_id,
- headers={}
- )
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.delete_load_balancer_listener_policy(**req_copy)
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
- def test_list_endpoint_gateway_ips_required_params_with_retries(self):
- # Enable retries and run test_list_endpoint_gateway_ips_required_params.
+ def test_delete_load_balancer_listener_policy_value_error_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_policy_value_error.
_service.enable_retries()
- self.test_list_endpoint_gateway_ips_required_params()
+ self.test_delete_load_balancer_listener_policy_value_error()
- # Disable retries and run test_list_endpoint_gateway_ips_required_params.
+ # Disable retries and run test_delete_load_balancer_listener_policy_value_error.
_service.disable_retries()
- self.test_list_endpoint_gateway_ips_required_params()
+ self.test_delete_load_balancer_listener_policy_value_error()
+
+class TestGetLoadBalancerListenerPolicy():
+ """
+ Test Class for get_load_balancer_listener_policy
+ """
@responses.activate
- def test_list_endpoint_gateway_ips_value_error(self):
+ def test_get_load_balancer_listener_policy_all_params(self):
"""
- test_list_endpoint_gateway_ips_value_error()
+ get_load_balancer_listener_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips')
- mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
+ mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -28499,137 +26028,196 @@ def test_list_endpoint_gateway_ips_value_error(self):
status=200)
# Set up parameter values
- endpoint_gateway_id = 'testString'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_load_balancer_listener_policy(
+ load_balancer_id,
+ listener_id,
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_get_load_balancer_listener_policy_all_params_with_retries(self):
+ # Enable retries and run test_get_load_balancer_listener_policy_all_params.
+ _service.enable_retries()
+ self.test_get_load_balancer_listener_policy_all_params()
+
+ # Disable retries and run test_get_load_balancer_listener_policy_all_params.
+ _service.disable_retries()
+ self.test_get_load_balancer_listener_policy_all_params()
+
+ @responses.activate
+ def test_get_load_balancer_listener_policy_value_error(self):
+ """
+ test_get_load_balancer_listener_policy_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
+ mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "endpoint_gateway_id": endpoint_gateway_id,
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
+ "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_endpoint_gateway_ips(**req_copy)
+ _service.get_load_balancer_listener_policy(**req_copy)
- def test_list_endpoint_gateway_ips_value_error_with_retries(self):
- # Enable retries and run test_list_endpoint_gateway_ips_value_error.
+ def test_get_load_balancer_listener_policy_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_listener_policy_value_error.
_service.enable_retries()
- self.test_list_endpoint_gateway_ips_value_error()
+ self.test_get_load_balancer_listener_policy_value_error()
- # Disable retries and run test_list_endpoint_gateway_ips_value_error.
+ # Disable retries and run test_get_load_balancer_listener_policy_value_error.
_service.disable_retries()
- self.test_list_endpoint_gateway_ips_value_error()
+ self.test_get_load_balancer_listener_policy_value_error()
-class TestRemoveEndpointGatewayIp():
+class TestUpdateLoadBalancerListenerPolicy():
"""
- Test Class for remove_endpoint_gateway_ip
+ Test Class for update_load_balancer_listener_policy
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_remove_endpoint_gateway_ip_all_params(self):
+ def test_update_load_balancer_listener_policy_all_params(self):
"""
- remove_endpoint_gateway_ip()
+ update_load_balancer_listener_policy()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
+ mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
+ responses.add(responses.PATCH,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
+ load_balancer_listener_policy_target_patch_model = {}
+ load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyPatch model
+ load_balancer_listener_policy_patch_model = {}
+ load_balancer_listener_policy_patch_model['name'] = 'my-policy'
+ load_balancer_listener_policy_patch_model['priority'] = 5
+ load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model
# Set up parameter values
- endpoint_gateway_id = 'testString'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
id = 'testString'
+ load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model
# Invoke method
- response = _service.remove_endpoint_gateway_ip(
- endpoint_gateway_id,
+ response = _service.update_load_balancer_listener_policy(
+ load_balancer_id,
+ listener_id,
id,
+ load_balancer_listener_policy_patch,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
- assert response.status_code == 204
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == load_balancer_listener_policy_patch
- def test_remove_endpoint_gateway_ip_all_params_with_retries(self):
- # Enable retries and run test_remove_endpoint_gateway_ip_all_params.
+ def test_update_load_balancer_listener_policy_all_params_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_policy_all_params.
_service.enable_retries()
- self.test_remove_endpoint_gateway_ip_all_params()
+ self.test_update_load_balancer_listener_policy_all_params()
- # Disable retries and run test_remove_endpoint_gateway_ip_all_params.
+ # Disable retries and run test_update_load_balancer_listener_policy_all_params.
_service.disable_retries()
- self.test_remove_endpoint_gateway_ip_all_params()
+ self.test_update_load_balancer_listener_policy_all_params()
@responses.activate
- def test_remove_endpoint_gateway_ip_value_error(self):
+ def test_update_load_balancer_listener_policy_value_error(self):
"""
- test_remove_endpoint_gateway_ip_value_error()
+ test_update_load_balancer_listener_policy_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString')
- responses.add(responses.DELETE,
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString')
+ mock_response = '{"action": "forward", "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-policy", "priority": 5, "provisioning_status": "active", "rules": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "target": {"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "name": "my-load-balancer-pool"}}'
+ responses.add(responses.PATCH,
url,
- status=204)
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById model
+ load_balancer_listener_policy_target_patch_model = {}
+ load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a dict representation of a LoadBalancerListenerPolicyPatch model
+ load_balancer_listener_policy_patch_model = {}
+ load_balancer_listener_policy_patch_model['name'] = 'my-policy'
+ load_balancer_listener_policy_patch_model['priority'] = 5
+ load_balancer_listener_policy_patch_model['target'] = load_balancer_listener_policy_target_patch_model
# Set up parameter values
- endpoint_gateway_id = 'testString'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
id = 'testString'
+ load_balancer_listener_policy_patch = load_balancer_listener_policy_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "endpoint_gateway_id": endpoint_gateway_id,
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
"id": id,
+ "load_balancer_listener_policy_patch": load_balancer_listener_policy_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.remove_endpoint_gateway_ip(**req_copy)
+ _service.update_load_balancer_listener_policy(**req_copy)
- def test_remove_endpoint_gateway_ip_value_error_with_retries(self):
- # Enable retries and run test_remove_endpoint_gateway_ip_value_error.
+ def test_update_load_balancer_listener_policy_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_policy_value_error.
_service.enable_retries()
- self.test_remove_endpoint_gateway_ip_value_error()
+ self.test_update_load_balancer_listener_policy_value_error()
- # Disable retries and run test_remove_endpoint_gateway_ip_value_error.
+ # Disable retries and run test_update_load_balancer_listener_policy_value_error.
_service.disable_retries()
- self.test_remove_endpoint_gateway_ip_value_error()
+ self.test_update_load_balancer_listener_policy_value_error()
-class TestGetEndpointGatewayIp():
+class TestListLoadBalancerListenerPolicyRules():
"""
- Test Class for get_endpoint_gateway_ip
+ Test Class for list_load_balancer_listener_policy_rules
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_endpoint_gateway_ip_all_params(self):
+ def test_list_load_balancer_listener_policy_rules_all_params(self):
"""
- get_endpoint_gateway_ip()
+ list_load_balancer_listener_policy_rules()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString')
- mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules')
+ mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -28637,13 +26225,15 @@ def test_get_endpoint_gateway_ip_all_params(self):
status=200)
# Set up parameter values
- endpoint_gateway_id = 'testString'
- id = 'testString'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
# Invoke method
- response = _service.get_endpoint_gateway_ip(
- endpoint_gateway_id,
- id,
+ response = _service.list_load_balancer_listener_policy_rules(
+ load_balancer_id,
+ listener_id,
+ policy_id,
headers={}
)
@@ -28651,23 +26241,23 @@ def test_get_endpoint_gateway_ip_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_endpoint_gateway_ip_all_params_with_retries(self):
- # Enable retries and run test_get_endpoint_gateway_ip_all_params.
+ def test_list_load_balancer_listener_policy_rules_all_params_with_retries(self):
+ # Enable retries and run test_list_load_balancer_listener_policy_rules_all_params.
_service.enable_retries()
- self.test_get_endpoint_gateway_ip_all_params()
+ self.test_list_load_balancer_listener_policy_rules_all_params()
- # Disable retries and run test_get_endpoint_gateway_ip_all_params.
+ # Disable retries and run test_list_load_balancer_listener_policy_rules_all_params.
_service.disable_retries()
- self.test_get_endpoint_gateway_ip_all_params()
+ self.test_list_load_balancer_listener_policy_rules_all_params()
@responses.activate
- def test_get_endpoint_gateway_ip_value_error(self):
+ def test_list_load_balancer_listener_policy_rules_value_error(self):
"""
- test_get_endpoint_gateway_ip_value_error()
+ test_list_load_balancer_listener_policy_rules_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString')
- mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules')
+ mock_response = '{"rules": [{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -28675,153 +26265,164 @@ def test_get_endpoint_gateway_ip_value_error(self):
status=200)
# Set up parameter values
- endpoint_gateway_id = 'testString'
- id = 'testString'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "endpoint_gateway_id": endpoint_gateway_id,
- "id": id,
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
+ "policy_id": policy_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_endpoint_gateway_ip(**req_copy)
+ _service.list_load_balancer_listener_policy_rules(**req_copy)
- def test_get_endpoint_gateway_ip_value_error_with_retries(self):
- # Enable retries and run test_get_endpoint_gateway_ip_value_error.
+ def test_list_load_balancer_listener_policy_rules_value_error_with_retries(self):
+ # Enable retries and run test_list_load_balancer_listener_policy_rules_value_error.
_service.enable_retries()
- self.test_get_endpoint_gateway_ip_value_error()
+ self.test_list_load_balancer_listener_policy_rules_value_error()
- # Disable retries and run test_get_endpoint_gateway_ip_value_error.
+ # Disable retries and run test_list_load_balancer_listener_policy_rules_value_error.
_service.disable_retries()
- self.test_get_endpoint_gateway_ip_value_error()
+ self.test_list_load_balancer_listener_policy_rules_value_error()
-class TestAddEndpointGatewayIp():
+class TestCreateLoadBalancerListenerPolicyRule():
"""
- Test Class for add_endpoint_gateway_ip
+ Test Class for create_load_balancer_listener_policy_rule
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_add_endpoint_gateway_ip_all_params(self):
+ def test_create_load_balancer_listener_policy_rule_all_params(self):
"""
- add_endpoint_gateway_ip()
+ create_load_balancer_listener_policy_rule()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString')
- mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
- responses.add(responses.PUT,
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules')
+ mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
# Set up parameter values
- endpoint_gateway_id = 'testString'
- id = 'testString'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
+ condition = 'contains'
+ type = 'body'
+ value = 'testString'
+ field = 'MY-APP-HEADER'
# Invoke method
- response = _service.add_endpoint_gateway_ip(
- endpoint_gateway_id,
- id,
+ response = _service.create_load_balancer_listener_policy_rule(
+ load_balancer_id,
+ listener_id,
+ policy_id,
+ condition,
+ type,
+ value,
+ field=field,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 201
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['condition'] == 'contains'
+ assert req_body['type'] == 'body'
+ assert req_body['value'] == 'testString'
+ assert req_body['field'] == 'MY-APP-HEADER'
- def test_add_endpoint_gateway_ip_all_params_with_retries(self):
- # Enable retries and run test_add_endpoint_gateway_ip_all_params.
+ def test_create_load_balancer_listener_policy_rule_all_params_with_retries(self):
+ # Enable retries and run test_create_load_balancer_listener_policy_rule_all_params.
_service.enable_retries()
- self.test_add_endpoint_gateway_ip_all_params()
+ self.test_create_load_balancer_listener_policy_rule_all_params()
- # Disable retries and run test_add_endpoint_gateway_ip_all_params.
+ # Disable retries and run test_create_load_balancer_listener_policy_rule_all_params.
_service.disable_retries()
- self.test_add_endpoint_gateway_ip_all_params()
+ self.test_create_load_balancer_listener_policy_rule_all_params()
@responses.activate
- def test_add_endpoint_gateway_ip_value_error(self):
+ def test_create_load_balancer_listener_policy_rule_value_error(self):
"""
- test_add_endpoint_gateway_ip_value_error()
+ test_create_load_balancer_listener_policy_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString/ips/testString')
- mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
- responses.add(responses.PUT,
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules')
+ mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
+ responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
# Set up parameter values
- endpoint_gateway_id = 'testString'
- id = 'testString'
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
+ condition = 'contains'
+ type = 'body'
+ value = 'testString'
+ field = 'MY-APP-HEADER'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "endpoint_gateway_id": endpoint_gateway_id,
- "id": id,
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
+ "policy_id": policy_id,
+ "condition": condition,
+ "type": type,
+ "value": value,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.add_endpoint_gateway_ip(**req_copy)
+ _service.create_load_balancer_listener_policy_rule(**req_copy)
- def test_add_endpoint_gateway_ip_value_error_with_retries(self):
- # Enable retries and run test_add_endpoint_gateway_ip_value_error.
+ def test_create_load_balancer_listener_policy_rule_value_error_with_retries(self):
+ # Enable retries and run test_create_load_balancer_listener_policy_rule_value_error.
_service.enable_retries()
- self.test_add_endpoint_gateway_ip_value_error()
+ self.test_create_load_balancer_listener_policy_rule_value_error()
- # Disable retries and run test_add_endpoint_gateway_ip_value_error.
+ # Disable retries and run test_create_load_balancer_listener_policy_rule_value_error.
_service.disable_retries()
- self.test_add_endpoint_gateway_ip_value_error()
+ self.test_create_load_balancer_listener_policy_rule_value_error()
-class TestDeleteEndpointGateway():
+class TestDeleteLoadBalancerListenerPolicyRule():
"""
- Test Class for delete_endpoint_gateway
+ Test Class for delete_load_balancer_listener_policy_rule
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_endpoint_gateway_all_params(self):
+ def test_delete_load_balancer_listener_policy_rule_all_params(self):
"""
- delete_endpoint_gateway()
+ delete_load_balancer_listener_policy_rule()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString')
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_endpoint_gateway(
+ response = _service.delete_load_balancer_listener_policy_rule(
+ load_balancer_id,
+ listener_id,
+ policy_id,
id,
headers={}
)
@@ -28830,72 +26431,67 @@ def test_delete_endpoint_gateway_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_endpoint_gateway_all_params_with_retries(self):
- # Enable retries and run test_delete_endpoint_gateway_all_params.
+ def test_delete_load_balancer_listener_policy_rule_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_policy_rule_all_params.
_service.enable_retries()
- self.test_delete_endpoint_gateway_all_params()
+ self.test_delete_load_balancer_listener_policy_rule_all_params()
- # Disable retries and run test_delete_endpoint_gateway_all_params.
+ # Disable retries and run test_delete_load_balancer_listener_policy_rule_all_params.
_service.disable_retries()
- self.test_delete_endpoint_gateway_all_params()
+ self.test_delete_load_balancer_listener_policy_rule_all_params()
@responses.activate
- def test_delete_endpoint_gateway_value_error(self):
+ def test_delete_load_balancer_listener_policy_rule_value_error(self):
"""
- test_delete_endpoint_gateway_value_error()
+ test_delete_load_balancer_listener_policy_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString')
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
+ "policy_id": policy_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_endpoint_gateway(**req_copy)
+ _service.delete_load_balancer_listener_policy_rule(**req_copy)
- def test_delete_endpoint_gateway_value_error_with_retries(self):
- # Enable retries and run test_delete_endpoint_gateway_value_error.
+ def test_delete_load_balancer_listener_policy_rule_value_error_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_listener_policy_rule_value_error.
_service.enable_retries()
- self.test_delete_endpoint_gateway_value_error()
+ self.test_delete_load_balancer_listener_policy_rule_value_error()
- # Disable retries and run test_delete_endpoint_gateway_value_error.
+ # Disable retries and run test_delete_load_balancer_listener_policy_rule_value_error.
_service.disable_retries()
- self.test_delete_endpoint_gateway_value_error()
+ self.test_delete_load_balancer_listener_policy_rule_value_error()
-class TestGetEndpointGateway():
+class TestGetLoadBalancerListenerPolicyRule():
"""
- Test Class for get_endpoint_gateway
+ Test Class for get_load_balancer_listener_policy_rule
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_endpoint_gateway_all_params(self):
+ def test_get_load_balancer_listener_policy_rule_all_params(self):
"""
- get_endpoint_gateway()
+ get_load_balancer_listener_policy_rule()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
+ mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -28903,10 +26499,16 @@ def test_get_endpoint_gateway_all_params(self):
status=200)
# Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_endpoint_gateway(
+ response = _service.get_load_balancer_listener_policy_rule(
+ load_balancer_id,
+ listener_id,
+ policy_id,
id,
headers={}
)
@@ -28915,23 +26517,23 @@ def test_get_endpoint_gateway_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_endpoint_gateway_all_params_with_retries(self):
- # Enable retries and run test_get_endpoint_gateway_all_params.
+ def test_get_load_balancer_listener_policy_rule_all_params_with_retries(self):
+ # Enable retries and run test_get_load_balancer_listener_policy_rule_all_params.
_service.enable_retries()
- self.test_get_endpoint_gateway_all_params()
+ self.test_get_load_balancer_listener_policy_rule_all_params()
- # Disable retries and run test_get_endpoint_gateway_all_params.
+ # Disable retries and run test_get_load_balancer_listener_policy_rule_all_params.
_service.disable_retries()
- self.test_get_endpoint_gateway_all_params()
+ self.test_get_load_balancer_listener_policy_rule_all_params()
@responses.activate
- def test_get_endpoint_gateway_value_error(self):
+ def test_get_load_balancer_listener_policy_rule_value_error(self):
"""
- test_get_endpoint_gateway_value_error()
+ test_get_load_balancer_listener_policy_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
+ mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -28939,69 +26541,73 @@ def test_get_endpoint_gateway_value_error(self):
status=200)
# Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
+ "policy_id": policy_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_endpoint_gateway(**req_copy)
+ _service.get_load_balancer_listener_policy_rule(**req_copy)
- def test_get_endpoint_gateway_value_error_with_retries(self):
- # Enable retries and run test_get_endpoint_gateway_value_error.
+ def test_get_load_balancer_listener_policy_rule_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_listener_policy_rule_value_error.
_service.enable_retries()
- self.test_get_endpoint_gateway_value_error()
+ self.test_get_load_balancer_listener_policy_rule_value_error()
- # Disable retries and run test_get_endpoint_gateway_value_error.
+ # Disable retries and run test_get_load_balancer_listener_policy_rule_value_error.
_service.disable_retries()
- self.test_get_endpoint_gateway_value_error()
+ self.test_get_load_balancer_listener_policy_rule_value_error()
-class TestUpdateEndpointGateway():
+class TestUpdateLoadBalancerListenerPolicyRule():
"""
- Test Class for update_endpoint_gateway
+ Test Class for update_load_balancer_listener_policy_rule
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_endpoint_gateway_all_params(self):
+ def test_update_load_balancer_listener_policy_rule_all_params(self):
"""
- update_endpoint_gateway()
+ update_load_balancer_listener_policy_rule()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
+ mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a EndpointGatewayPatch model
- endpoint_gateway_patch_model = {}
- endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway'
+ # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model
+ load_balancer_listener_policy_rule_patch_model = {}
+ load_balancer_listener_policy_rule_patch_model['condition'] = 'contains'
+ load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_patch_model['type'] = 'body'
+ load_balancer_listener_policy_rule_patch_model['value'] = 'testString'
# Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
id = 'testString'
- endpoint_gateway_patch = endpoint_gateway_patch_model
+ load_balancer_listener_policy_rule_patch = load_balancer_listener_policy_rule_patch_model
# Invoke method
- response = _service.update_endpoint_gateway(
+ response = _service.update_load_balancer_listener_policy_rule(
+ load_balancer_id,
+ listener_id,
+ policy_id,
id,
- endpoint_gateway_patch,
+ load_balancer_listener_policy_rule_patch,
headers={}
)
@@ -29010,129 +26616,81 @@ def test_update_endpoint_gateway_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == endpoint_gateway_patch
+ assert req_body == load_balancer_listener_policy_rule_patch
- def test_update_endpoint_gateway_all_params_with_retries(self):
- # Enable retries and run test_update_endpoint_gateway_all_params.
+ def test_update_load_balancer_listener_policy_rule_all_params_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_policy_rule_all_params.
_service.enable_retries()
- self.test_update_endpoint_gateway_all_params()
+ self.test_update_load_balancer_listener_policy_rule_all_params()
- # Disable retries and run test_update_endpoint_gateway_all_params.
+ # Disable retries and run test_update_load_balancer_listener_policy_rule_all_params.
_service.disable_retries()
- self.test_update_endpoint_gateway_all_params()
+ self.test_update_load_balancer_listener_policy_rule_all_params()
@responses.activate
- def test_update_endpoint_gateway_value_error(self):
+ def test_update_load_balancer_listener_policy_rule_value_error(self):
"""
- test_update_endpoint_gateway_value_error()
+ test_update_load_balancer_listener_policy_rule_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/endpoint_gateways/testString')
- mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ url = preprocess_url('/load_balancers/testString/listeners/testString/policies/testString/rules/testString')
+ mock_response = '{"condition": "contains", "created_at": "2019-01-01T12:00:00.000Z", "field": "MY-APP-HEADER", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "provisioning_status": "active", "type": "body", "value": "value"}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a EndpointGatewayPatch model
- endpoint_gateway_patch_model = {}
- endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway'
+ # Construct a dict representation of a LoadBalancerListenerPolicyRulePatch model
+ load_balancer_listener_policy_rule_patch_model = {}
+ load_balancer_listener_policy_rule_patch_model['condition'] = 'contains'
+ load_balancer_listener_policy_rule_patch_model['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_patch_model['type'] = 'body'
+ load_balancer_listener_policy_rule_patch_model['value'] = 'testString'
# Set up parameter values
+ load_balancer_id = 'testString'
+ listener_id = 'testString'
+ policy_id = 'testString'
id = 'testString'
- endpoint_gateway_patch = endpoint_gateway_patch_model
+ load_balancer_listener_policy_rule_patch = load_balancer_listener_policy_rule_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "listener_id": listener_id,
+ "policy_id": policy_id,
"id": id,
- "endpoint_gateway_patch": endpoint_gateway_patch,
+ "load_balancer_listener_policy_rule_patch": load_balancer_listener_policy_rule_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_endpoint_gateway(**req_copy)
+ _service.update_load_balancer_listener_policy_rule(**req_copy)
- def test_update_endpoint_gateway_value_error_with_retries(self):
- # Enable retries and run test_update_endpoint_gateway_value_error.
+ def test_update_load_balancer_listener_policy_rule_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_listener_policy_rule_value_error.
_service.enable_retries()
- self.test_update_endpoint_gateway_value_error()
+ self.test_update_load_balancer_listener_policy_rule_value_error()
- # Disable retries and run test_update_endpoint_gateway_value_error.
+ # Disable retries and run test_update_load_balancer_listener_policy_rule_value_error.
_service.disable_retries()
- self.test_update_endpoint_gateway_value_error()
+ self.test_update_load_balancer_listener_policy_rule_value_error()
-# endregion
-##############################################################################
-# End of Service: EndpointGateways
-##############################################################################
-
-##############################################################################
-# Start of Service: FlowLogCollectors
-##############################################################################
-# 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,
- )
-
- def test_new_instance_required_param_none(self):
- """
- new_instance_required_param_none()
- """
- with pytest.raises(ValueError, match='version must be provided'):
- service = VpcV1.new_instance(
- version=None,
- )
-class TestListFlowLogCollectors():
+class TestListLoadBalancerPools():
"""
- Test Class for list_flow_log_collectors
+ Test Class for list_load_balancer_pools
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_list_flow_log_collectors_all_params(self):
+ def test_list_load_balancer_pools_all_params(self):
"""
- list_flow_log_collectors()
+ list_load_balancer_pools()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/load_balancers/testString/pools')
+ mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -29140,174 +26698,126 @@ def test_list_flow_log_collectors_all_params(self):
status=200)
# Set up parameter values
- start = 'testString'
- limit = 1
- resource_group_id = 'testString'
- name = 'testString'
- vpc_id = 'testString'
- vpc_crn = 'testString'
- vpc_name = 'testString'
- target_id = 'testString'
- target_resource_type = 'instance'
+ load_balancer_id = 'testString'
# Invoke method
- response = _service.list_flow_log_collectors(
- start=start,
- limit=limit,
- resource_group_id=resource_group_id,
- name=name,
- vpc_id=vpc_id,
- vpc_crn=vpc_crn,
- vpc_name=vpc_name,
- target_id=target_id,
- target_resource_type=target_resource_type,
+ response = _service.list_load_balancer_pools(
+ load_balancer_id,
headers={}
)
# Check for correct operation
assert len(responses.calls) == 1
assert response.status_code == 200
- # Validate query params
- query_string = responses.calls[0].request.url.split('?',1)[1]
- query_string = urllib.parse.unquote_plus(query_string)
- assert 'start={}'.format(start) in query_string
- assert 'limit={}'.format(limit) in query_string
- assert 'resource_group.id={}'.format(resource_group_id) in query_string
- assert 'name={}'.format(name) in query_string
- assert 'vpc.id={}'.format(vpc_id) in query_string
- assert 'vpc.crn={}'.format(vpc_crn) in query_string
- assert 'vpc.name={}'.format(vpc_name) in query_string
- assert 'target.id={}'.format(target_id) in query_string
- assert 'target.resource_type={}'.format(target_resource_type) in query_string
- def test_list_flow_log_collectors_all_params_with_retries(self):
- # Enable retries and run test_list_flow_log_collectors_all_params.
+ def test_list_load_balancer_pools_all_params_with_retries(self):
+ # Enable retries and run test_list_load_balancer_pools_all_params.
_service.enable_retries()
- self.test_list_flow_log_collectors_all_params()
+ self.test_list_load_balancer_pools_all_params()
- # Disable retries and run test_list_flow_log_collectors_all_params.
+ # Disable retries and run test_list_load_balancer_pools_all_params.
_service.disable_retries()
- self.test_list_flow_log_collectors_all_params()
+ self.test_list_load_balancer_pools_all_params()
@responses.activate
- def test_list_flow_log_collectors_required_params(self):
+ def test_list_load_balancer_pools_value_error(self):
"""
- test_list_flow_log_collectors_required_params()
+ test_list_load_balancer_pools_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20"}, "total_count": 132}'
+ url = preprocess_url('/load_balancers/testString/pools')
+ mock_response = '{"pools": [{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}]}'
responses.add(responses.GET,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Invoke method
- response = _service.list_flow_log_collectors()
-
-
- # Check for correct operation
- assert len(responses.calls) == 1
- assert response.status_code == 200
-
- def test_list_flow_log_collectors_required_params_with_retries(self):
- # Enable retries and run test_list_flow_log_collectors_required_params.
- _service.enable_retries()
- self.test_list_flow_log_collectors_required_params()
-
- # Disable retries and run test_list_flow_log_collectors_required_params.
- _service.disable_retries()
- self.test_list_flow_log_collectors_required_params()
-
- @responses.activate
- def test_list_flow_log_collectors_value_error(self):
- """
- test_list_flow_log_collectors_value_error()
- """
- # Set up mock
- url = self.preprocess_url(_base_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"}}], "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,
- body=mock_response,
- content_type='application/json',
- status=200)
+ # Set up parameter values
+ load_balancer_id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "load_balancer_id": load_balancer_id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.list_flow_log_collectors(**req_copy)
+ _service.list_load_balancer_pools(**req_copy)
- def test_list_flow_log_collectors_value_error_with_retries(self):
- # Enable retries and run test_list_flow_log_collectors_value_error.
+ def test_list_load_balancer_pools_value_error_with_retries(self):
+ # Enable retries and run test_list_load_balancer_pools_value_error.
_service.enable_retries()
- self.test_list_flow_log_collectors_value_error()
+ self.test_list_load_balancer_pools_value_error()
- # Disable retries and run test_list_flow_log_collectors_value_error.
+ # Disable retries and run test_list_load_balancer_pools_value_error.
_service.disable_retries()
- self.test_list_flow_log_collectors_value_error()
+ self.test_list_load_balancer_pools_value_error()
-class TestCreateFlowLogCollector():
+class TestCreateLoadBalancerPool():
"""
- Test Class for create_flow_log_collector
+ Test Class for create_load_balancer_pool
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_create_flow_log_collector_all_params(self):
+ def test_create_load_balancer_pool_all_params(self):
"""
- create_flow_log_collector()
+ create_load_balancer_pool()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}}'
+ url = preprocess_url('/load_balancers/testString/pools')
+ mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a CloudObjectStorageBucketIdentityByName model
- cloud_object_storage_bucket_identity_model = {}
- cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue'
+ # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model
+ load_balancer_pool_health_monitor_prototype_model = {}
+ load_balancer_pool_health_monitor_prototype_model['delay'] = 5
+ load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2
+ load_balancer_pool_health_monitor_prototype_model['port'] = 22
+ load_balancer_pool_health_monitor_prototype_model['timeout'] = 2
+ load_balancer_pool_health_monitor_prototype_model['type'] = 'http'
+ load_balancer_pool_health_monitor_prototype_model['url_path'] = '/'
- # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById model
- flow_log_collector_target_prototype_model = {}
- flow_log_collector_target_prototype_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
+ load_balancer_pool_member_target_prototype_model = {}
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
+ load_balancer_pool_member_prototype_model = {}
+ load_balancer_pool_member_prototype_model['port'] = 80
+ load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
+ load_balancer_pool_member_prototype_model['weight'] = 50
+
+ # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model
+ load_balancer_pool_session_persistence_prototype_model = {}
+ load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie'
# Set up parameter values
- storage_bucket = cloud_object_storage_bucket_identity_model
- target = flow_log_collector_target_prototype_model
- active = False
- name = 'my-flow-log-collector'
- resource_group = resource_group_identity_model
+ load_balancer_id = 'testString'
+ algorithm = 'least_connections'
+ health_monitor = load_balancer_pool_health_monitor_prototype_model
+ protocol = 'http'
+ members = [load_balancer_pool_member_prototype_model]
+ name = 'my-load-balancer-pool'
+ proxy_protocol = 'disabled'
+ session_persistence = load_balancer_pool_session_persistence_prototype_model
# Invoke method
- response = _service.create_flow_log_collector(
- storage_bucket,
- target,
- active=active,
+ response = _service.create_load_balancer_pool(
+ load_balancer_id,
+ algorithm,
+ health_monitor,
+ protocol,
+ members=members,
name=name,
- resource_group=resource_group,
+ proxy_protocol=proxy_protocol,
+ session_persistence=session_persistence,
headers={}
)
@@ -29316,106 +26826,116 @@ def test_create_flow_log_collector_all_params(self):
assert response.status_code == 201
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body['storage_bucket'] == cloud_object_storage_bucket_identity_model
- assert req_body['target'] == flow_log_collector_target_prototype_model
- assert req_body['active'] == False
- assert req_body['name'] == 'my-flow-log-collector'
- assert req_body['resource_group'] == resource_group_identity_model
+ assert req_body['algorithm'] == 'least_connections'
+ assert req_body['health_monitor'] == load_balancer_pool_health_monitor_prototype_model
+ assert req_body['protocol'] == 'http'
+ assert req_body['members'] == [load_balancer_pool_member_prototype_model]
+ assert req_body['name'] == 'my-load-balancer-pool'
+ assert req_body['proxy_protocol'] == 'disabled'
+ assert req_body['session_persistence'] == load_balancer_pool_session_persistence_prototype_model
- def test_create_flow_log_collector_all_params_with_retries(self):
- # Enable retries and run test_create_flow_log_collector_all_params.
+ def test_create_load_balancer_pool_all_params_with_retries(self):
+ # Enable retries and run test_create_load_balancer_pool_all_params.
_service.enable_retries()
- self.test_create_flow_log_collector_all_params()
+ self.test_create_load_balancer_pool_all_params()
- # Disable retries and run test_create_flow_log_collector_all_params.
+ # Disable retries and run test_create_load_balancer_pool_all_params.
_service.disable_retries()
- self.test_create_flow_log_collector_all_params()
+ self.test_create_load_balancer_pool_all_params()
@responses.activate
- def test_create_flow_log_collector_value_error(self):
+ def test_create_load_balancer_pool_value_error(self):
"""
- test_create_flow_log_collector_value_error()
+ test_create_load_balancer_pool_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}}'
+ url = preprocess_url('/load_balancers/testString/pools')
+ mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
responses.add(responses.POST,
url,
body=mock_response,
content_type='application/json',
status=201)
- # Construct a dict representation of a CloudObjectStorageBucketIdentityByName model
- cloud_object_storage_bucket_identity_model = {}
- cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue'
+ # Construct a dict representation of a LoadBalancerPoolHealthMonitorPrototype model
+ load_balancer_pool_health_monitor_prototype_model = {}
+ load_balancer_pool_health_monitor_prototype_model['delay'] = 5
+ load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2
+ load_balancer_pool_health_monitor_prototype_model['port'] = 22
+ load_balancer_pool_health_monitor_prototype_model['timeout'] = 2
+ load_balancer_pool_health_monitor_prototype_model['type'] = 'http'
+ load_balancer_pool_health_monitor_prototype_model['url_path'] = '/'
- # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById model
- flow_log_collector_target_prototype_model = {}
- flow_log_collector_target_prototype_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
+ load_balancer_pool_member_target_prototype_model = {}
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a dict representation of a ResourceGroupIdentityById model
- resource_group_identity_model = {}
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
+ load_balancer_pool_member_prototype_model = {}
+ load_balancer_pool_member_prototype_model['port'] = 80
+ load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
+ load_balancer_pool_member_prototype_model['weight'] = 50
+
+ # Construct a dict representation of a LoadBalancerPoolSessionPersistencePrototype model
+ load_balancer_pool_session_persistence_prototype_model = {}
+ load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie'
# Set up parameter values
- storage_bucket = cloud_object_storage_bucket_identity_model
- target = flow_log_collector_target_prototype_model
- active = False
- name = 'my-flow-log-collector'
- resource_group = resource_group_identity_model
+ load_balancer_id = 'testString'
+ algorithm = 'least_connections'
+ health_monitor = load_balancer_pool_health_monitor_prototype_model
+ protocol = 'http'
+ members = [load_balancer_pool_member_prototype_model]
+ name = 'my-load-balancer-pool'
+ proxy_protocol = 'disabled'
+ session_persistence = load_balancer_pool_session_persistence_prototype_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
- "storage_bucket": storage_bucket,
- "target": target,
+ "load_balancer_id": load_balancer_id,
+ "algorithm": algorithm,
+ "health_monitor": health_monitor,
+ "protocol": protocol,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.create_flow_log_collector(**req_copy)
+ _service.create_load_balancer_pool(**req_copy)
- def test_create_flow_log_collector_value_error_with_retries(self):
- # Enable retries and run test_create_flow_log_collector_value_error.
+ def test_create_load_balancer_pool_value_error_with_retries(self):
+ # Enable retries and run test_create_load_balancer_pool_value_error.
_service.enable_retries()
- self.test_create_flow_log_collector_value_error()
+ self.test_create_load_balancer_pool_value_error()
- # Disable retries and run test_create_flow_log_collector_value_error.
+ # Disable retries and run test_create_load_balancer_pool_value_error.
_service.disable_retries()
- self.test_create_flow_log_collector_value_error()
+ self.test_create_load_balancer_pool_value_error()
-class TestDeleteFlowLogCollector():
+class TestDeleteLoadBalancerPool():
"""
- Test Class for delete_flow_log_collector
+ Test Class for delete_load_balancer_pool
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_delete_flow_log_collector_all_params(self):
+ def test_delete_load_balancer_pool_all_params(self):
"""
- delete_flow_log_collector()
+ delete_load_balancer_pool()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/flow_log_collectors/testString')
+ url = preprocess_url('/load_balancers/testString/pools/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
+ load_balancer_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.delete_flow_log_collector(
+ response = _service.delete_load_balancer_pool(
+ load_balancer_id,
id,
headers={}
)
@@ -29424,72 +26944,63 @@ def test_delete_flow_log_collector_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 204
- def test_delete_flow_log_collector_all_params_with_retries(self):
- # Enable retries and run test_delete_flow_log_collector_all_params.
+ def test_delete_load_balancer_pool_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_pool_all_params.
_service.enable_retries()
- self.test_delete_flow_log_collector_all_params()
+ self.test_delete_load_balancer_pool_all_params()
- # Disable retries and run test_delete_flow_log_collector_all_params.
+ # Disable retries and run test_delete_load_balancer_pool_all_params.
_service.disable_retries()
- self.test_delete_flow_log_collector_all_params()
+ self.test_delete_load_balancer_pool_all_params()
@responses.activate
- def test_delete_flow_log_collector_value_error(self):
+ def test_delete_load_balancer_pool_value_error(self):
"""
- test_delete_flow_log_collector_value_error()
+ test_delete_load_balancer_pool_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_url + '/flow_log_collectors/testString')
+ url = preprocess_url('/load_balancers/testString/pools/testString')
responses.add(responses.DELETE,
url,
status=204)
# Set up parameter values
+ load_balancer_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "load_balancer_id": load_balancer_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.delete_flow_log_collector(**req_copy)
+ _service.delete_load_balancer_pool(**req_copy)
- def test_delete_flow_log_collector_value_error_with_retries(self):
- # Enable retries and run test_delete_flow_log_collector_value_error.
+ def test_delete_load_balancer_pool_value_error_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_pool_value_error.
_service.enable_retries()
- self.test_delete_flow_log_collector_value_error()
+ self.test_delete_load_balancer_pool_value_error()
- # Disable retries and run test_delete_flow_log_collector_value_error.
+ # Disable retries and run test_delete_load_balancer_pool_value_error.
_service.disable_retries()
- self.test_delete_flow_log_collector_value_error()
+ self.test_delete_load_balancer_pool_value_error()
-class TestGetFlowLogCollector():
+class TestGetLoadBalancerPool():
"""
- Test Class for get_flow_log_collector
+ Test Class for get_load_balancer_pool
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_get_flow_log_collector_all_params(self):
+ def test_get_load_balancer_pool_all_params(self):
"""
- get_flow_log_collector()
+ get_load_balancer_pool()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}}'
+ url = preprocess_url('/load_balancers/testString/pools/testString')
+ mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -29497,10 +27008,12 @@ def test_get_flow_log_collector_all_params(self):
status=200)
# Set up parameter values
+ load_balancer_id = 'testString'
id = 'testString'
# Invoke method
- response = _service.get_flow_log_collector(
+ response = _service.get_load_balancer_pool(
+ load_balancer_id,
id,
headers={}
)
@@ -29509,23 +27022,23 @@ def test_get_flow_log_collector_all_params(self):
assert len(responses.calls) == 1
assert response.status_code == 200
- def test_get_flow_log_collector_all_params_with_retries(self):
- # Enable retries and run test_get_flow_log_collector_all_params.
+ def test_get_load_balancer_pool_all_params_with_retries(self):
+ # Enable retries and run test_get_load_balancer_pool_all_params.
_service.enable_retries()
- self.test_get_flow_log_collector_all_params()
+ self.test_get_load_balancer_pool_all_params()
- # Disable retries and run test_get_flow_log_collector_all_params.
+ # Disable retries and run test_get_load_balancer_pool_all_params.
_service.disable_retries()
- self.test_get_flow_log_collector_all_params()
+ self.test_get_load_balancer_pool_all_params()
@responses.activate
- def test_get_flow_log_collector_value_error(self):
+ def test_get_load_balancer_pool_value_error(self):
"""
- test_get_flow_log_collector_value_error()
+ test_get_load_balancer_pool_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}}'
+ url = preprocess_url('/load_balancers/testString/pools/testString')
+ mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
responses.add(responses.GET,
url,
body=mock_response,
@@ -29533,70 +27046,81 @@ def test_get_flow_log_collector_value_error(self):
status=200)
# Set up parameter values
+ load_balancer_id = 'testString'
id = 'testString'
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "load_balancer_id": load_balancer_id,
"id": id,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.get_flow_log_collector(**req_copy)
+ _service.get_load_balancer_pool(**req_copy)
- def test_get_flow_log_collector_value_error_with_retries(self):
- # Enable retries and run test_get_flow_log_collector_value_error.
+ def test_get_load_balancer_pool_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_pool_value_error.
_service.enable_retries()
- self.test_get_flow_log_collector_value_error()
+ self.test_get_load_balancer_pool_value_error()
- # Disable retries and run test_get_flow_log_collector_value_error.
+ # Disable retries and run test_get_load_balancer_pool_value_error.
_service.disable_retries()
- self.test_get_flow_log_collector_value_error()
+ self.test_get_load_balancer_pool_value_error()
-class TestUpdateFlowLogCollector():
+class TestUpdateLoadBalancerPool():
"""
- Test Class for update_flow_log_collector
+ Test Class for update_load_balancer_pool
"""
- def preprocess_url(self, request_url: str):
- """
- Preprocess the request URL to ensure the mock response will be found.
- """
- request_url = urllib.parse.unquote(request_url) # don't double-encode if already encoded
- request_url = urllib.parse.quote(request_url, safe=':/')
- if re.fullmatch('.*/+', request_url) is None:
- return request_url
- else:
- return re.compile(request_url.rstrip('/') + '/+')
-
@responses.activate
- def test_update_flow_log_collector_all_params(self):
+ def test_update_load_balancer_pool_all_params(self):
"""
- update_flow_log_collector()
+ update_load_balancer_pool()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}}'
+ url = preprocess_url('/load_balancers/testString/pools/testString')
+ mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a FlowLogCollectorPatch model
- flow_log_collector_patch_model = {}
- flow_log_collector_patch_model['active'] = True
- flow_log_collector_patch_model['name'] = 'my-flow-log-collector'
+ # Construct a dict representation of a LoadBalancerPoolHealthMonitorPatch model
+ load_balancer_pool_health_monitor_patch_model = {}
+ load_balancer_pool_health_monitor_patch_model['delay'] = 5
+ load_balancer_pool_health_monitor_patch_model['max_retries'] = 2
+ load_balancer_pool_health_monitor_patch_model['port'] = 22
+ load_balancer_pool_health_monitor_patch_model['timeout'] = 2
+ load_balancer_pool_health_monitor_patch_model['type'] = 'http'
+ load_balancer_pool_health_monitor_patch_model['url_path'] = '/'
+
+ # Construct a dict representation of a LoadBalancerPoolSessionPersistencePatch model
+ load_balancer_pool_session_persistence_patch_model = {}
+ load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie'
+
+ # Construct a dict representation of a LoadBalancerPoolPatch model
+ load_balancer_pool_patch_model = {}
+ load_balancer_pool_patch_model['algorithm'] = 'least_connections'
+ load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model
+ load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_patch_model['protocol'] = 'http'
+ load_balancer_pool_patch_model['proxy_protocol'] = 'disabled'
+ load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model
# Set up parameter values
+ load_balancer_id = 'testString'
id = 'testString'
- flow_log_collector_patch = flow_log_collector_patch_model
+ load_balancer_pool_patch = load_balancer_pool_patch_model
# Invoke method
- response = _service.update_flow_log_collector(
+ response = _service.update_load_balancer_pool(
+ load_balancer_id,
id,
- flow_log_collector_patch,
+ load_balancer_pool_patch,
headers={}
)
@@ -29605,1704 +27129,6099 @@ def test_update_flow_log_collector_all_params(self):
assert response.status_code == 200
# Validate body params
req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
- assert req_body == flow_log_collector_patch
+ assert req_body == load_balancer_pool_patch
- def test_update_flow_log_collector_all_params_with_retries(self):
- # Enable retries and run test_update_flow_log_collector_all_params.
+ def test_update_load_balancer_pool_all_params_with_retries(self):
+ # Enable retries and run test_update_load_balancer_pool_all_params.
_service.enable_retries()
- self.test_update_flow_log_collector_all_params()
+ self.test_update_load_balancer_pool_all_params()
- # Disable retries and run test_update_flow_log_collector_all_params.
+ # Disable retries and run test_update_load_balancer_pool_all_params.
_service.disable_retries()
- self.test_update_flow_log_collector_all_params()
+ self.test_update_load_balancer_pool_all_params()
@responses.activate
- def test_update_flow_log_collector_value_error(self):
+ def test_update_load_balancer_pool_value_error(self):
"""
- test_update_flow_log_collector_value_error()
+ test_update_load_balancer_pool_value_error()
"""
# Set up mock
- url = self.preprocess_url(_base_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"}}'
+ url = preprocess_url('/load_balancers/testString/pools/testString')
+ mock_response = '{"algorithm": "least_connections", "created_at": "2019-01-01T12:00:00.000Z", "health_monitor": {"delay": 5, "max_retries": 2, "port": 22, "timeout": 2, "type": "http", "url_path": "/"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "instance_group": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance-group"}, "members": [{"deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004"}], "name": "my-load-balancer-pool", "protocol": "http", "provisioning_status": "active", "proxy_protocol": "disabled", "session_persistence": {"cookie_name": "my-cookie-name", "type": "app_cookie"}}'
responses.add(responses.PATCH,
url,
body=mock_response,
content_type='application/json',
status=200)
- # Construct a dict representation of a FlowLogCollectorPatch model
- flow_log_collector_patch_model = {}
- flow_log_collector_patch_model['active'] = True
- flow_log_collector_patch_model['name'] = 'my-flow-log-collector'
+ # Construct a dict representation of a LoadBalancerPoolHealthMonitorPatch model
+ load_balancer_pool_health_monitor_patch_model = {}
+ load_balancer_pool_health_monitor_patch_model['delay'] = 5
+ load_balancer_pool_health_monitor_patch_model['max_retries'] = 2
+ load_balancer_pool_health_monitor_patch_model['port'] = 22
+ load_balancer_pool_health_monitor_patch_model['timeout'] = 2
+ load_balancer_pool_health_monitor_patch_model['type'] = 'http'
+ load_balancer_pool_health_monitor_patch_model['url_path'] = '/'
+
+ # Construct a dict representation of a LoadBalancerPoolSessionPersistencePatch model
+ load_balancer_pool_session_persistence_patch_model = {}
+ load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie'
+
+ # Construct a dict representation of a LoadBalancerPoolPatch model
+ load_balancer_pool_patch_model = {}
+ load_balancer_pool_patch_model['algorithm'] = 'least_connections'
+ load_balancer_pool_patch_model['health_monitor'] = load_balancer_pool_health_monitor_patch_model
+ load_balancer_pool_patch_model['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_patch_model['protocol'] = 'http'
+ load_balancer_pool_patch_model['proxy_protocol'] = 'disabled'
+ load_balancer_pool_patch_model['session_persistence'] = load_balancer_pool_session_persistence_patch_model
# Set up parameter values
+ load_balancer_id = 'testString'
id = 'testString'
- flow_log_collector_patch = flow_log_collector_patch_model
+ load_balancer_pool_patch = load_balancer_pool_patch_model
# Pass in all but one required param and check for a ValueError
req_param_dict = {
+ "load_balancer_id": load_balancer_id,
"id": id,
- "flow_log_collector_patch": flow_log_collector_patch,
+ "load_balancer_pool_patch": load_balancer_pool_patch,
}
for param in req_param_dict.keys():
req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
with pytest.raises(ValueError):
- _service.update_flow_log_collector(**req_copy)
+ _service.update_load_balancer_pool(**req_copy)
- def test_update_flow_log_collector_value_error_with_retries(self):
- # Enable retries and run test_update_flow_log_collector_value_error.
+ def test_update_load_balancer_pool_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_pool_value_error.
_service.enable_retries()
- self.test_update_flow_log_collector_value_error()
+ self.test_update_load_balancer_pool_value_error()
- # Disable retries and run test_update_flow_log_collector_value_error.
+ # Disable retries and run test_update_load_balancer_pool_value_error.
_service.disable_retries()
- self.test_update_flow_log_collector_value_error()
-
-# endregion
-##############################################################################
-# End of Service: FlowLogCollectors
-##############################################################################
+ self.test_update_load_balancer_pool_value_error()
+class TestListLoadBalancerPoolMembers():
+ """
+ Test Class for list_load_balancer_pool_members
+ """
+
+ @responses.activate
+ def test_list_load_balancer_pool_members_all_params(self):
+ """
+ list_load_balancer_pool_members()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members')
+ mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+
+ # Invoke method
+ response = _service.list_load_balancer_pool_members(
+ load_balancer_id,
+ pool_id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_load_balancer_pool_members_all_params_with_retries(self):
+ # Enable retries and run test_list_load_balancer_pool_members_all_params.
+ _service.enable_retries()
+ self.test_list_load_balancer_pool_members_all_params()
+
+ # Disable retries and run test_list_load_balancer_pool_members_all_params.
+ _service.disable_retries()
+ self.test_list_load_balancer_pool_members_all_params()
+
+ @responses.activate
+ def test_list_load_balancer_pool_members_value_error(self):
+ """
+ test_list_load_balancer_pool_members_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members')
+ mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "pool_id": pool_id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.list_load_balancer_pool_members(**req_copy)
+
+
+ def test_list_load_balancer_pool_members_value_error_with_retries(self):
+ # Enable retries and run test_list_load_balancer_pool_members_value_error.
+ _service.enable_retries()
+ self.test_list_load_balancer_pool_members_value_error()
+
+ # Disable retries and run test_list_load_balancer_pool_members_value_error.
+ _service.disable_retries()
+ self.test_list_load_balancer_pool_members_value_error()
+
+class TestCreateLoadBalancerPoolMember():
+ """
+ Test Class for create_load_balancer_pool_member
+ """
+
+ @responses.activate
+ def test_create_load_balancer_pool_member_all_params(self):
+ """
+ create_load_balancer_pool_member()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
+ load_balancer_pool_member_target_prototype_model = {}
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ port = 80
+ target = load_balancer_pool_member_target_prototype_model
+ weight = 50
+
+ # Invoke method
+ response = _service.create_load_balancer_pool_member(
+ load_balancer_id,
+ pool_id,
+ port,
+ target,
+ weight=weight,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 201
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['port'] == 80
+ assert req_body['target'] == load_balancer_pool_member_target_prototype_model
+ assert req_body['weight'] == 50
+
+ def test_create_load_balancer_pool_member_all_params_with_retries(self):
+ # Enable retries and run test_create_load_balancer_pool_member_all_params.
+ _service.enable_retries()
+ self.test_create_load_balancer_pool_member_all_params()
+
+ # Disable retries and run test_create_load_balancer_pool_member_all_params.
+ _service.disable_retries()
+ self.test_create_load_balancer_pool_member_all_params()
+
+ @responses.activate
+ def test_create_load_balancer_pool_member_value_error(self):
+ """
+ test_create_load_balancer_pool_member_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
+ load_balancer_pool_member_target_prototype_model = {}
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ port = 80
+ target = load_balancer_pool_member_target_prototype_model
+ weight = 50
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "pool_id": pool_id,
+ "port": port,
+ "target": target,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.create_load_balancer_pool_member(**req_copy)
+
+
+ def test_create_load_balancer_pool_member_value_error_with_retries(self):
+ # Enable retries and run test_create_load_balancer_pool_member_value_error.
+ _service.enable_retries()
+ self.test_create_load_balancer_pool_member_value_error()
+
+ # Disable retries and run test_create_load_balancer_pool_member_value_error.
+ _service.disable_retries()
+ self.test_create_load_balancer_pool_member_value_error()
+
+class TestReplaceLoadBalancerPoolMembers():
+ """
+ Test Class for replace_load_balancer_pool_members
+ """
+
+ @responses.activate
+ def test_replace_load_balancer_pool_members_all_params(self):
+ """
+ replace_load_balancer_pool_members()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members')
+ mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}'
+ responses.add(responses.PUT,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=202)
+
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
+ load_balancer_pool_member_target_prototype_model = {}
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
+ load_balancer_pool_member_prototype_model = {}
+ load_balancer_pool_member_prototype_model['port'] = 80
+ load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
+ load_balancer_pool_member_prototype_model['weight'] = 50
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ members = [load_balancer_pool_member_prototype_model]
+
+ # Invoke method
+ response = _service.replace_load_balancer_pool_members(
+ load_balancer_id,
+ pool_id,
+ members,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 202
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['members'] == [load_balancer_pool_member_prototype_model]
+
+ def test_replace_load_balancer_pool_members_all_params_with_retries(self):
+ # Enable retries and run test_replace_load_balancer_pool_members_all_params.
+ _service.enable_retries()
+ self.test_replace_load_balancer_pool_members_all_params()
+
+ # Disable retries and run test_replace_load_balancer_pool_members_all_params.
+ _service.disable_retries()
+ self.test_replace_load_balancer_pool_members_all_params()
+
+ @responses.activate
+ def test_replace_load_balancer_pool_members_value_error(self):
+ """
+ test_replace_load_balancer_pool_members_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members')
+ mock_response = '{"members": [{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}]}'
+ responses.add(responses.PUT,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=202)
+
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
+ load_balancer_pool_member_target_prototype_model = {}
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Construct a dict representation of a LoadBalancerPoolMemberPrototype model
+ load_balancer_pool_member_prototype_model = {}
+ load_balancer_pool_member_prototype_model['port'] = 80
+ load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
+ load_balancer_pool_member_prototype_model['weight'] = 50
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ members = [load_balancer_pool_member_prototype_model]
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "pool_id": pool_id,
+ "members": members,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.replace_load_balancer_pool_members(**req_copy)
+
+
+ def test_replace_load_balancer_pool_members_value_error_with_retries(self):
+ # Enable retries and run test_replace_load_balancer_pool_members_value_error.
+ _service.enable_retries()
+ self.test_replace_load_balancer_pool_members_value_error()
+
+ # Disable retries and run test_replace_load_balancer_pool_members_value_error.
+ _service.disable_retries()
+ self.test_replace_load_balancer_pool_members_value_error()
+
+class TestDeleteLoadBalancerPoolMember():
+ """
+ Test Class for delete_load_balancer_pool_member
+ """
+
+ @responses.activate
+ def test_delete_load_balancer_pool_member_all_params(self):
+ """
+ delete_load_balancer_pool_member()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.delete_load_balancer_pool_member(
+ load_balancer_id,
+ pool_id,
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 204
+
+ def test_delete_load_balancer_pool_member_all_params_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_pool_member_all_params.
+ _service.enable_retries()
+ self.test_delete_load_balancer_pool_member_all_params()
+
+ # Disable retries and run test_delete_load_balancer_pool_member_all_params.
+ _service.disable_retries()
+ self.test_delete_load_balancer_pool_member_all_params()
+
+ @responses.activate
+ def test_delete_load_balancer_pool_member_value_error(self):
+ """
+ test_delete_load_balancer_pool_member_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "pool_id": pool_id,
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.delete_load_balancer_pool_member(**req_copy)
+
+
+ def test_delete_load_balancer_pool_member_value_error_with_retries(self):
+ # Enable retries and run test_delete_load_balancer_pool_member_value_error.
+ _service.enable_retries()
+ self.test_delete_load_balancer_pool_member_value_error()
+
+ # Disable retries and run test_delete_load_balancer_pool_member_value_error.
+ _service.disable_retries()
+ self.test_delete_load_balancer_pool_member_value_error()
+
+class TestGetLoadBalancerPoolMember():
+ """
+ Test Class for get_load_balancer_pool_member
+ """
+
+ @responses.activate
+ def test_get_load_balancer_pool_member_all_params(self):
+ """
+ get_load_balancer_pool_member()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_load_balancer_pool_member(
+ load_balancer_id,
+ pool_id,
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_get_load_balancer_pool_member_all_params_with_retries(self):
+ # Enable retries and run test_get_load_balancer_pool_member_all_params.
+ _service.enable_retries()
+ self.test_get_load_balancer_pool_member_all_params()
+
+ # Disable retries and run test_get_load_balancer_pool_member_all_params.
+ _service.disable_retries()
+ self.test_get_load_balancer_pool_member_all_params()
+
+ @responses.activate
+ def test_get_load_balancer_pool_member_value_error(self):
+ """
+ test_get_load_balancer_pool_member_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "pool_id": pool_id,
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.get_load_balancer_pool_member(**req_copy)
+
+
+ def test_get_load_balancer_pool_member_value_error_with_retries(self):
+ # Enable retries and run test_get_load_balancer_pool_member_value_error.
+ _service.enable_retries()
+ self.test_get_load_balancer_pool_member_value_error()
+
+ # Disable retries and run test_get_load_balancer_pool_member_value_error.
+ _service.disable_retries()
+ self.test_get_load_balancer_pool_member_value_error()
+
+class TestUpdateLoadBalancerPoolMember():
+ """
+ Test Class for update_load_balancer_pool_member
+ """
+
+ @responses.activate
+ def test_update_load_balancer_pool_member_all_params(self):
+ """
+ update_load_balancer_pool_member()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ responses.add(responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
+ load_balancer_pool_member_target_prototype_model = {}
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Construct a dict representation of a LoadBalancerPoolMemberPatch model
+ load_balancer_pool_member_patch_model = {}
+ load_balancer_pool_member_patch_model['port'] = 80
+ load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model
+ load_balancer_pool_member_patch_model['weight'] = 50
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ id = 'testString'
+ load_balancer_pool_member_patch = load_balancer_pool_member_patch_model
+
+ # Invoke method
+ response = _service.update_load_balancer_pool_member(
+ load_balancer_id,
+ pool_id,
+ id,
+ load_balancer_pool_member_patch,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == load_balancer_pool_member_patch
+
+ def test_update_load_balancer_pool_member_all_params_with_retries(self):
+ # Enable retries and run test_update_load_balancer_pool_member_all_params.
+ _service.enable_retries()
+ self.test_update_load_balancer_pool_member_all_params()
+
+ # Disable retries and run test_update_load_balancer_pool_member_all_params.
+ _service.disable_retries()
+ self.test_update_load_balancer_pool_member_all_params()
+
+ @responses.activate
+ def test_update_load_balancer_pool_member_value_error(self):
+ """
+ test_update_load_balancer_pool_member_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/load_balancers/testString/pools/testString/members/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "health": "faulted", "href": "https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004", "id": "70294e14-4e61-11e8-bcf4-0242ac110004", "port": 80, "provisioning_status": "active", "target": {"crn": "crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a", "id": "1e09281b-f177-46fb-baf1-bc152b2e391a", "name": "my-instance"}, "weight": 50}'
+ responses.add(responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById model
+ load_balancer_pool_member_target_prototype_model = {}
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Construct a dict representation of a LoadBalancerPoolMemberPatch model
+ load_balancer_pool_member_patch_model = {}
+ load_balancer_pool_member_patch_model['port'] = 80
+ load_balancer_pool_member_patch_model['target'] = load_balancer_pool_member_target_prototype_model
+ load_balancer_pool_member_patch_model['weight'] = 50
+
+ # Set up parameter values
+ load_balancer_id = 'testString'
+ pool_id = 'testString'
+ id = 'testString'
+ load_balancer_pool_member_patch = load_balancer_pool_member_patch_model
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "load_balancer_id": load_balancer_id,
+ "pool_id": pool_id,
+ "id": id,
+ "load_balancer_pool_member_patch": load_balancer_pool_member_patch,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.update_load_balancer_pool_member(**req_copy)
+
+
+ def test_update_load_balancer_pool_member_value_error_with_retries(self):
+ # Enable retries and run test_update_load_balancer_pool_member_value_error.
+ _service.enable_retries()
+ self.test_update_load_balancer_pool_member_value_error()
+
+ # Disable retries and run test_update_load_balancer_pool_member_value_error.
+ _service.disable_retries()
+ self.test_update_load_balancer_pool_member_value_error()
+
+# endregion
+##############################################################################
+# End of Service: LoadBalancers
+##############################################################################
+
+##############################################################################
+# Start of Service: EndpointGateways
+##############################################################################
+# region
+
+class TestNewInstance():
+ """
+ Test Class for new_instance
+ """
+
+ def test_new_instance(self):
+ """
+ new_instance()
+ """
+ os.environ['TEST_SERVICE_AUTH_TYPE'] = 'noAuth'
+
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE',
+ )
+
+ assert service is not None
+ assert isinstance(service, VpcV1)
+
+ def test_new_instance_without_authenticator(self):
+ """
+ new_instance_without_authenticator()
+ """
+ with pytest.raises(ValueError, match='authenticator must be provided'):
+ service = VpcV1.new_instance(
+ version=version,
+ service_name='TEST_SERVICE_NOT_FOUND',
+ )
+
+ def test_new_instance_without_required_params(self):
+ """
+ new_instance_without_required_params()
+ """
+ with pytest.raises(TypeError, match='new_instance\\(\\) missing \\d required positional arguments?: \'.*\''):
+ service = VpcV1.new_instance()
+
+ def test_new_instance_required_param_none(self):
+ """
+ new_instance_required_param_none()
+ """
+ with pytest.raises(ValueError, match='version must be provided'):
+ service = VpcV1.new_instance(
+ version=None,
+ )
+class TestListEndpointGateways():
+ """
+ Test Class for list_endpoint_gateways
+ """
+
+ @responses.activate
+ def test_list_endpoint_gateways_all_params(self):
+ """
+ list_endpoint_gateways()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways')
+ mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ name = 'testString'
+ start = 'testString'
+ limit = 1
+ resource_group_id = 'testString'
+
+ # Invoke method
+ response = _service.list_endpoint_gateways(
+ name=name,
+ 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 'name={}'.format(name) in query_string
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
+ assert 'resource_group.id={}'.format(resource_group_id) in query_string
+
+ def test_list_endpoint_gateways_all_params_with_retries(self):
+ # Enable retries and run test_list_endpoint_gateways_all_params.
+ _service.enable_retries()
+ self.test_list_endpoint_gateways_all_params()
+
+ # Disable retries and run test_list_endpoint_gateways_all_params.
+ _service.disable_retries()
+ self.test_list_endpoint_gateways_all_params()
+
+ @responses.activate
+ def test_list_endpoint_gateways_required_params(self):
+ """
+ test_list_endpoint_gateways_required_params()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways')
+ mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Invoke method
+ response = _service.list_endpoint_gateways()
+
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_endpoint_gateways_required_params_with_retries(self):
+ # Enable retries and run test_list_endpoint_gateways_required_params.
+ _service.enable_retries()
+ self.test_list_endpoint_gateways_required_params()
+
+ # Disable retries and run test_list_endpoint_gateways_required_params.
+ _service.disable_retries()
+ self.test_list_endpoint_gateways_required_params()
+
+ @responses.activate
+ def test_list_endpoint_gateways_value_error(self):
+ """
+ test_list_endpoint_gateways_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways')
+ mock_response = '{"endpoint_gateways": [{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}], "first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20"}, "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20"}, "total_count": 132}'
+ 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_endpoint_gateways(**req_copy)
+
+
+ def test_list_endpoint_gateways_value_error_with_retries(self):
+ # Enable retries and run test_list_endpoint_gateways_value_error.
+ _service.enable_retries()
+ self.test_list_endpoint_gateways_value_error()
+
+ # Disable retries and run test_list_endpoint_gateways_value_error.
+ _service.disable_retries()
+ self.test_list_endpoint_gateways_value_error()
+
+class TestCreateEndpointGateway():
+ """
+ Test Class for create_endpoint_gateway
+ """
+
+ @responses.activate
+ def test_create_endpoint_gateway_all_params(self):
+ """
+ create_endpoint_gateway()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model
+ endpoint_gateway_target_prototype_model = {}
+ endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service'
+ endpoint_gateway_target_prototype_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
+
+ # Construct a dict representation of a VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf'
+
+ # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model
+ endpoint_gateway_reserved_ip_model = {}
+ endpoint_gateway_reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Set up parameter values
+ target = endpoint_gateway_target_prototype_model
+ vpc = vpc_identity_model
+ ips = [endpoint_gateway_reserved_ip_model]
+ name = 'testString'
+ resource_group = resource_group_identity_model
+ security_groups = [security_group_identity_model]
+
+ # Invoke method
+ response = _service.create_endpoint_gateway(
+ target,
+ vpc,
+ ips=ips,
+ name=name,
+ resource_group=resource_group,
+ security_groups=security_groups,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 201
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['target'] == endpoint_gateway_target_prototype_model
+ assert req_body['vpc'] == vpc_identity_model
+ assert req_body['ips'] == [endpoint_gateway_reserved_ip_model]
+ assert req_body['name'] == 'testString'
+ assert req_body['resource_group'] == resource_group_identity_model
+ assert req_body['security_groups'] == [security_group_identity_model]
+
+ def test_create_endpoint_gateway_all_params_with_retries(self):
+ # Enable retries and run test_create_endpoint_gateway_all_params.
+ _service.enable_retries()
+ self.test_create_endpoint_gateway_all_params()
+
+ # Disable retries and run test_create_endpoint_gateway_all_params.
+ _service.disable_retries()
+ self.test_create_endpoint_gateway_all_params()
+
+ @responses.activate
+ def test_create_endpoint_gateway_value_error(self):
+ """
+ test_create_endpoint_gateway_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a EndpointGatewayTargetPrototypeProviderCloudServiceIdentityProviderCloudServiceIdentityByCRN model
+ endpoint_gateway_target_prototype_model = {}
+ endpoint_gateway_target_prototype_model['resource_type'] = 'provider_infrastructure_service'
+ endpoint_gateway_target_prototype_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
+
+ # Construct a dict representation of a VPCIdentityById model
+ vpc_identity_model = {}
+ vpc_identity_model['id'] = 'f025b503-ae66-46de-a011-3bd08fd5f7bf'
+
+ # Construct a dict representation of a EndpointGatewayReservedIPReservedIPIdentityReservedIPIdentityById model
+ endpoint_gateway_reserved_ip_model = {}
+ endpoint_gateway_reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Construct a dict representation of a SecurityGroupIdentityById model
+ security_group_identity_model = {}
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ # Set up parameter values
+ target = endpoint_gateway_target_prototype_model
+ vpc = vpc_identity_model
+ ips = [endpoint_gateway_reserved_ip_model]
+ name = 'testString'
+ resource_group = resource_group_identity_model
+ security_groups = [security_group_identity_model]
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "target": target,
+ "vpc": vpc,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.create_endpoint_gateway(**req_copy)
+
+
+ def test_create_endpoint_gateway_value_error_with_retries(self):
+ # Enable retries and run test_create_endpoint_gateway_value_error.
+ _service.enable_retries()
+ self.test_create_endpoint_gateway_value_error()
+
+ # Disable retries and run test_create_endpoint_gateway_value_error.
+ _service.disable_retries()
+ self.test_create_endpoint_gateway_value_error()
+
+class TestListEndpointGatewayIps():
+ """
+ Test Class for list_endpoint_gateway_ips
+ """
+
+ @responses.activate
+ def test_list_endpoint_gateway_ips_all_params(self):
+ """
+ list_endpoint_gateway_ips()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString/ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ endpoint_gateway_id = 'testString'
+ start = 'testString'
+ limit = 1
+ sort = 'name'
+
+ # Invoke method
+ response = _service.list_endpoint_gateway_ips(
+ endpoint_gateway_id,
+ start=start,
+ limit=limit,
+ sort=sort,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?',1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
+ assert 'sort={}'.format(sort) in query_string
+
+ def test_list_endpoint_gateway_ips_all_params_with_retries(self):
+ # Enable retries and run test_list_endpoint_gateway_ips_all_params.
+ _service.enable_retries()
+ self.test_list_endpoint_gateway_ips_all_params()
+
+ # Disable retries and run test_list_endpoint_gateway_ips_all_params.
+ _service.disable_retries()
+ self.test_list_endpoint_gateway_ips_all_params()
+
+ @responses.activate
+ def test_list_endpoint_gateway_ips_required_params(self):
+ """
+ test_list_endpoint_gateway_ips_required_params()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString/ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ endpoint_gateway_id = 'testString'
+
+ # Invoke method
+ response = _service.list_endpoint_gateway_ips(
+ endpoint_gateway_id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_endpoint_gateway_ips_required_params_with_retries(self):
+ # Enable retries and run test_list_endpoint_gateway_ips_required_params.
+ _service.enable_retries()
+ self.test_list_endpoint_gateway_ips_required_params()
+
+ # Disable retries and run test_list_endpoint_gateway_ips_required_params.
+ _service.disable_retries()
+ self.test_list_endpoint_gateway_ips_required_params()
+
+ @responses.activate
+ def test_list_endpoint_gateway_ips_value_error(self):
+ """
+ test_list_endpoint_gateway_ips_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString/ips')
+ mock_response = '{"first": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20"}, "ips": [{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}], "limit": 20, "next": {"href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20"}, "total_count": 132}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ endpoint_gateway_id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "endpoint_gateway_id": endpoint_gateway_id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.list_endpoint_gateway_ips(**req_copy)
+
+
+ def test_list_endpoint_gateway_ips_value_error_with_retries(self):
+ # Enable retries and run test_list_endpoint_gateway_ips_value_error.
+ _service.enable_retries()
+ self.test_list_endpoint_gateway_ips_value_error()
+
+ # Disable retries and run test_list_endpoint_gateway_ips_value_error.
+ _service.disable_retries()
+ self.test_list_endpoint_gateway_ips_value_error()
+
+class TestRemoveEndpointGatewayIp():
+ """
+ Test Class for remove_endpoint_gateway_ip
+ """
+
+ @responses.activate
+ def test_remove_endpoint_gateway_ip_all_params(self):
+ """
+ remove_endpoint_gateway_ip()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString/ips/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ endpoint_gateway_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.remove_endpoint_gateway_ip(
+ endpoint_gateway_id,
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 204
+
+ def test_remove_endpoint_gateway_ip_all_params_with_retries(self):
+ # Enable retries and run test_remove_endpoint_gateway_ip_all_params.
+ _service.enable_retries()
+ self.test_remove_endpoint_gateway_ip_all_params()
+
+ # Disable retries and run test_remove_endpoint_gateway_ip_all_params.
+ _service.disable_retries()
+ self.test_remove_endpoint_gateway_ip_all_params()
+
+ @responses.activate
+ def test_remove_endpoint_gateway_ip_value_error(self):
+ """
+ test_remove_endpoint_gateway_ip_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString/ips/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ endpoint_gateway_id = 'testString'
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "endpoint_gateway_id": endpoint_gateway_id,
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.remove_endpoint_gateway_ip(**req_copy)
+
+
+ def test_remove_endpoint_gateway_ip_value_error_with_retries(self):
+ # Enable retries and run test_remove_endpoint_gateway_ip_value_error.
+ _service.enable_retries()
+ self.test_remove_endpoint_gateway_ip_value_error()
+
+ # Disable retries and run test_remove_endpoint_gateway_ip_value_error.
+ _service.disable_retries()
+ self.test_remove_endpoint_gateway_ip_value_error()
+
+class TestGetEndpointGatewayIp():
+ """
+ Test Class for get_endpoint_gateway_ip
+ """
+
+ @responses.activate
+ def test_get_endpoint_gateway_ip_all_params(self):
+ """
+ get_endpoint_gateway_ip()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ endpoint_gateway_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.get_endpoint_gateway_ip(
+ endpoint_gateway_id,
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_get_endpoint_gateway_ip_all_params_with_retries(self):
+ # Enable retries and run test_get_endpoint_gateway_ip_all_params.
+ _service.enable_retries()
+ self.test_get_endpoint_gateway_ip_all_params()
+
+ # Disable retries and run test_get_endpoint_gateway_ip_all_params.
+ _service.disable_retries()
+ self.test_get_endpoint_gateway_ip_all_params()
+
+ @responses.activate
+ def test_get_endpoint_gateway_ip_value_error(self):
+ """
+ test_get_endpoint_gateway_ip_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ responses.add(responses.GET,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ endpoint_gateway_id = 'testString'
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "endpoint_gateway_id": endpoint_gateway_id,
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.get_endpoint_gateway_ip(**req_copy)
+
+
+ def test_get_endpoint_gateway_ip_value_error_with_retries(self):
+ # Enable retries and run test_get_endpoint_gateway_ip_value_error.
+ _service.enable_retries()
+ self.test_get_endpoint_gateway_ip_value_error()
+
+ # Disable retries and run test_get_endpoint_gateway_ip_value_error.
+ _service.disable_retries()
+ self.test_get_endpoint_gateway_ip_value_error()
+
+class TestAddEndpointGatewayIp():
+ """
+ Test Class for add_endpoint_gateway_ip
+ """
+
+ @responses.activate
+ def test_add_endpoint_gateway_ip_all_params(self):
+ """
+ add_endpoint_gateway_ip()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ responses.add(responses.PUT,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Set up parameter values
+ endpoint_gateway_id = 'testString'
+ id = 'testString'
+
+ # Invoke method
+ response = _service.add_endpoint_gateway_ip(
+ endpoint_gateway_id,
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 201
+
+ def test_add_endpoint_gateway_ip_all_params_with_retries(self):
+ # Enable retries and run test_add_endpoint_gateway_ip_all_params.
+ _service.enable_retries()
+ self.test_add_endpoint_gateway_ip_all_params()
+
+ # Disable retries and run test_add_endpoint_gateway_ip_all_params.
+ _service.disable_retries()
+ self.test_add_endpoint_gateway_ip_all_params()
+
+ @responses.activate
+ def test_add_endpoint_gateway_ip_value_error(self):
+ """
+ test_add_endpoint_gateway_ip_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString/ips/testString')
+ mock_response = '{"address": "192.168.3.4", "auto_delete": false, "created_at": "2019-01-01T12:00:00.000Z", "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "owner": "user", "resource_type": "subnet_reserved_ip", "target": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "name": "my-endpoint-gateway", "resource_type": "endpoint_gateway"}}'
+ responses.add(responses.PUT,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Set up parameter values
+ endpoint_gateway_id = 'testString'
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "endpoint_gateway_id": endpoint_gateway_id,
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.add_endpoint_gateway_ip(**req_copy)
+
+
+ def test_add_endpoint_gateway_ip_value_error_with_retries(self):
+ # Enable retries and run test_add_endpoint_gateway_ip_value_error.
+ _service.enable_retries()
+ self.test_add_endpoint_gateway_ip_value_error()
+
+ # Disable retries and run test_add_endpoint_gateway_ip_value_error.
+ _service.disable_retries()
+ self.test_add_endpoint_gateway_ip_value_error()
+
+class TestDeleteEndpointGateway():
+ """
+ Test Class for delete_endpoint_gateway
+ """
+
+ @responses.activate
+ def test_delete_endpoint_gateway_all_params(self):
+ """
+ delete_endpoint_gateway()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.delete_endpoint_gateway(
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 204
+
+ def test_delete_endpoint_gateway_all_params_with_retries(self):
+ # Enable retries and run test_delete_endpoint_gateway_all_params.
+ _service.enable_retries()
+ self.test_delete_endpoint_gateway_all_params()
+
+ # Disable retries and run test_delete_endpoint_gateway_all_params.
+ _service.disable_retries()
+ self.test_delete_endpoint_gateway_all_params()
+
+ @responses.activate
+ def test_delete_endpoint_gateway_value_error(self):
+ """
+ test_delete_endpoint_gateway_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.delete_endpoint_gateway(**req_copy)
+
+
+ def test_delete_endpoint_gateway_value_error_with_retries(self):
+ # Enable retries and run test_delete_endpoint_gateway_value_error.
+ _service.enable_retries()
+ self.test_delete_endpoint_gateway_value_error()
+
+ # Disable retries and run test_delete_endpoint_gateway_value_error.
+ _service.disable_retries()
+ self.test_delete_endpoint_gateway_value_error()
+
+class TestGetEndpointGateway():
+ """
+ Test Class for get_endpoint_gateway
+ """
+
+ @responses.activate
+ def test_get_endpoint_gateway_all_params(self):
+ """
+ get_endpoint_gateway()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ 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_endpoint_gateway(
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_get_endpoint_gateway_all_params_with_retries(self):
+ # Enable retries and run test_get_endpoint_gateway_all_params.
+ _service.enable_retries()
+ self.test_get_endpoint_gateway_all_params()
+
+ # Disable retries and run test_get_endpoint_gateway_all_params.
+ _service.disable_retries()
+ self.test_get_endpoint_gateway_all_params()
+
+ @responses.activate
+ def test_get_endpoint_gateway_value_error(self):
+ """
+ test_get_endpoint_gateway_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ 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_endpoint_gateway(**req_copy)
+
+
+ def test_get_endpoint_gateway_value_error_with_retries(self):
+ # Enable retries and run test_get_endpoint_gateway_value_error.
+ _service.enable_retries()
+ self.test_get_endpoint_gateway_value_error()
+
+ # Disable retries and run test_get_endpoint_gateway_value_error.
+ _service.disable_retries()
+ self.test_get_endpoint_gateway_value_error()
+
+class TestUpdateEndpointGateway():
+ """
+ Test Class for update_endpoint_gateway
+ """
+
+ @responses.activate
+ def test_update_endpoint_gateway_all_params(self):
+ """
+ update_endpoint_gateway()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ responses.add(responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a EndpointGatewayPatch model
+ endpoint_gateway_patch_model = {}
+ endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway'
+
+ # Set up parameter values
+ id = 'testString'
+ endpoint_gateway_patch = endpoint_gateway_patch_model
+
+ # Invoke method
+ response = _service.update_endpoint_gateway(
+ id,
+ endpoint_gateway_patch,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body == endpoint_gateway_patch
+
+ def test_update_endpoint_gateway_all_params_with_retries(self):
+ # Enable retries and run test_update_endpoint_gateway_all_params.
+ _service.enable_retries()
+ self.test_update_endpoint_gateway_all_params()
+
+ # Disable retries and run test_update_endpoint_gateway_all_params.
+ _service.disable_retries()
+ self.test_update_endpoint_gateway_all_params()
+
+ @responses.activate
+ def test_update_endpoint_gateway_value_error(self):
+ """
+ test_update_endpoint_gateway_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/endpoint_gateways/testString')
+ mock_response = '{"created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5", "health_state": "ok", "href": "https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5", "id": "d7cc5196-9864-48c4-82d8-3f30da41fcc5", "ips": [{"address": "192.168.3.4", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb", "id": "6d353a0f-aeb1-4ae1-832e-1110d10981bb", "name": "my-reserved-ip", "resource_type": "subnet_reserved_ip"}], "lifecycle_state": "stable", "name": "my-endpoint-gateway", "resource_group": {"href": "https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345", "id": "fee82deba12e4c0fb69c3b09d1f12345", "name": "my-resource-group"}, "resource_type": "endpoint_gateway", "security_groups": [{"crn": "crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271", "id": "be5df5ca-12a0-494b-907e-aa6ec2bfa271", "name": "my-security-group"}], "service_endpoint": "my-cloudant-instance.appdomain.cloud", "service_endpoints": ["my-cloudant-instance.appdomain.cloud"], "target": {"crn": "crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::", "resource_type": "provider_cloud_service"}, "vpc": {"crn": "crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b", "deleted": {"more_info": "https://cloud.ibm.com/apidocs/vpc#deleted-resources"}, "href": "https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b", "id": "4727d842-f94f-4a2d-824a-9bc9b02c523b", "name": "my-vpc"}}'
+ responses.add(responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a EndpointGatewayPatch model
+ endpoint_gateway_patch_model = {}
+ endpoint_gateway_patch_model['name'] = 'my-endpoint-gateway'
+
+ # Set up parameter values
+ id = 'testString'
+ endpoint_gateway_patch = endpoint_gateway_patch_model
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ "endpoint_gateway_patch": endpoint_gateway_patch,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.update_endpoint_gateway(**req_copy)
+
+
+ def test_update_endpoint_gateway_value_error_with_retries(self):
+ # Enable retries and run test_update_endpoint_gateway_value_error.
+ _service.enable_retries()
+ self.test_update_endpoint_gateway_value_error()
+
+ # Disable retries and run test_update_endpoint_gateway_value_error.
+ _service.disable_retries()
+ self.test_update_endpoint_gateway_value_error()
+
+# endregion
+##############################################################################
+# End of Service: EndpointGateways
+##############################################################################
+
+##############################################################################
+# Start of Service: FlowLogCollectors
+##############################################################################
+# 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_required_param_none(self):
+ """
+ new_instance_required_param_none()
+ """
+ with pytest.raises(ValueError, match='version must be provided'):
+ service = VpcV1.new_instance(
+ version=None,
+ )
+class TestListFlowLogCollectors():
+ """
+ Test Class for list_flow_log_collectors
+ """
+
+ @responses.activate
+ def test_list_flow_log_collectors_all_params(self):
+ """
+ list_flow_log_collectors()
+ """
+ # 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"}}], "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,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Set up parameter values
+ start = 'testString'
+ limit = 1
+ resource_group_id = 'testString'
+ name = 'testString'
+ vpc_id = 'testString'
+ vpc_crn = 'testString'
+ vpc_name = 'testString'
+ target_id = 'testString'
+ target_resource_type = 'instance'
+
+ # Invoke method
+ response = _service.list_flow_log_collectors(
+ start=start,
+ limit=limit,
+ resource_group_id=resource_group_id,
+ name=name,
+ vpc_id=vpc_id,
+ vpc_crn=vpc_crn,
+ vpc_name=vpc_name,
+ target_id=target_id,
+ target_resource_type=target_resource_type,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+ # Validate query params
+ query_string = responses.calls[0].request.url.split('?',1)[1]
+ query_string = urllib.parse.unquote_plus(query_string)
+ assert 'start={}'.format(start) in query_string
+ assert 'limit={}'.format(limit) in query_string
+ assert 'resource_group.id={}'.format(resource_group_id) in query_string
+ assert 'name={}'.format(name) in query_string
+ assert 'vpc.id={}'.format(vpc_id) in query_string
+ assert 'vpc.crn={}'.format(vpc_crn) in query_string
+ assert 'vpc.name={}'.format(vpc_name) in query_string
+ assert 'target.id={}'.format(target_id) in query_string
+ assert 'target.resource_type={}'.format(target_resource_type) in query_string
+
+ def test_list_flow_log_collectors_all_params_with_retries(self):
+ # Enable retries and run test_list_flow_log_collectors_all_params.
+ _service.enable_retries()
+ self.test_list_flow_log_collectors_all_params()
+
+ # Disable retries and run test_list_flow_log_collectors_all_params.
+ _service.disable_retries()
+ self.test_list_flow_log_collectors_all_params()
+
+ @responses.activate
+ def test_list_flow_log_collectors_required_params(self):
+ """
+ test_list_flow_log_collectors_required_params()
+ """
+ # 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"}}], "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,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Invoke method
+ response = _service.list_flow_log_collectors()
+
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_list_flow_log_collectors_required_params_with_retries(self):
+ # Enable retries and run test_list_flow_log_collectors_required_params.
+ _service.enable_retries()
+ self.test_list_flow_log_collectors_required_params()
+
+ # Disable retries and run test_list_flow_log_collectors_required_params.
+ _service.disable_retries()
+ self.test_list_flow_log_collectors_required_params()
+
+ @responses.activate
+ def test_list_flow_log_collectors_value_error(self):
+ """
+ test_list_flow_log_collectors_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/flow_log_collectors')
+ mock_response = '{"first": {"href": "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"}}], "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,
+ 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_flow_log_collectors(**req_copy)
+
+
+ def test_list_flow_log_collectors_value_error_with_retries(self):
+ # Enable retries and run test_list_flow_log_collectors_value_error.
+ _service.enable_retries()
+ self.test_list_flow_log_collectors_value_error()
+
+ # Disable retries and run test_list_flow_log_collectors_value_error.
+ _service.disable_retries()
+ self.test_list_flow_log_collectors_value_error()
+
+class TestCreateFlowLogCollector():
+ """
+ Test Class for create_flow_log_collector
+ """
+
+ @responses.activate
+ def test_create_flow_log_collector_all_params(self):
+ """
+ create_flow_log_collector()
+ """
+ # 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"}}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a CloudObjectStorageBucketIdentityByName model
+ cloud_object_storage_bucket_identity_model = {}
+ cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue'
+
+ # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById model
+ flow_log_collector_target_prototype_model = {}
+ flow_log_collector_target_prototype_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Set up parameter values
+ storage_bucket = cloud_object_storage_bucket_identity_model
+ target = flow_log_collector_target_prototype_model
+ active = False
+ name = 'my-flow-log-collector'
+ resource_group = resource_group_identity_model
+
+ # Invoke method
+ response = _service.create_flow_log_collector(
+ storage_bucket,
+ target,
+ active=active,
+ name=name,
+ resource_group=resource_group,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 201
+ # Validate body params
+ req_body = json.loads(str(responses.calls[0].request.body, 'utf-8'))
+ assert req_body['storage_bucket'] == cloud_object_storage_bucket_identity_model
+ assert req_body['target'] == flow_log_collector_target_prototype_model
+ assert req_body['active'] == False
+ assert req_body['name'] == 'my-flow-log-collector'
+ assert req_body['resource_group'] == resource_group_identity_model
+
+ def test_create_flow_log_collector_all_params_with_retries(self):
+ # Enable retries and run test_create_flow_log_collector_all_params.
+ _service.enable_retries()
+ self.test_create_flow_log_collector_all_params()
+
+ # Disable retries and run test_create_flow_log_collector_all_params.
+ _service.disable_retries()
+ self.test_create_flow_log_collector_all_params()
+
+ @responses.activate
+ def test_create_flow_log_collector_value_error(self):
+ """
+ test_create_flow_log_collector_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/flow_log_collectors')
+ mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/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"}}'
+ responses.add(responses.POST,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=201)
+
+ # Construct a dict representation of a CloudObjectStorageBucketIdentityByName model
+ cloud_object_storage_bucket_identity_model = {}
+ cloud_object_storage_bucket_identity_model['name'] = 'bucket-27200-lwx4cfvcue'
+
+ # Construct a dict representation of a FlowLogCollectorTargetPrototypeNetworkInterfaceIdentityNetworkInterfaceIdentityNetworkInterfaceIdentityById model
+ flow_log_collector_target_prototype_model = {}
+ flow_log_collector_target_prototype_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+
+ # Construct a dict representation of a ResourceGroupIdentityById model
+ resource_group_identity_model = {}
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+
+ # Set up parameter values
+ storage_bucket = cloud_object_storage_bucket_identity_model
+ target = flow_log_collector_target_prototype_model
+ active = False
+ name = 'my-flow-log-collector'
+ resource_group = resource_group_identity_model
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "storage_bucket": storage_bucket,
+ "target": target,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.create_flow_log_collector(**req_copy)
+
+
+ def test_create_flow_log_collector_value_error_with_retries(self):
+ # Enable retries and run test_create_flow_log_collector_value_error.
+ _service.enable_retries()
+ self.test_create_flow_log_collector_value_error()
+
+ # Disable retries and run test_create_flow_log_collector_value_error.
+ _service.disable_retries()
+ self.test_create_flow_log_collector_value_error()
+
+class TestDeleteFlowLogCollector():
+ """
+ Test Class for delete_flow_log_collector
+ """
+
+ @responses.activate
+ def test_delete_flow_log_collector_all_params(self):
+ """
+ delete_flow_log_collector()
+ """
+ # Set up mock
+ url = preprocess_url('/flow_log_collectors/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ id = 'testString'
+
+ # Invoke method
+ response = _service.delete_flow_log_collector(
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 204
+
+ def test_delete_flow_log_collector_all_params_with_retries(self):
+ # Enable retries and run test_delete_flow_log_collector_all_params.
+ _service.enable_retries()
+ self.test_delete_flow_log_collector_all_params()
+
+ # Disable retries and run test_delete_flow_log_collector_all_params.
+ _service.disable_retries()
+ self.test_delete_flow_log_collector_all_params()
+
+ @responses.activate
+ def test_delete_flow_log_collector_value_error(self):
+ """
+ test_delete_flow_log_collector_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/flow_log_collectors/testString')
+ responses.add(responses.DELETE,
+ url,
+ status=204)
+
+ # Set up parameter values
+ id = 'testString'
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.delete_flow_log_collector(**req_copy)
+
+
+ def test_delete_flow_log_collector_value_error_with_retries(self):
+ # Enable retries and run test_delete_flow_log_collector_value_error.
+ _service.enable_retries()
+ self.test_delete_flow_log_collector_value_error()
+
+ # Disable retries and run test_delete_flow_log_collector_value_error.
+ _service.disable_retries()
+ self.test_delete_flow_log_collector_value_error()
+
+class TestGetFlowLogCollector():
+ """
+ Test Class for get_flow_log_collector
+ """
+
+ @responses.activate
+ def test_get_flow_log_collector_all_params(self):
+ """
+ get_flow_log_collector()
+ """
+ # Set up mock
+ url = preprocess_url('/flow_log_collectors/testString')
+ mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/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"}}'
+ 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_flow_log_collector(
+ id,
+ headers={}
+ )
+
+ # Check for correct operation
+ assert len(responses.calls) == 1
+ assert response.status_code == 200
+
+ def test_get_flow_log_collector_all_params_with_retries(self):
+ # Enable retries and run test_get_flow_log_collector_all_params.
+ _service.enable_retries()
+ self.test_get_flow_log_collector_all_params()
+
+ # Disable retries and run test_get_flow_log_collector_all_params.
+ _service.disable_retries()
+ self.test_get_flow_log_collector_all_params()
+
+ @responses.activate
+ def test_get_flow_log_collector_value_error(self):
+ """
+ test_get_flow_log_collector_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/flow_log_collectors/testString')
+ mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/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"}}'
+ 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_flow_log_collector(**req_copy)
+
+
+ def test_get_flow_log_collector_value_error_with_retries(self):
+ # Enable retries and run test_get_flow_log_collector_value_error.
+ _service.enable_retries()
+ self.test_get_flow_log_collector_value_error()
+
+ # Disable retries and run test_get_flow_log_collector_value_error.
+ _service.disable_retries()
+ self.test_get_flow_log_collector_value_error()
+
+class TestUpdateFlowLogCollector():
+ """
+ Test Class for update_flow_log_collector
+ """
+
+ @responses.activate
+ def test_update_flow_log_collector_all_params(self):
+ """
+ update_flow_log_collector()
+ """
+ # Set up mock
+ url = preprocess_url('/flow_log_collectors/testString')
+ mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/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"}}'
+ responses.add(responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a FlowLogCollectorPatch model
+ flow_log_collector_patch_model = {}
+ flow_log_collector_patch_model['active'] = True
+ flow_log_collector_patch_model['name'] = 'my-flow-log-collector'
+
+ # Set up parameter values
+ id = 'testString'
+ flow_log_collector_patch = flow_log_collector_patch_model
+
+ # Invoke method
+ response = _service.update_flow_log_collector(
+ id,
+ flow_log_collector_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 == flow_log_collector_patch
+
+ def test_update_flow_log_collector_all_params_with_retries(self):
+ # Enable retries and run test_update_flow_log_collector_all_params.
+ _service.enable_retries()
+ self.test_update_flow_log_collector_all_params()
+
+ # Disable retries and run test_update_flow_log_collector_all_params.
+ _service.disable_retries()
+ self.test_update_flow_log_collector_all_params()
+
+ @responses.activate
+ def test_update_flow_log_collector_value_error(self):
+ """
+ test_update_flow_log_collector_value_error()
+ """
+ # Set up mock
+ url = preprocess_url('/flow_log_collectors/testString')
+ mock_response = '{"active": true, "auto_delete": true, "created_at": "2019-01-01T12:00:00.000Z", "crn": "crn:v1:bluemix:public:is:us-south:a/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"}}'
+ responses.add(responses.PATCH,
+ url,
+ body=mock_response,
+ content_type='application/json',
+ status=200)
+
+ # Construct a dict representation of a FlowLogCollectorPatch model
+ flow_log_collector_patch_model = {}
+ flow_log_collector_patch_model['active'] = True
+ flow_log_collector_patch_model['name'] = 'my-flow-log-collector'
+
+ # Set up parameter values
+ id = 'testString'
+ flow_log_collector_patch = flow_log_collector_patch_model
+
+ # Pass in all but one required param and check for a ValueError
+ req_param_dict = {
+ "id": id,
+ "flow_log_collector_patch": flow_log_collector_patch,
+ }
+ for param in req_param_dict.keys():
+ req_copy = {key:val if key is not param else None for (key,val) in req_param_dict.items()}
+ with pytest.raises(ValueError):
+ _service.update_flow_log_collector(**req_copy)
+
+
+ def test_update_flow_log_collector_value_error_with_retries(self):
+ # Enable retries and run test_update_flow_log_collector_value_error.
+ _service.enable_retries()
+ self.test_update_flow_log_collector_value_error()
+
+ # Disable retries and run test_update_flow_log_collector_value_error.
+ _service.disable_retries()
+ self.test_update_flow_log_collector_value_error()
+
+# endregion
+##############################################################################
+# End of Service: FlowLogCollectors
+##############################################################################
+
+
+##############################################################################
+# Start of Model Tests
+##############################################################################
+# region
+class TestModel_AddressPrefix():
+ """
+ Test Class for AddressPrefix
+ """
+
+ def test_address_prefix_serialization(self):
+ """
+ Test serialization/deserialization for AddressPrefix
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ zone_reference_model = {} # ZoneReference
+ zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model['name'] = 'us-south-1'
+
+ # Construct a json representation of a AddressPrefix model
+ address_prefix_model_json = {}
+ address_prefix_model_json['cidr'] = '192.168.3.0/24'
+ address_prefix_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ address_prefix_model_json['has_subnets'] = True
+ address_prefix_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ address_prefix_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ address_prefix_model_json['is_default'] = False
+ address_prefix_model_json['name'] = 'my-address-prefix-2'
+ address_prefix_model_json['zone'] = zone_reference_model
+
+ # Construct a model instance of AddressPrefix by calling from_dict on the json representation
+ address_prefix_model = AddressPrefix.from_dict(address_prefix_model_json)
+ assert address_prefix_model != False
+
+ # Construct a model instance of AddressPrefix by calling from_dict on the json representation
+ address_prefix_model_dict = AddressPrefix.from_dict(address_prefix_model_json).__dict__
+ address_prefix_model2 = AddressPrefix(**address_prefix_model_dict)
+
+ # Verify the model instances are equivalent
+ assert address_prefix_model == address_prefix_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ address_prefix_model_json2 = address_prefix_model.to_dict()
+ assert address_prefix_model_json2 == address_prefix_model_json
+
+class TestModel_AddressPrefixCollection():
+ """
+ Test Class for AddressPrefixCollection
+ """
+
+ def test_address_prefix_collection_serialization(self):
+ """
+ Test serialization/deserialization for AddressPrefixCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ zone_reference_model = {} # ZoneReference
+ zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model['name'] = 'us-south-1'
+
+ address_prefix_model = {} # AddressPrefix
+ address_prefix_model['cidr'] = '192.168.3.0/24'
+ address_prefix_model['created_at'] = "2019-01-01T12:00:00Z"
+ address_prefix_model['has_subnets'] = True
+ address_prefix_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ address_prefix_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ address_prefix_model['is_default'] = False
+ address_prefix_model['name'] = 'my-address-prefix-2'
+ address_prefix_model['zone'] = zone_reference_model
+
+ address_prefix_collection_first_model = {} # AddressPrefixCollectionFirst
+ address_prefix_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20'
+
+ address_prefix_collection_next_model = {} # AddressPrefixCollectionNext
+ address_prefix_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a json representation of a AddressPrefixCollection model
+ address_prefix_collection_model_json = {}
+ address_prefix_collection_model_json['address_prefixes'] = [address_prefix_model]
+ address_prefix_collection_model_json['first'] = address_prefix_collection_first_model
+ address_prefix_collection_model_json['limit'] = 20
+ address_prefix_collection_model_json['next'] = address_prefix_collection_next_model
+ address_prefix_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation
+ address_prefix_collection_model = AddressPrefixCollection.from_dict(address_prefix_collection_model_json)
+ assert address_prefix_collection_model != False
+
+ # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation
+ address_prefix_collection_model_dict = AddressPrefixCollection.from_dict(address_prefix_collection_model_json).__dict__
+ address_prefix_collection_model2 = AddressPrefixCollection(**address_prefix_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert address_prefix_collection_model == address_prefix_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ address_prefix_collection_model_json2 = address_prefix_collection_model.to_dict()
+ assert address_prefix_collection_model_json2 == address_prefix_collection_model_json
+
+class TestModel_AddressPrefixCollectionFirst():
+ """
+ Test Class for AddressPrefixCollectionFirst
+ """
+
+ def test_address_prefix_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for AddressPrefixCollectionFirst
+ """
+
+ # Construct a json representation of a AddressPrefixCollectionFirst model
+ address_prefix_collection_first_model_json = {}
+ address_prefix_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20'
+
+ # Construct a model instance of AddressPrefixCollectionFirst by calling from_dict on the json representation
+ address_prefix_collection_first_model = AddressPrefixCollectionFirst.from_dict(address_prefix_collection_first_model_json)
+ assert address_prefix_collection_first_model != False
+
+ # Construct a model instance of AddressPrefixCollectionFirst by calling from_dict on the json representation
+ address_prefix_collection_first_model_dict = AddressPrefixCollectionFirst.from_dict(address_prefix_collection_first_model_json).__dict__
+ address_prefix_collection_first_model2 = AddressPrefixCollectionFirst(**address_prefix_collection_first_model_dict)
+
+ # Verify the model instances are equivalent
+ assert address_prefix_collection_first_model == address_prefix_collection_first_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ address_prefix_collection_first_model_json2 = address_prefix_collection_first_model.to_dict()
+ assert address_prefix_collection_first_model_json2 == address_prefix_collection_first_model_json
+
+class TestModel_AddressPrefixCollectionNext():
+ """
+ Test Class for AddressPrefixCollectionNext
+ """
+
+ def test_address_prefix_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for AddressPrefixCollectionNext
+ """
+
+ # Construct a json representation of a AddressPrefixCollectionNext model
+ address_prefix_collection_next_model_json = {}
+ address_prefix_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a model instance of AddressPrefixCollectionNext by calling from_dict on the json representation
+ address_prefix_collection_next_model = AddressPrefixCollectionNext.from_dict(address_prefix_collection_next_model_json)
+ assert address_prefix_collection_next_model != False
+
+ # Construct a model instance of AddressPrefixCollectionNext by calling from_dict on the json representation
+ address_prefix_collection_next_model_dict = AddressPrefixCollectionNext.from_dict(address_prefix_collection_next_model_json).__dict__
+ address_prefix_collection_next_model2 = AddressPrefixCollectionNext(**address_prefix_collection_next_model_dict)
+
+ # Verify the model instances are equivalent
+ assert address_prefix_collection_next_model == address_prefix_collection_next_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ address_prefix_collection_next_model_json2 = address_prefix_collection_next_model.to_dict()
+ assert address_prefix_collection_next_model_json2 == address_prefix_collection_next_model_json
+
+class TestModel_AddressPrefixPatch():
+ """
+ Test Class for AddressPrefixPatch
+ """
+
+ def test_address_prefix_patch_serialization(self):
+ """
+ Test serialization/deserialization for AddressPrefixPatch
+ """
+
+ # Construct a json representation of a AddressPrefixPatch model
+ address_prefix_patch_model_json = {}
+ address_prefix_patch_model_json['is_default'] = False
+ address_prefix_patch_model_json['name'] = 'my-address-prefix-2'
+
+ # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation
+ address_prefix_patch_model = AddressPrefixPatch.from_dict(address_prefix_patch_model_json)
+ assert address_prefix_patch_model != False
+
+ # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation
+ address_prefix_patch_model_dict = AddressPrefixPatch.from_dict(address_prefix_patch_model_json).__dict__
+ address_prefix_patch_model2 = AddressPrefixPatch(**address_prefix_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert address_prefix_patch_model == address_prefix_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ address_prefix_patch_model_json2 = address_prefix_patch_model.to_dict()
+ assert address_prefix_patch_model_json2 == address_prefix_patch_model_json
+
+class TestModel_BareMetalServer():
+ """
+ Test Class for BareMetalServer
+ """
+
+ def test_bare_metal_server_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServer
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_disk_reference_deleted_model = {} # BareMetalServerDiskReferenceDeleted
+ bare_metal_server_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ bare_metal_server_boot_target_model = {} # BareMetalServerBootTargetBareMetalServerDiskReference
+ bare_metal_server_boot_target_model['deleted'] = bare_metal_server_disk_reference_deleted_model
+ bare_metal_server_boot_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_boot_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_boot_target_model['name'] = 'my-bare-metal-disk'
+ bare_metal_server_boot_target_model['resource_type'] = 'bare_metal_server_disk'
+
+ bare_metal_server_cpu_model = {} # BareMetalServerCPU
+ bare_metal_server_cpu_model['architecture'] = 'amd64'
+ bare_metal_server_cpu_model['core_count'] = 80
+ bare_metal_server_cpu_model['socket_count'] = 4
+ bare_metal_server_cpu_model['threads_per_core'] = 2
+
+ bare_metal_server_disk_model = {} # BareMetalServerDisk
+ bare_metal_server_disk_model['created_at'] = "2019-01-01T12:00:00Z"
+ bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_disk_model['interface_type'] = 'nvme'
+ bare_metal_server_disk_model['name'] = 'my-bare-metal-disk'
+ bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk'
+ bare_metal_server_disk_model['size'] = 100
+
+ network_interface_bare_metal_server_context_reference_deleted_model = {} # NetworkInterfaceBareMetalServerContextReferenceDeleted
+ network_interface_bare_metal_server_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+
+ network_interface_bare_metal_server_context_reference_model = {} # NetworkInterfaceBareMetalServerContextReference
+ 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['primary_ipv4_address'] = '192.168.3.4'
+ network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface'
+ network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model
+
+ bare_metal_server_profile_reference_model = {} # BareMetalServerProfileReference
+ bare_metal_server_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768'
+ bare_metal_server_profile_reference_model['name'] = 'bx2-metal-192x768'
+ bare_metal_server_profile_reference_model['resource_type'] = 'bare_metal_server_profile'
+
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
+
+ bare_metal_server_status_reason_model = {} # BareMetalServerStatusReason
+ bare_metal_server_status_reason_model['code'] = 'cannot_start_capacity'
+ bare_metal_server_status_reason_model['message'] = 'The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.'
+ bare_metal_server_status_reason_model['more_info'] = 'https://console.bluemix.net/docs/iaas/bare_metal_server.html'
+
+ bare_metal_server_trusted_platform_module_model = {} # BareMetalServerTrustedPlatformModule
+ bare_metal_server_trusted_platform_module_model['enabled'] = True
+ bare_metal_server_trusted_platform_module_model['mode'] = 'tpm_2'
+
+ 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'
+
+ 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 BareMetalServer model
+ bare_metal_server_model_json = {}
+ bare_metal_server_model_json['bandwidth'] = 20000
+ bare_metal_server_model_json['boot_target'] = bare_metal_server_boot_target_model
+ bare_metal_server_model_json['cpu'] = bare_metal_server_cpu_model
+ bare_metal_server_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ bare_metal_server_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ bare_metal_server_model_json['disks'] = [bare_metal_server_disk_model]
+ bare_metal_server_model_json['enable_secure_boot'] = False
+ bare_metal_server_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ bare_metal_server_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ bare_metal_server_model_json['memory'] = 1536
+ bare_metal_server_model_json['name'] = 'my-bare-metal-server'
+ bare_metal_server_model_json['network_interfaces'] = [network_interface_bare_metal_server_context_reference_model]
+ bare_metal_server_model_json['primary_network_interface'] = network_interface_bare_metal_server_context_reference_model
+ bare_metal_server_model_json['profile'] = bare_metal_server_profile_reference_model
+ bare_metal_server_model_json['resource_group'] = resource_group_reference_model
+ bare_metal_server_model_json['resource_type'] = 'bare_metal_server'
+ bare_metal_server_model_json['status'] = 'failed'
+ bare_metal_server_model_json['status_reasons'] = [bare_metal_server_status_reason_model]
+ bare_metal_server_model_json['trusted_platform_module'] = bare_metal_server_trusted_platform_module_model
+ bare_metal_server_model_json['vpc'] = vpc_reference_model
+ bare_metal_server_model_json['zone'] = zone_reference_model
+
+ # Construct a model instance of BareMetalServer by calling from_dict on the json representation
+ bare_metal_server_model = BareMetalServer.from_dict(bare_metal_server_model_json)
+ assert bare_metal_server_model != False
+
+ # Construct a model instance of BareMetalServer by calling from_dict on the json representation
+ bare_metal_server_model_dict = BareMetalServer.from_dict(bare_metal_server_model_json).__dict__
+ bare_metal_server_model2 = BareMetalServer(**bare_metal_server_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_model == bare_metal_server_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_model_json2 = bare_metal_server_model.to_dict()
+ assert bare_metal_server_model_json2 == bare_metal_server_model_json
+
+class TestModel_BareMetalServerCPU():
+ """
+ Test Class for BareMetalServerCPU
+ """
+
+ def test_bare_metal_server_cpu_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerCPU
+ """
+
+ # Construct a json representation of a BareMetalServerCPU model
+ bare_metal_server_cpu_model_json = {}
+ bare_metal_server_cpu_model_json['architecture'] = 'amd64'
+ bare_metal_server_cpu_model_json['core_count'] = 80
+ bare_metal_server_cpu_model_json['socket_count'] = 4
+ bare_metal_server_cpu_model_json['threads_per_core'] = 2
+
+ # Construct a model instance of BareMetalServerCPU by calling from_dict on the json representation
+ bare_metal_server_cpu_model = BareMetalServerCPU.from_dict(bare_metal_server_cpu_model_json)
+ assert bare_metal_server_cpu_model != False
+
+ # Construct a model instance of BareMetalServerCPU by calling from_dict on the json representation
+ bare_metal_server_cpu_model_dict = BareMetalServerCPU.from_dict(bare_metal_server_cpu_model_json).__dict__
+ bare_metal_server_cpu_model2 = BareMetalServerCPU(**bare_metal_server_cpu_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_cpu_model == bare_metal_server_cpu_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_cpu_model_json2 = bare_metal_server_cpu_model.to_dict()
+ assert bare_metal_server_cpu_model_json2 == bare_metal_server_cpu_model_json
+
+class TestModel_BareMetalServerCollection():
+ """
+ Test Class for BareMetalServerCollection
+ """
+
+ def test_bare_metal_server_collection_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_disk_reference_deleted_model = {} # BareMetalServerDiskReferenceDeleted
+ bare_metal_server_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ bare_metal_server_boot_target_model = {} # BareMetalServerBootTargetBareMetalServerDiskReference
+ bare_metal_server_boot_target_model['deleted'] = bare_metal_server_disk_reference_deleted_model
+ bare_metal_server_boot_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_boot_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_boot_target_model['name'] = 'my-bare-metal-disk'
+ bare_metal_server_boot_target_model['resource_type'] = 'bare_metal_server_disk'
+
+ bare_metal_server_cpu_model = {} # BareMetalServerCPU
+ bare_metal_server_cpu_model['architecture'] = 'amd64'
+ bare_metal_server_cpu_model['core_count'] = 80
+ bare_metal_server_cpu_model['socket_count'] = 4
+ bare_metal_server_cpu_model['threads_per_core'] = 2
+
+ bare_metal_server_disk_model = {} # BareMetalServerDisk
+ bare_metal_server_disk_model['created_at'] = "2019-01-01T12:00:00Z"
+ bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_disk_model['interface_type'] = 'nvme'
+ bare_metal_server_disk_model['name'] = 'my-bare-metal-disk'
+ bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk'
+ bare_metal_server_disk_model['size'] = 100
+
+ network_interface_bare_metal_server_context_reference_deleted_model = {} # NetworkInterfaceBareMetalServerContextReferenceDeleted
+ network_interface_bare_metal_server_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+
+ network_interface_bare_metal_server_context_reference_model = {} # NetworkInterfaceBareMetalServerContextReference
+ 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['primary_ipv4_address'] = '192.168.3.4'
+ network_interface_bare_metal_server_context_reference_model['resource_type'] = 'network_interface'
+ network_interface_bare_metal_server_context_reference_model['subnet'] = subnet_reference_model
+
+ bare_metal_server_profile_reference_model = {} # BareMetalServerProfileReference
+ bare_metal_server_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768'
+ bare_metal_server_profile_reference_model['name'] = 'bx2-metal-192x768'
+ bare_metal_server_profile_reference_model['resource_type'] = 'bare_metal_server_profile'
+
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
+
+ bare_metal_server_status_reason_model = {} # BareMetalServerStatusReason
+ bare_metal_server_status_reason_model['code'] = 'cannot_start_capacity'
+ bare_metal_server_status_reason_model['message'] = 'The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.'
+ bare_metal_server_status_reason_model['more_info'] = 'https://console.bluemix.net/docs/iaas/bare_metal_server.html'
+
+ bare_metal_server_trusted_platform_module_model = {} # BareMetalServerTrustedPlatformModule
+ bare_metal_server_trusted_platform_module_model['enabled'] = True
+ bare_metal_server_trusted_platform_module_model['mode'] = 'tpm_2'
+
+ 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'
+
+ zone_reference_model = {} # ZoneReference
+ zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model['name'] = 'us-south-1'
+
+ bare_metal_server_model = {} # BareMetalServer
+ bare_metal_server_model['bandwidth'] = 20000
+ bare_metal_server_model['boot_target'] = bare_metal_server_boot_target_model
+ bare_metal_server_model['cpu'] = bare_metal_server_cpu_model
+ bare_metal_server_model['created_at'] = "2019-01-01T12:00:00Z"
+ bare_metal_server_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::bare-metal-server:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ bare_metal_server_model['disks'] = [bare_metal_server_disk_model]
+ bare_metal_server_model['enable_secure_boot'] = False
+ bare_metal_server_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ bare_metal_server_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ bare_metal_server_model['memory'] = 1536
+ bare_metal_server_model['name'] = 'my-bare-metal-server'
+ bare_metal_server_model['network_interfaces'] = [network_interface_bare_metal_server_context_reference_model]
+ bare_metal_server_model['primary_network_interface'] = network_interface_bare_metal_server_context_reference_model
+ bare_metal_server_model['profile'] = bare_metal_server_profile_reference_model
+ bare_metal_server_model['resource_group'] = resource_group_reference_model
+ bare_metal_server_model['resource_type'] = 'bare_metal_server'
+ bare_metal_server_model['status'] = 'failed'
+ bare_metal_server_model['status_reasons'] = [bare_metal_server_status_reason_model]
+ bare_metal_server_model['trusted_platform_module'] = bare_metal_server_trusted_platform_module_model
+ bare_metal_server_model['vpc'] = vpc_reference_model
+ bare_metal_server_model['zone'] = zone_reference_model
+
+ bare_metal_server_collection_first_model = {} # BareMetalServerCollectionFirst
+ bare_metal_server_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20'
+
+ bare_metal_server_collection_next_model = {} # BareMetalServerCollectionNext
+ bare_metal_server_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a json representation of a BareMetalServerCollection model
+ bare_metal_server_collection_model_json = {}
+ bare_metal_server_collection_model_json['bare_metal_servers'] = [bare_metal_server_model]
+ bare_metal_server_collection_model_json['first'] = bare_metal_server_collection_first_model
+ bare_metal_server_collection_model_json['limit'] = 20
+ bare_metal_server_collection_model_json['next'] = bare_metal_server_collection_next_model
+ bare_metal_server_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of BareMetalServerCollection by calling from_dict on the json representation
+ bare_metal_server_collection_model = BareMetalServerCollection.from_dict(bare_metal_server_collection_model_json)
+ assert bare_metal_server_collection_model != False
+
+ # Construct a model instance of BareMetalServerCollection by calling from_dict on the json representation
+ bare_metal_server_collection_model_dict = BareMetalServerCollection.from_dict(bare_metal_server_collection_model_json).__dict__
+ bare_metal_server_collection_model2 = BareMetalServerCollection(**bare_metal_server_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_collection_model == bare_metal_server_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_collection_model_json2 = bare_metal_server_collection_model.to_dict()
+ assert bare_metal_server_collection_model_json2 == bare_metal_server_collection_model_json
+
+class TestModel_BareMetalServerCollectionFirst():
+ """
+ Test Class for BareMetalServerCollectionFirst
+ """
+
+ def test_bare_metal_server_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerCollectionFirst
+ """
+
+ # Construct a json representation of a BareMetalServerCollectionFirst model
+ bare_metal_server_collection_first_model_json = {}
+ bare_metal_server_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?limit=20'
+
+ # Construct a model instance of BareMetalServerCollectionFirst by calling from_dict on the json representation
+ bare_metal_server_collection_first_model = BareMetalServerCollectionFirst.from_dict(bare_metal_server_collection_first_model_json)
+ assert bare_metal_server_collection_first_model != False
+
+ # Construct a model instance of BareMetalServerCollectionFirst by calling from_dict on the json representation
+ bare_metal_server_collection_first_model_dict = BareMetalServerCollectionFirst.from_dict(bare_metal_server_collection_first_model_json).__dict__
+ bare_metal_server_collection_first_model2 = BareMetalServerCollectionFirst(**bare_metal_server_collection_first_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_collection_first_model == bare_metal_server_collection_first_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_collection_first_model_json2 = bare_metal_server_collection_first_model.to_dict()
+ assert bare_metal_server_collection_first_model_json2 == bare_metal_server_collection_first_model_json
+
+class TestModel_BareMetalServerCollectionNext():
+ """
+ Test Class for BareMetalServerCollectionNext
+ """
+
+ def test_bare_metal_server_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerCollectionNext
+ """
+
+ # Construct a json representation of a BareMetalServerCollectionNext model
+ bare_metal_server_collection_next_model_json = {}
+ bare_metal_server_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a model instance of BareMetalServerCollectionNext by calling from_dict on the json representation
+ bare_metal_server_collection_next_model = BareMetalServerCollectionNext.from_dict(bare_metal_server_collection_next_model_json)
+ assert bare_metal_server_collection_next_model != False
+
+ # Construct a model instance of BareMetalServerCollectionNext by calling from_dict on the json representation
+ bare_metal_server_collection_next_model_dict = BareMetalServerCollectionNext.from_dict(bare_metal_server_collection_next_model_json).__dict__
+ bare_metal_server_collection_next_model2 = BareMetalServerCollectionNext(**bare_metal_server_collection_next_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_collection_next_model == bare_metal_server_collection_next_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_collection_next_model_json2 = bare_metal_server_collection_next_model.to_dict()
+ assert bare_metal_server_collection_next_model_json2 == bare_metal_server_collection_next_model_json
+
+class TestModel_BareMetalServerConsoleAccessToken():
+ """
+ Test Class for BareMetalServerConsoleAccessToken
+ """
+
+ def test_bare_metal_server_console_access_token_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerConsoleAccessToken
+ """
+
+ # Construct a json representation of a BareMetalServerConsoleAccessToken model
+ bare_metal_server_console_access_token_model_json = {}
+ bare_metal_server_console_access_token_model_json['access_token'] = 'VGhpcyBJcyBhIHRva2Vu'
+ bare_metal_server_console_access_token_model_json['console_type'] = 'serial'
+ bare_metal_server_console_access_token_model_json['created_at'] = "2020-07-27T21:50:14Z"
+ bare_metal_server_console_access_token_model_json['expires_at'] = "2020-07-27T21:51:14Z"
+ bare_metal_server_console_access_token_model_json['force'] = False
+ bare_metal_server_console_access_token_model_json['href'] = 'wss://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu'
+
+ # Construct a model instance of BareMetalServerConsoleAccessToken by calling from_dict on the json representation
+ bare_metal_server_console_access_token_model = BareMetalServerConsoleAccessToken.from_dict(bare_metal_server_console_access_token_model_json)
+ assert bare_metal_server_console_access_token_model != False
+
+ # Construct a model instance of BareMetalServerConsoleAccessToken by calling from_dict on the json representation
+ bare_metal_server_console_access_token_model_dict = BareMetalServerConsoleAccessToken.from_dict(bare_metal_server_console_access_token_model_json).__dict__
+ bare_metal_server_console_access_token_model2 = BareMetalServerConsoleAccessToken(**bare_metal_server_console_access_token_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_console_access_token_model == bare_metal_server_console_access_token_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_console_access_token_model_json2 = bare_metal_server_console_access_token_model.to_dict()
+ assert bare_metal_server_console_access_token_model_json2 == bare_metal_server_console_access_token_model_json
+
+class TestModel_BareMetalServerDisk():
+ """
+ Test Class for BareMetalServerDisk
+ """
+
+ def test_bare_metal_server_disk_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerDisk
+ """
+
+ # Construct a json representation of a BareMetalServerDisk model
+ bare_metal_server_disk_model_json = {}
+ bare_metal_server_disk_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ bare_metal_server_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_disk_model_json['interface_type'] = 'nvme'
+ bare_metal_server_disk_model_json['name'] = 'my-bare-metal-disk'
+ bare_metal_server_disk_model_json['resource_type'] = 'bare_metal_server_disk'
+ bare_metal_server_disk_model_json['size'] = 100
+
+ # Construct a model instance of BareMetalServerDisk by calling from_dict on the json representation
+ bare_metal_server_disk_model = BareMetalServerDisk.from_dict(bare_metal_server_disk_model_json)
+ assert bare_metal_server_disk_model != False
+
+ # Construct a model instance of BareMetalServerDisk by calling from_dict on the json representation
+ bare_metal_server_disk_model_dict = BareMetalServerDisk.from_dict(bare_metal_server_disk_model_json).__dict__
+ bare_metal_server_disk_model2 = BareMetalServerDisk(**bare_metal_server_disk_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_disk_model == bare_metal_server_disk_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_disk_model_json2 = bare_metal_server_disk_model.to_dict()
+ assert bare_metal_server_disk_model_json2 == bare_metal_server_disk_model_json
+
+class TestModel_BareMetalServerDiskCollection():
+ """
+ Test Class for BareMetalServerDiskCollection
+ """
+
+ def test_bare_metal_server_disk_collection_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerDiskCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_disk_model = {} # BareMetalServerDisk
+ bare_metal_server_disk_model['created_at'] = "2019-01-01T12:00:00Z"
+ bare_metal_server_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_disk_model['interface_type'] = 'nvme'
+ bare_metal_server_disk_model['name'] = 'my-bare-metal-disk'
+ bare_metal_server_disk_model['resource_type'] = 'bare_metal_server_disk'
+ bare_metal_server_disk_model['size'] = 100
+
+ # Construct a json representation of a BareMetalServerDiskCollection model
+ bare_metal_server_disk_collection_model_json = {}
+ bare_metal_server_disk_collection_model_json['disks'] = [bare_metal_server_disk_model]
+
+ # Construct a model instance of BareMetalServerDiskCollection by calling from_dict on the json representation
+ bare_metal_server_disk_collection_model = BareMetalServerDiskCollection.from_dict(bare_metal_server_disk_collection_model_json)
+ assert bare_metal_server_disk_collection_model != False
+
+ # Construct a model instance of BareMetalServerDiskCollection by calling from_dict on the json representation
+ bare_metal_server_disk_collection_model_dict = BareMetalServerDiskCollection.from_dict(bare_metal_server_disk_collection_model_json).__dict__
+ bare_metal_server_disk_collection_model2 = BareMetalServerDiskCollection(**bare_metal_server_disk_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_disk_collection_model == bare_metal_server_disk_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_disk_collection_model_json2 = bare_metal_server_disk_collection_model.to_dict()
+ assert bare_metal_server_disk_collection_model_json2 == bare_metal_server_disk_collection_model_json
+
+class TestModel_BareMetalServerDiskPatch():
+ """
+ Test Class for BareMetalServerDiskPatch
+ """
+
+ def test_bare_metal_server_disk_patch_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerDiskPatch
+ """
+
+ # Construct a json representation of a BareMetalServerDiskPatch model
+ bare_metal_server_disk_patch_model_json = {}
+ bare_metal_server_disk_patch_model_json['name'] = 'my-bare-metal-server-disk-updated'
+
+ # Construct a model instance of BareMetalServerDiskPatch by calling from_dict on the json representation
+ bare_metal_server_disk_patch_model = BareMetalServerDiskPatch.from_dict(bare_metal_server_disk_patch_model_json)
+ assert bare_metal_server_disk_patch_model != False
+
+ # Construct a model instance of BareMetalServerDiskPatch by calling from_dict on the json representation
+ bare_metal_server_disk_patch_model_dict = BareMetalServerDiskPatch.from_dict(bare_metal_server_disk_patch_model_json).__dict__
+ bare_metal_server_disk_patch_model2 = BareMetalServerDiskPatch(**bare_metal_server_disk_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_disk_patch_model == bare_metal_server_disk_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_disk_patch_model_json2 = bare_metal_server_disk_patch_model.to_dict()
+ assert bare_metal_server_disk_patch_model_json2 == bare_metal_server_disk_patch_model_json
+
+class TestModel_BareMetalServerDiskReferenceDeleted():
+ """
+ Test Class for BareMetalServerDiskReferenceDeleted
+ """
+
+ def test_bare_metal_server_disk_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerDiskReferenceDeleted
+ """
+
+ # Construct a json representation of a BareMetalServerDiskReferenceDeleted model
+ bare_metal_server_disk_reference_deleted_model_json = {}
+ bare_metal_server_disk_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a model instance of BareMetalServerDiskReferenceDeleted by calling from_dict on the json representation
+ bare_metal_server_disk_reference_deleted_model = BareMetalServerDiskReferenceDeleted.from_dict(bare_metal_server_disk_reference_deleted_model_json)
+ assert bare_metal_server_disk_reference_deleted_model != False
+
+ # Construct a model instance of BareMetalServerDiskReferenceDeleted by calling from_dict on the json representation
+ bare_metal_server_disk_reference_deleted_model_dict = BareMetalServerDiskReferenceDeleted.from_dict(bare_metal_server_disk_reference_deleted_model_json).__dict__
+ bare_metal_server_disk_reference_deleted_model2 = BareMetalServerDiskReferenceDeleted(**bare_metal_server_disk_reference_deleted_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_disk_reference_deleted_model == bare_metal_server_disk_reference_deleted_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_disk_reference_deleted_model_json2 = bare_metal_server_disk_reference_deleted_model.to_dict()
+ assert bare_metal_server_disk_reference_deleted_model_json2 == bare_metal_server_disk_reference_deleted_model_json
+
+class TestModel_BareMetalServerInitialization():
+ """
+ Test Class for BareMetalServerInitialization
+ """
+
+ def test_bare_metal_server_initialization_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerInitialization
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ image_reference_model = {} # ImageReference
+ image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['deleted'] = image_reference_deleted_model
+ image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['name'] = 'my-image'
+
+ key_reference_deleted_model = {} # KeyReferenceDeleted
+ key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ key_reference_model = {} # KeyReference
+ key_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_reference_model['deleted'] = key_reference_deleted_model
+ key_reference_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
+ key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_reference_model['name'] = 'my-key'
+
+ bare_metal_server_initialization_user_account_model = {} # BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount
+ bare_metal_server_initialization_user_account_model['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
+ bare_metal_server_initialization_user_account_model['encryption_key'] = key_reference_model
+ bare_metal_server_initialization_user_account_model['resource_type'] = 'host_user_account'
+ bare_metal_server_initialization_user_account_model['username'] = 'Administrator'
+
+ # Construct a json representation of a BareMetalServerInitialization model
+ bare_metal_server_initialization_model_json = {}
+ bare_metal_server_initialization_model_json['image'] = image_reference_model
+ bare_metal_server_initialization_model_json['keys'] = [key_reference_model]
+ bare_metal_server_initialization_model_json['user_accounts'] = [bare_metal_server_initialization_user_account_model]
+
+ # Construct a model instance of BareMetalServerInitialization by calling from_dict on the json representation
+ bare_metal_server_initialization_model = BareMetalServerInitialization.from_dict(bare_metal_server_initialization_model_json)
+ assert bare_metal_server_initialization_model != False
+
+ # Construct a model instance of BareMetalServerInitialization by calling from_dict on the json representation
+ bare_metal_server_initialization_model_dict = BareMetalServerInitialization.from_dict(bare_metal_server_initialization_model_json).__dict__
+ bare_metal_server_initialization_model2 = BareMetalServerInitialization(**bare_metal_server_initialization_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_initialization_model == bare_metal_server_initialization_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_initialization_model_json2 = bare_metal_server_initialization_model.to_dict()
+ assert bare_metal_server_initialization_model_json2 == bare_metal_server_initialization_model_json
+
+class TestModel_BareMetalServerInitializationPrototype():
+ """
+ Test Class for BareMetalServerInitializationPrototype
+ """
+
+ def test_bare_metal_server_initialization_prototype_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerInitializationPrototype
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+
+ # Construct a json representation of a BareMetalServerInitializationPrototype model
+ bare_metal_server_initialization_prototype_model_json = {}
+ bare_metal_server_initialization_prototype_model_json['image'] = image_identity_model
+ bare_metal_server_initialization_prototype_model_json['keys'] = [key_identity_model]
+ bare_metal_server_initialization_prototype_model_json['user_data'] = 'testString'
+
+ # Construct a model instance of BareMetalServerInitializationPrototype by calling from_dict on the json representation
+ bare_metal_server_initialization_prototype_model = BareMetalServerInitializationPrototype.from_dict(bare_metal_server_initialization_prototype_model_json)
+ assert bare_metal_server_initialization_prototype_model != False
+
+ # Construct a model instance of BareMetalServerInitializationPrototype by calling from_dict on the json representation
+ bare_metal_server_initialization_prototype_model_dict = BareMetalServerInitializationPrototype.from_dict(bare_metal_server_initialization_prototype_model_json).__dict__
+ bare_metal_server_initialization_prototype_model2 = BareMetalServerInitializationPrototype(**bare_metal_server_initialization_prototype_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_initialization_prototype_model == bare_metal_server_initialization_prototype_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_initialization_prototype_model_json2 = bare_metal_server_initialization_prototype_model.to_dict()
+ assert bare_metal_server_initialization_prototype_model_json2 == bare_metal_server_initialization_prototype_model_json
+
+class TestModel_BareMetalServerNetworkInterfaceCollection():
+ """
+ Test Class for BareMetalServerNetworkInterfaceCollection
+ """
+
+ def test_bare_metal_server_network_interface_collection_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_network_interface_collection_first_model = {} # BareMetalServerNetworkInterfaceCollectionFirst
+ bare_metal_server_network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20'
+
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ floating_ip_reference_model = {} # FloatingIPReference
+ floating_ip_reference_model['address'] = '203.0.113.1'
+ floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
+ floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['name'] = 'my-floating-ip'
+
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
+
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ subnet_reference_model = {} # SubnetReference
+ subnet_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model['name'] = 'my-subnet'
+
+ bare_metal_server_network_interface_model = {} # BareMetalServerNetworkInterfaceByPCI
+ bare_metal_server_network_interface_model['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_model['created_at'] = "2019-01-01T12:00:00Z"
+ bare_metal_server_network_interface_model['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_model['floating_ips'] = [floating_ip_reference_model]
+ bare_metal_server_network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_model['interface_type'] = 'pci'
+ bare_metal_server_network_interface_model['mac_address'] = '02:00:0a:00:23:94'
+ bare_metal_server_network_interface_model['name'] = 'my-network-interface'
+ bare_metal_server_network_interface_model['port_speed'] = 1000
+ bare_metal_server_network_interface_model['primary_ipv4_address'] = '192.168.3.4'
+ bare_metal_server_network_interface_model['resource_type'] = 'network_interface'
+ bare_metal_server_network_interface_model['security_groups'] = [security_group_reference_model]
+ bare_metal_server_network_interface_model['status'] = 'available'
+ bare_metal_server_network_interface_model['subnet'] = subnet_reference_model
+ bare_metal_server_network_interface_model['type'] = 'primary'
+ bare_metal_server_network_interface_model['allowed_vlans'] = [4]
+
+ bare_metal_server_network_interface_collection_next_model = {} # BareMetalServerNetworkInterfaceCollectionNext
+ bare_metal_server_network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
+
+ # Construct a json representation of a BareMetalServerNetworkInterfaceCollection model
+ bare_metal_server_network_interface_collection_model_json = {}
+ bare_metal_server_network_interface_collection_model_json['first'] = bare_metal_server_network_interface_collection_first_model
+ bare_metal_server_network_interface_collection_model_json['limit'] = 20
+ bare_metal_server_network_interface_collection_model_json['network_interfaces'] = [bare_metal_server_network_interface_model]
+ bare_metal_server_network_interface_collection_model_json['next'] = bare_metal_server_network_interface_collection_next_model
+ bare_metal_server_network_interface_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceCollection by calling from_dict on the json representation
+ bare_metal_server_network_interface_collection_model = BareMetalServerNetworkInterfaceCollection.from_dict(bare_metal_server_network_interface_collection_model_json)
+ assert bare_metal_server_network_interface_collection_model != False
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceCollection by calling from_dict on the json representation
+ bare_metal_server_network_interface_collection_model_dict = BareMetalServerNetworkInterfaceCollection.from_dict(bare_metal_server_network_interface_collection_model_json).__dict__
+ bare_metal_server_network_interface_collection_model2 = BareMetalServerNetworkInterfaceCollection(**bare_metal_server_network_interface_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_interface_collection_model == bare_metal_server_network_interface_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_interface_collection_model_json2 = bare_metal_server_network_interface_collection_model.to_dict()
+ assert bare_metal_server_network_interface_collection_model_json2 == bare_metal_server_network_interface_collection_model_json
+
+class TestModel_BareMetalServerNetworkInterfaceCollectionFirst():
+ """
+ Test Class for BareMetalServerNetworkInterfaceCollectionFirst
+ """
+
+ def test_bare_metal_server_network_interface_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceCollectionFirst
+ """
+
+ # Construct a json representation of a BareMetalServerNetworkInterfaceCollectionFirst model
+ bare_metal_server_network_interface_collection_first_model_json = {}
+ bare_metal_server_network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20'
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceCollectionFirst by calling from_dict on the json representation
+ bare_metal_server_network_interface_collection_first_model = BareMetalServerNetworkInterfaceCollectionFirst.from_dict(bare_metal_server_network_interface_collection_first_model_json)
+ assert bare_metal_server_network_interface_collection_first_model != False
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceCollectionFirst by calling from_dict on the json representation
+ bare_metal_server_network_interface_collection_first_model_dict = BareMetalServerNetworkInterfaceCollectionFirst.from_dict(bare_metal_server_network_interface_collection_first_model_json).__dict__
+ bare_metal_server_network_interface_collection_first_model2 = BareMetalServerNetworkInterfaceCollectionFirst(**bare_metal_server_network_interface_collection_first_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_interface_collection_first_model == bare_metal_server_network_interface_collection_first_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_interface_collection_first_model_json2 = bare_metal_server_network_interface_collection_first_model.to_dict()
+ assert bare_metal_server_network_interface_collection_first_model_json2 == bare_metal_server_network_interface_collection_first_model_json
+
+class TestModel_BareMetalServerNetworkInterfaceCollectionNext():
+ """
+ Test Class for BareMetalServerNetworkInterfaceCollectionNext
+ """
+
+ def test_bare_metal_server_network_interface_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceCollectionNext
+ """
+
+ # Construct a json representation of a BareMetalServerNetworkInterfaceCollectionNext model
+ bare_metal_server_network_interface_collection_next_model_json = {}
+ bare_metal_server_network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceCollectionNext by calling from_dict on the json representation
+ bare_metal_server_network_interface_collection_next_model = BareMetalServerNetworkInterfaceCollectionNext.from_dict(bare_metal_server_network_interface_collection_next_model_json)
+ assert bare_metal_server_network_interface_collection_next_model != False
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceCollectionNext by calling from_dict on the json representation
+ bare_metal_server_network_interface_collection_next_model_dict = BareMetalServerNetworkInterfaceCollectionNext.from_dict(bare_metal_server_network_interface_collection_next_model_json).__dict__
+ bare_metal_server_network_interface_collection_next_model2 = BareMetalServerNetworkInterfaceCollectionNext(**bare_metal_server_network_interface_collection_next_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_interface_collection_next_model == bare_metal_server_network_interface_collection_next_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_interface_collection_next_model_json2 = bare_metal_server_network_interface_collection_next_model.to_dict()
+ assert bare_metal_server_network_interface_collection_next_model_json2 == bare_metal_server_network_interface_collection_next_model_json
+
+class TestModel_BareMetalServerNetworkInterfacePatch():
+ """
+ Test Class for BareMetalServerNetworkInterfacePatch
+ """
+
+ def test_bare_metal_server_network_interface_patch_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerNetworkInterfacePatch
+ """
+
+ # Construct a json representation of a BareMetalServerNetworkInterfacePatch model
+ bare_metal_server_network_interface_patch_model_json = {}
+ bare_metal_server_network_interface_patch_model_json['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_patch_model_json['allowed_vlans'] = [4]
+ bare_metal_server_network_interface_patch_model_json['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_patch_model_json['name'] = 'my-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)
+ assert bare_metal_server_network_interface_patch_model != False
+
+ # Construct a model instance of BareMetalServerNetworkInterfacePatch by calling from_dict on the json representation
+ bare_metal_server_network_interface_patch_model_dict = BareMetalServerNetworkInterfacePatch.from_dict(bare_metal_server_network_interface_patch_model_json).__dict__
+ bare_metal_server_network_interface_patch_model2 = BareMetalServerNetworkInterfacePatch(**bare_metal_server_network_interface_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_network_interface_patch_model == bare_metal_server_network_interface_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_network_interface_patch_model_json2 = bare_metal_server_network_interface_patch_model.to_dict()
+ assert bare_metal_server_network_interface_patch_model_json2 == bare_metal_server_network_interface_patch_model_json
+
+class TestModel_BareMetalServerPatch():
+ """
+ Test Class for BareMetalServerPatch
+ """
+
+ def test_bare_metal_server_patch_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerPatch
+ """
+
+ # Construct a json representation of a BareMetalServerPatch model
+ bare_metal_server_patch_model_json = {}
+ bare_metal_server_patch_model_json['name'] = 'my-bare-metal-server'
+
+ # Construct a model instance of BareMetalServerPatch by calling from_dict on the json representation
+ bare_metal_server_patch_model = BareMetalServerPatch.from_dict(bare_metal_server_patch_model_json)
+ assert bare_metal_server_patch_model != False
+
+ # Construct a model instance of BareMetalServerPatch by calling from_dict on the json representation
+ bare_metal_server_patch_model_dict = BareMetalServerPatch.from_dict(bare_metal_server_patch_model_json).__dict__
+ bare_metal_server_patch_model2 = BareMetalServerPatch(**bare_metal_server_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_patch_model == bare_metal_server_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_patch_model_json2 = bare_metal_server_patch_model.to_dict()
+ assert bare_metal_server_patch_model_json2 == bare_metal_server_patch_model_json
+
+class TestModel_BareMetalServerPrimaryNetworkInterfacePrototype():
+ """
+ Test Class for BareMetalServerPrimaryNetworkInterfacePrototype
+ """
+
+ def test_bare_metal_server_primary_network_interface_prototype_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerPrimaryNetworkInterfacePrototype
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a json representation of a BareMetalServerPrimaryNetworkInterfacePrototype model
+ bare_metal_server_primary_network_interface_prototype_model_json = {}
+ bare_metal_server_primary_network_interface_prototype_model_json['allow_ip_spoofing'] = True
+ bare_metal_server_primary_network_interface_prototype_model_json['allowed_vlans'] = [4]
+ bare_metal_server_primary_network_interface_prototype_model_json['enable_infrastructure_nat'] = True
+ bare_metal_server_primary_network_interface_prototype_model_json['interface_type'] = 'pci'
+ bare_metal_server_primary_network_interface_prototype_model_json['name'] = 'my-network-interface'
+ bare_metal_server_primary_network_interface_prototype_model_json['primary_ipv4_address'] = '10.0.0.5'
+ bare_metal_server_primary_network_interface_prototype_model_json['security_groups'] = [security_group_identity_model]
+ bare_metal_server_primary_network_interface_prototype_model_json['subnet'] = subnet_identity_model
+
+ # Construct a model instance of BareMetalServerPrimaryNetworkInterfacePrototype by calling from_dict on the json representation
+ bare_metal_server_primary_network_interface_prototype_model = BareMetalServerPrimaryNetworkInterfacePrototype.from_dict(bare_metal_server_primary_network_interface_prototype_model_json)
+ assert bare_metal_server_primary_network_interface_prototype_model != False
+
+ # Construct a model instance of BareMetalServerPrimaryNetworkInterfacePrototype by calling from_dict on the json representation
+ bare_metal_server_primary_network_interface_prototype_model_dict = BareMetalServerPrimaryNetworkInterfacePrototype.from_dict(bare_metal_server_primary_network_interface_prototype_model_json).__dict__
+ bare_metal_server_primary_network_interface_prototype_model2 = BareMetalServerPrimaryNetworkInterfacePrototype(**bare_metal_server_primary_network_interface_prototype_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_primary_network_interface_prototype_model == bare_metal_server_primary_network_interface_prototype_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_primary_network_interface_prototype_model_json2 = bare_metal_server_primary_network_interface_prototype_model.to_dict()
+ assert bare_metal_server_primary_network_interface_prototype_model_json2 == bare_metal_server_primary_network_interface_prototype_model_json
+
+class TestModel_BareMetalServerProfile():
+ """
+ Test Class for BareMetalServerProfile
+ """
+
+ def test_bare_metal_server_profile_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfile
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_profile_bandwidth_model = {} # BareMetalServerProfileBandwidthFixed
+ bare_metal_server_profile_bandwidth_model['type'] = 'fixed'
+ bare_metal_server_profile_bandwidth_model['value'] = 20000
+
+ bare_metal_server_profile_cpu_architecture_model = {} # BareMetalServerProfileCPUArchitecture
+ bare_metal_server_profile_cpu_architecture_model['default'] = 'amd64'
+ bare_metal_server_profile_cpu_architecture_model['type'] = 'fixed'
+ bare_metal_server_profile_cpu_architecture_model['value'] = 'amd64'
+
+ bare_metal_server_profile_cpu_core_count_model = {} # BareMetalServerProfileCPUCoreCountFixed
+ bare_metal_server_profile_cpu_core_count_model['type'] = 'fixed'
+ bare_metal_server_profile_cpu_core_count_model['value'] = 80
+
+ bare_metal_server_profile_cpu_socket_count_model = {} # BareMetalServerProfileCPUSocketCountFixed
+ bare_metal_server_profile_cpu_socket_count_model['type'] = 'fixed'
+ bare_metal_server_profile_cpu_socket_count_model['value'] = 4
+
+ bare_metal_server_profile_disk_quantity_model = {} # BareMetalServerProfileDiskQuantityFixed
+ bare_metal_server_profile_disk_quantity_model['type'] = 'fixed'
+ bare_metal_server_profile_disk_quantity_model['value'] = 4
+
+ bare_metal_server_profile_disk_size_model = {} # BareMetalServerProfileDiskSizeFixed
+ bare_metal_server_profile_disk_size_model['type'] = 'fixed'
+ bare_metal_server_profile_disk_size_model['value'] = 100
+
+ bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces
+ bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'nvme'
+ bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum'
+ bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['nvme']
+
+ bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk
+ bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model
+ bare_metal_server_profile_disk_model['size'] = bare_metal_server_profile_disk_size_model
+ bare_metal_server_profile_disk_model['supported_interface_types'] = bare_metal_server_profile_disk_supported_interfaces_model
+
+ bare_metal_server_profile_memory_model = {} # BareMetalServerProfileMemoryFixed
+ bare_metal_server_profile_memory_model['type'] = 'fixed'
+ bare_metal_server_profile_memory_model['value'] = 16
+
+ bare_metal_server_profile_os_architecture_model = {} # BareMetalServerProfileOSArchitecture
+ bare_metal_server_profile_os_architecture_model['default'] = 'amd64'
+ bare_metal_server_profile_os_architecture_model['type'] = 'enum'
+ bare_metal_server_profile_os_architecture_model['values'] = ['amd64']
+
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model = {} # BareMetalServerProfileSupportedTrustedPlatformModuleModes
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model['type'] = 'enum'
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model['values'] = ['tpm_2']
+
+ # Construct a json representation of a BareMetalServerProfile model
+ bare_metal_server_profile_model_json = {}
+ bare_metal_server_profile_model_json['bandwidth'] = bare_metal_server_profile_bandwidth_model
+ bare_metal_server_profile_model_json['cpu_architecture'] = bare_metal_server_profile_cpu_architecture_model
+ bare_metal_server_profile_model_json['cpu_core_count'] = bare_metal_server_profile_cpu_core_count_model
+ bare_metal_server_profile_model_json['cpu_socket_count'] = bare_metal_server_profile_cpu_socket_count_model
+ bare_metal_server_profile_model_json['disks'] = [bare_metal_server_profile_disk_model]
+ bare_metal_server_profile_model_json['family'] = 'balanced'
+ bare_metal_server_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768'
+ bare_metal_server_profile_model_json['memory'] = bare_metal_server_profile_memory_model
+ bare_metal_server_profile_model_json['name'] = 'bx2-metal-192x768'
+ bare_metal_server_profile_model_json['os_architecture'] = bare_metal_server_profile_os_architecture_model
+ bare_metal_server_profile_model_json['resource_type'] = 'bare_metal_server_profile'
+ bare_metal_server_profile_model_json['supported_trusted_platform_module_modes'] = bare_metal_server_profile_supported_trusted_platform_module_modes_model
+
+ # Construct a model instance of BareMetalServerProfile by calling from_dict on the json representation
+ bare_metal_server_profile_model = BareMetalServerProfile.from_dict(bare_metal_server_profile_model_json)
+ assert bare_metal_server_profile_model != False
+
+ # Construct a model instance of BareMetalServerProfile by calling from_dict on the json representation
+ bare_metal_server_profile_model_dict = BareMetalServerProfile.from_dict(bare_metal_server_profile_model_json).__dict__
+ bare_metal_server_profile_model2 = BareMetalServerProfile(**bare_metal_server_profile_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_model == bare_metal_server_profile_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_model_json2 = bare_metal_server_profile_model.to_dict()
+ assert bare_metal_server_profile_model_json2 == bare_metal_server_profile_model_json
+
+class TestModel_BareMetalServerProfileCPUArchitecture():
+ """
+ Test Class for BareMetalServerProfileCPUArchitecture
+ """
+
+ def test_bare_metal_server_profile_cpu_architecture_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCPUArchitecture
+ """
+
+ # Construct a json representation of a BareMetalServerProfileCPUArchitecture model
+ bare_metal_server_profile_cpu_architecture_model_json = {}
+ bare_metal_server_profile_cpu_architecture_model_json['default'] = 'amd64'
+ bare_metal_server_profile_cpu_architecture_model_json['type'] = 'fixed'
+ bare_metal_server_profile_cpu_architecture_model_json['value'] = 'amd64'
+
+ # Construct a model instance of BareMetalServerProfileCPUArchitecture by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_architecture_model = BareMetalServerProfileCPUArchitecture.from_dict(bare_metal_server_profile_cpu_architecture_model_json)
+ assert bare_metal_server_profile_cpu_architecture_model != False
+
+ # Construct a model instance of BareMetalServerProfileCPUArchitecture by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_architecture_model_dict = BareMetalServerProfileCPUArchitecture.from_dict(bare_metal_server_profile_cpu_architecture_model_json).__dict__
+ bare_metal_server_profile_cpu_architecture_model2 = BareMetalServerProfileCPUArchitecture(**bare_metal_server_profile_cpu_architecture_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_cpu_architecture_model == bare_metal_server_profile_cpu_architecture_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_cpu_architecture_model_json2 = bare_metal_server_profile_cpu_architecture_model.to_dict()
+ assert bare_metal_server_profile_cpu_architecture_model_json2 == bare_metal_server_profile_cpu_architecture_model_json
+
+class TestModel_BareMetalServerProfileCollection():
+ """
+ Test Class for BareMetalServerProfileCollection
+ """
+
+ def test_bare_metal_server_profile_collection_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_profile_collection_first_model = {} # BareMetalServerProfileCollectionFirst
+ bare_metal_server_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20'
+
+ bare_metal_server_profile_collection_next_model = {} # BareMetalServerProfileCollectionNext
+ bare_metal_server_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ bare_metal_server_profile_bandwidth_model = {} # BareMetalServerProfileBandwidthFixed
+ bare_metal_server_profile_bandwidth_model['type'] = 'fixed'
+ bare_metal_server_profile_bandwidth_model['value'] = 20000
+
+ bare_metal_server_profile_cpu_architecture_model = {} # BareMetalServerProfileCPUArchitecture
+ bare_metal_server_profile_cpu_architecture_model['default'] = 'amd64'
+ bare_metal_server_profile_cpu_architecture_model['type'] = 'fixed'
+ bare_metal_server_profile_cpu_architecture_model['value'] = 'amd64'
+
+ bare_metal_server_profile_cpu_core_count_model = {} # BareMetalServerProfileCPUCoreCountFixed
+ bare_metal_server_profile_cpu_core_count_model['type'] = 'fixed'
+ bare_metal_server_profile_cpu_core_count_model['value'] = 80
+
+ bare_metal_server_profile_cpu_socket_count_model = {} # BareMetalServerProfileCPUSocketCountFixed
+ bare_metal_server_profile_cpu_socket_count_model['type'] = 'fixed'
+ bare_metal_server_profile_cpu_socket_count_model['value'] = 4
+
+ bare_metal_server_profile_disk_quantity_model = {} # BareMetalServerProfileDiskQuantityFixed
+ bare_metal_server_profile_disk_quantity_model['type'] = 'fixed'
+ bare_metal_server_profile_disk_quantity_model['value'] = 4
+
+ bare_metal_server_profile_disk_size_model = {} # BareMetalServerProfileDiskSizeFixed
+ bare_metal_server_profile_disk_size_model['type'] = 'fixed'
+ bare_metal_server_profile_disk_size_model['value'] = 100
+
+ bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces
+ bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'nvme'
+ bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum'
+ bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['nvme']
+
+ bare_metal_server_profile_disk_model = {} # BareMetalServerProfileDisk
+ bare_metal_server_profile_disk_model['quantity'] = bare_metal_server_profile_disk_quantity_model
+ bare_metal_server_profile_disk_model['size'] = bare_metal_server_profile_disk_size_model
+ bare_metal_server_profile_disk_model['supported_interface_types'] = bare_metal_server_profile_disk_supported_interfaces_model
+
+ bare_metal_server_profile_memory_model = {} # BareMetalServerProfileMemoryFixed
+ bare_metal_server_profile_memory_model['type'] = 'fixed'
+ bare_metal_server_profile_memory_model['value'] = 16
+
+ bare_metal_server_profile_os_architecture_model = {} # BareMetalServerProfileOSArchitecture
+ bare_metal_server_profile_os_architecture_model['default'] = 'amd64'
+ bare_metal_server_profile_os_architecture_model['type'] = 'enum'
+ bare_metal_server_profile_os_architecture_model['values'] = ['amd64']
+
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model = {} # BareMetalServerProfileSupportedTrustedPlatformModuleModes
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model['type'] = 'enum'
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model['values'] = ['tpm_2']
+
+ bare_metal_server_profile_model = {} # BareMetalServerProfile
+ bare_metal_server_profile_model['bandwidth'] = bare_metal_server_profile_bandwidth_model
+ bare_metal_server_profile_model['cpu_architecture'] = bare_metal_server_profile_cpu_architecture_model
+ bare_metal_server_profile_model['cpu_core_count'] = bare_metal_server_profile_cpu_core_count_model
+ bare_metal_server_profile_model['cpu_socket_count'] = bare_metal_server_profile_cpu_socket_count_model
+ bare_metal_server_profile_model['disks'] = [bare_metal_server_profile_disk_model]
+ bare_metal_server_profile_model['family'] = 'balanced'
+ bare_metal_server_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768'
+ bare_metal_server_profile_model['memory'] = bare_metal_server_profile_memory_model
+ bare_metal_server_profile_model['name'] = 'bx2-metal-192x768'
+ bare_metal_server_profile_model['os_architecture'] = bare_metal_server_profile_os_architecture_model
+ bare_metal_server_profile_model['resource_type'] = 'bare_metal_server_profile'
+ bare_metal_server_profile_model['supported_trusted_platform_module_modes'] = bare_metal_server_profile_supported_trusted_platform_module_modes_model
+
+ # Construct a json representation of a BareMetalServerProfileCollection model
+ bare_metal_server_profile_collection_model_json = {}
+ bare_metal_server_profile_collection_model_json['first'] = bare_metal_server_profile_collection_first_model
+ bare_metal_server_profile_collection_model_json['limit'] = 20
+ bare_metal_server_profile_collection_model_json['next'] = bare_metal_server_profile_collection_next_model
+ bare_metal_server_profile_collection_model_json['profiles'] = [bare_metal_server_profile_model]
+ bare_metal_server_profile_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of BareMetalServerProfileCollection by calling from_dict on the json representation
+ bare_metal_server_profile_collection_model = BareMetalServerProfileCollection.from_dict(bare_metal_server_profile_collection_model_json)
+ assert bare_metal_server_profile_collection_model != False
+
+ # Construct a model instance of BareMetalServerProfileCollection by calling from_dict on the json representation
+ bare_metal_server_profile_collection_model_dict = BareMetalServerProfileCollection.from_dict(bare_metal_server_profile_collection_model_json).__dict__
+ bare_metal_server_profile_collection_model2 = BareMetalServerProfileCollection(**bare_metal_server_profile_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_collection_model == bare_metal_server_profile_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_collection_model_json2 = bare_metal_server_profile_collection_model.to_dict()
+ assert bare_metal_server_profile_collection_model_json2 == bare_metal_server_profile_collection_model_json
+
+class TestModel_BareMetalServerProfileCollectionFirst():
+ """
+ Test Class for BareMetalServerProfileCollectionFirst
+ """
+
+ def test_bare_metal_server_profile_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCollectionFirst
+ """
+
+ # Construct a json representation of a BareMetalServerProfileCollectionFirst model
+ bare_metal_server_profile_collection_first_model_json = {}
+ bare_metal_server_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?limit=20'
+
+ # Construct a model instance of BareMetalServerProfileCollectionFirst by calling from_dict on the json representation
+ bare_metal_server_profile_collection_first_model = BareMetalServerProfileCollectionFirst.from_dict(bare_metal_server_profile_collection_first_model_json)
+ assert bare_metal_server_profile_collection_first_model != False
+
+ # Construct a model instance of BareMetalServerProfileCollectionFirst by calling from_dict on the json representation
+ bare_metal_server_profile_collection_first_model_dict = BareMetalServerProfileCollectionFirst.from_dict(bare_metal_server_profile_collection_first_model_json).__dict__
+ bare_metal_server_profile_collection_first_model2 = BareMetalServerProfileCollectionFirst(**bare_metal_server_profile_collection_first_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_collection_first_model == bare_metal_server_profile_collection_first_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_collection_first_model_json2 = bare_metal_server_profile_collection_first_model.to_dict()
+ assert bare_metal_server_profile_collection_first_model_json2 == bare_metal_server_profile_collection_first_model_json
+
+class TestModel_BareMetalServerProfileCollectionNext():
+ """
+ Test Class for BareMetalServerProfileCollectionNext
+ """
+
+ def test_bare_metal_server_profile_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCollectionNext
+ """
+
+ # Construct a json representation of a BareMetalServerProfileCollectionNext model
+ bare_metal_server_profile_collection_next_model_json = {}
+ bare_metal_server_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a model instance of BareMetalServerProfileCollectionNext by calling from_dict on the json representation
+ bare_metal_server_profile_collection_next_model = BareMetalServerProfileCollectionNext.from_dict(bare_metal_server_profile_collection_next_model_json)
+ assert bare_metal_server_profile_collection_next_model != False
+
+ # Construct a model instance of BareMetalServerProfileCollectionNext by calling from_dict on the json representation
+ bare_metal_server_profile_collection_next_model_dict = BareMetalServerProfileCollectionNext.from_dict(bare_metal_server_profile_collection_next_model_json).__dict__
+ bare_metal_server_profile_collection_next_model2 = BareMetalServerProfileCollectionNext(**bare_metal_server_profile_collection_next_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_collection_next_model == bare_metal_server_profile_collection_next_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_collection_next_model_json2 = bare_metal_server_profile_collection_next_model.to_dict()
+ assert bare_metal_server_profile_collection_next_model_json2 == bare_metal_server_profile_collection_next_model_json
+
+class TestModel_BareMetalServerProfileDisk():
+ """
+ Test Class for BareMetalServerProfileDisk
+ """
+
+ def test_bare_metal_server_profile_disk_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileDisk
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ bare_metal_server_profile_disk_quantity_model = {} # BareMetalServerProfileDiskQuantityFixed
+ bare_metal_server_profile_disk_quantity_model['type'] = 'fixed'
+ bare_metal_server_profile_disk_quantity_model['value'] = 4
+
+ bare_metal_server_profile_disk_size_model = {} # BareMetalServerProfileDiskSizeFixed
+ bare_metal_server_profile_disk_size_model['type'] = 'fixed'
+ bare_metal_server_profile_disk_size_model['value'] = 100
+
+ bare_metal_server_profile_disk_supported_interfaces_model = {} # BareMetalServerProfileDiskSupportedInterfaces
+ bare_metal_server_profile_disk_supported_interfaces_model['default'] = 'nvme'
+ bare_metal_server_profile_disk_supported_interfaces_model['type'] = 'enum'
+ bare_metal_server_profile_disk_supported_interfaces_model['values'] = ['nvme']
+
+ # Construct a json representation of a BareMetalServerProfileDisk model
+ bare_metal_server_profile_disk_model_json = {}
+ bare_metal_server_profile_disk_model_json['quantity'] = bare_metal_server_profile_disk_quantity_model
+ bare_metal_server_profile_disk_model_json['size'] = bare_metal_server_profile_disk_size_model
+ bare_metal_server_profile_disk_model_json['supported_interface_types'] = bare_metal_server_profile_disk_supported_interfaces_model
+
+ # Construct a model instance of BareMetalServerProfileDisk by calling from_dict on the json representation
+ bare_metal_server_profile_disk_model = BareMetalServerProfileDisk.from_dict(bare_metal_server_profile_disk_model_json)
+ assert bare_metal_server_profile_disk_model != False
+
+ # Construct a model instance of BareMetalServerProfileDisk by calling from_dict on the json representation
+ bare_metal_server_profile_disk_model_dict = BareMetalServerProfileDisk.from_dict(bare_metal_server_profile_disk_model_json).__dict__
+ bare_metal_server_profile_disk_model2 = BareMetalServerProfileDisk(**bare_metal_server_profile_disk_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_disk_model == bare_metal_server_profile_disk_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_disk_model_json2 = bare_metal_server_profile_disk_model.to_dict()
+ assert bare_metal_server_profile_disk_model_json2 == bare_metal_server_profile_disk_model_json
+
+class TestModel_BareMetalServerProfileDiskSupportedInterfaces():
+ """
+ Test Class for BareMetalServerProfileDiskSupportedInterfaces
+ """
+
+ def test_bare_metal_server_profile_disk_supported_interfaces_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileDiskSupportedInterfaces
+ """
+
+ # Construct a json representation of a BareMetalServerProfileDiskSupportedInterfaces model
+ bare_metal_server_profile_disk_supported_interfaces_model_json = {}
+ bare_metal_server_profile_disk_supported_interfaces_model_json['default'] = 'nvme'
+ bare_metal_server_profile_disk_supported_interfaces_model_json['type'] = 'enum'
+ bare_metal_server_profile_disk_supported_interfaces_model_json['values'] = ['nvme']
+
+ # Construct a model instance of BareMetalServerProfileDiskSupportedInterfaces by calling from_dict on the json representation
+ bare_metal_server_profile_disk_supported_interfaces_model = BareMetalServerProfileDiskSupportedInterfaces.from_dict(bare_metal_server_profile_disk_supported_interfaces_model_json)
+ assert bare_metal_server_profile_disk_supported_interfaces_model != False
+
+ # Construct a model instance of BareMetalServerProfileDiskSupportedInterfaces by calling from_dict on the json representation
+ bare_metal_server_profile_disk_supported_interfaces_model_dict = BareMetalServerProfileDiskSupportedInterfaces.from_dict(bare_metal_server_profile_disk_supported_interfaces_model_json).__dict__
+ bare_metal_server_profile_disk_supported_interfaces_model2 = BareMetalServerProfileDiskSupportedInterfaces(**bare_metal_server_profile_disk_supported_interfaces_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_disk_supported_interfaces_model == bare_metal_server_profile_disk_supported_interfaces_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_disk_supported_interfaces_model_json2 = bare_metal_server_profile_disk_supported_interfaces_model.to_dict()
+ assert bare_metal_server_profile_disk_supported_interfaces_model_json2 == bare_metal_server_profile_disk_supported_interfaces_model_json
+
+class TestModel_BareMetalServerProfileOSArchitecture():
+ """
+ Test Class for BareMetalServerProfileOSArchitecture
+ """
+
+ def test_bare_metal_server_profile_os_architecture_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileOSArchitecture
+ """
+
+ # Construct a json representation of a BareMetalServerProfileOSArchitecture model
+ bare_metal_server_profile_os_architecture_model_json = {}
+ bare_metal_server_profile_os_architecture_model_json['default'] = 'amd64'
+ bare_metal_server_profile_os_architecture_model_json['type'] = 'enum'
+ bare_metal_server_profile_os_architecture_model_json['values'] = ['amd64']
+
+ # Construct a model instance of BareMetalServerProfileOSArchitecture by calling from_dict on the json representation
+ bare_metal_server_profile_os_architecture_model = BareMetalServerProfileOSArchitecture.from_dict(bare_metal_server_profile_os_architecture_model_json)
+ assert bare_metal_server_profile_os_architecture_model != False
+
+ # Construct a model instance of BareMetalServerProfileOSArchitecture by calling from_dict on the json representation
+ bare_metal_server_profile_os_architecture_model_dict = BareMetalServerProfileOSArchitecture.from_dict(bare_metal_server_profile_os_architecture_model_json).__dict__
+ bare_metal_server_profile_os_architecture_model2 = BareMetalServerProfileOSArchitecture(**bare_metal_server_profile_os_architecture_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_os_architecture_model == bare_metal_server_profile_os_architecture_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_os_architecture_model_json2 = bare_metal_server_profile_os_architecture_model.to_dict()
+ assert bare_metal_server_profile_os_architecture_model_json2 == bare_metal_server_profile_os_architecture_model_json
+
+class TestModel_BareMetalServerProfileReference():
+ """
+ Test Class for BareMetalServerProfileReference
+ """
+
+ def test_bare_metal_server_profile_reference_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileReference
+ """
+
+ # Construct a json representation of a BareMetalServerProfileReference model
+ bare_metal_server_profile_reference_model_json = {}
+ bare_metal_server_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768'
+ bare_metal_server_profile_reference_model_json['name'] = 'bx2-metal-192x768'
+ bare_metal_server_profile_reference_model_json['resource_type'] = 'bare_metal_server_profile'
+
+ # Construct a model instance of BareMetalServerProfileReference by calling from_dict on the json representation
+ bare_metal_server_profile_reference_model = BareMetalServerProfileReference.from_dict(bare_metal_server_profile_reference_model_json)
+ assert bare_metal_server_profile_reference_model != False
+
+ # Construct a model instance of BareMetalServerProfileReference by calling from_dict on the json representation
+ bare_metal_server_profile_reference_model_dict = BareMetalServerProfileReference.from_dict(bare_metal_server_profile_reference_model_json).__dict__
+ bare_metal_server_profile_reference_model2 = BareMetalServerProfileReference(**bare_metal_server_profile_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_reference_model == bare_metal_server_profile_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_reference_model_json2 = bare_metal_server_profile_reference_model.to_dict()
+ assert bare_metal_server_profile_reference_model_json2 == bare_metal_server_profile_reference_model_json
+
+class TestModel_BareMetalServerProfileSupportedTrustedPlatformModuleModes():
+ """
+ Test Class for BareMetalServerProfileSupportedTrustedPlatformModuleModes
+ """
+
+ def test_bare_metal_server_profile_supported_trusted_platform_module_modes_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileSupportedTrustedPlatformModuleModes
+ """
+
+ # Construct a json representation of a BareMetalServerProfileSupportedTrustedPlatformModuleModes model
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model_json = {}
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model_json['type'] = 'enum'
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model_json['values'] = ['tpm_2']
+
+ # Construct a model instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes by calling from_dict on the json representation
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(bare_metal_server_profile_supported_trusted_platform_module_modes_model_json)
+ assert bare_metal_server_profile_supported_trusted_platform_module_modes_model != False
+
+ # Construct a model instance of BareMetalServerProfileSupportedTrustedPlatformModuleModes by calling from_dict on the json representation
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model_dict = BareMetalServerProfileSupportedTrustedPlatformModuleModes.from_dict(bare_metal_server_profile_supported_trusted_platform_module_modes_model_json).__dict__
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model2 = BareMetalServerProfileSupportedTrustedPlatformModuleModes(**bare_metal_server_profile_supported_trusted_platform_module_modes_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_supported_trusted_platform_module_modes_model == bare_metal_server_profile_supported_trusted_platform_module_modes_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_supported_trusted_platform_module_modes_model_json2 = bare_metal_server_profile_supported_trusted_platform_module_modes_model.to_dict()
+ assert bare_metal_server_profile_supported_trusted_platform_module_modes_model_json2 == bare_metal_server_profile_supported_trusted_platform_module_modes_model_json
+
+class TestModel_BareMetalServerStatusReason():
+ """
+ Test Class for BareMetalServerStatusReason
+ """
+
+ def test_bare_metal_server_status_reason_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerStatusReason
+ """
+
+ # Construct a json representation of a BareMetalServerStatusReason model
+ bare_metal_server_status_reason_model_json = {}
+ bare_metal_server_status_reason_model_json['code'] = 'cannot_start_capacity'
+ bare_metal_server_status_reason_model_json['message'] = 'The bare metal server cannot start as there is no more capacity in this\nzone for a bare metal server with the requested profile.'
+ bare_metal_server_status_reason_model_json['more_info'] = 'https://console.bluemix.net/docs/iaas/bare_metal_server.html'
+
+ # Construct a model instance of BareMetalServerStatusReason by calling from_dict on the json representation
+ bare_metal_server_status_reason_model = BareMetalServerStatusReason.from_dict(bare_metal_server_status_reason_model_json)
+ assert bare_metal_server_status_reason_model != False
+
+ # Construct a model instance of BareMetalServerStatusReason by calling from_dict on the json representation
+ bare_metal_server_status_reason_model_dict = BareMetalServerStatusReason.from_dict(bare_metal_server_status_reason_model_json).__dict__
+ bare_metal_server_status_reason_model2 = BareMetalServerStatusReason(**bare_metal_server_status_reason_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_status_reason_model == bare_metal_server_status_reason_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_status_reason_model_json2 = bare_metal_server_status_reason_model.to_dict()
+ assert bare_metal_server_status_reason_model_json2 == bare_metal_server_status_reason_model_json
+
+class TestModel_BareMetalServerTrustedPlatformModule():
+ """
+ Test Class for BareMetalServerTrustedPlatformModule
+ """
+
+ def test_bare_metal_server_trusted_platform_module_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerTrustedPlatformModule
+ """
+
+ # Construct a json representation of a BareMetalServerTrustedPlatformModule model
+ bare_metal_server_trusted_platform_module_model_json = {}
+ bare_metal_server_trusted_platform_module_model_json['enabled'] = True
+ bare_metal_server_trusted_platform_module_model_json['mode'] = 'tpm_2'
+
+ # Construct a model instance of BareMetalServerTrustedPlatformModule by calling from_dict on the json representation
+ bare_metal_server_trusted_platform_module_model = BareMetalServerTrustedPlatformModule.from_dict(bare_metal_server_trusted_platform_module_model_json)
+ assert bare_metal_server_trusted_platform_module_model != False
+
+ # Construct a model instance of BareMetalServerTrustedPlatformModule by calling from_dict on the json representation
+ bare_metal_server_trusted_platform_module_model_dict = BareMetalServerTrustedPlatformModule.from_dict(bare_metal_server_trusted_platform_module_model_json).__dict__
+ bare_metal_server_trusted_platform_module_model2 = BareMetalServerTrustedPlatformModule(**bare_metal_server_trusted_platform_module_model_dict)
+
+ # Verify the model instances are equivalent
+ assert bare_metal_server_trusted_platform_module_model == bare_metal_server_trusted_platform_module_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_trusted_platform_module_model_json2 = bare_metal_server_trusted_platform_module_model.to_dict()
+ assert bare_metal_server_trusted_platform_module_model_json2 == bare_metal_server_trusted_platform_module_model_json
+
+class TestModel_CertificateInstanceReference():
+ """
+ Test Class for CertificateInstanceReference
+ """
+
+ def test_certificate_instance_reference_serialization(self):
+ """
+ Test serialization/deserialization for CertificateInstanceReference
+ """
+
+ # Construct a json representation of a CertificateInstanceReference model
+ certificate_instance_reference_model_json = {}
+ certificate_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
+
+ # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation
+ certificate_instance_reference_model = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json)
+ assert certificate_instance_reference_model != False
+
+ # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation
+ certificate_instance_reference_model_dict = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json).__dict__
+ certificate_instance_reference_model2 = CertificateInstanceReference(**certificate_instance_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert certificate_instance_reference_model == certificate_instance_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ certificate_instance_reference_model_json2 = certificate_instance_reference_model.to_dict()
+ assert certificate_instance_reference_model_json2 == certificate_instance_reference_model_json
+
+class TestModel_CloudObjectStorageBucketReference():
+ """
+ Test Class for CloudObjectStorageBucketReference
+ """
+
+ def test_cloud_object_storage_bucket_reference_serialization(self):
+ """
+ Test serialization/deserialization for CloudObjectStorageBucketReference
+ """
+
+ # Construct a json representation of a CloudObjectStorageBucketReference model
+ cloud_object_storage_bucket_reference_model_json = {}
+ cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue'
+
+ # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation
+ cloud_object_storage_bucket_reference_model = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json)
+ assert cloud_object_storage_bucket_reference_model != False
+
+ # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation
+ cloud_object_storage_bucket_reference_model_dict = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json).__dict__
+ cloud_object_storage_bucket_reference_model2 = CloudObjectStorageBucketReference(**cloud_object_storage_bucket_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert cloud_object_storage_bucket_reference_model == cloud_object_storage_bucket_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ cloud_object_storage_bucket_reference_model_json2 = cloud_object_storage_bucket_reference_model.to_dict()
+ assert cloud_object_storage_bucket_reference_model_json2 == cloud_object_storage_bucket_reference_model_json
+
+class TestModel_DedicatedHost():
+ """
+ Test Class for DedicatedHost
+ """
+
+ def test_dedicated_host_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHost
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ vcpu_model = {} # VCPU
+ vcpu_model['architecture'] = 'amd64'
+ vcpu_model['count'] = 4
+
+ instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
+ instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_disk_reference_model = {} # InstanceDiskReference
+ instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model
+ instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model['name'] = 'my-instance-disk'
+ instance_disk_reference_model['resource_type'] = 'instance_disk'
+
+ dedicated_host_disk_model = {} # DedicatedHostDisk
+ dedicated_host_disk_model['available'] = 38
+ dedicated_host_disk_model['created_at'] = "2019-01-01T12:00:00Z"
+ dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model]
+ dedicated_host_disk_model['interface_type'] = 'nvme'
+ dedicated_host_disk_model['lifecycle_state'] = 'stable'
+ dedicated_host_disk_model['name'] = 'my-dedicated-host-disk'
+ dedicated_host_disk_model['provisionable'] = True
+ dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk'
+ dedicated_host_disk_model['size'] = 38
+ dedicated_host_disk_model['supported_instance_interface_types'] = ['nvme']
+
+ dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
+ dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ dedicated_host_group_reference_model = {} # DedicatedHostGroupReference
+ dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_reference_model['deleted'] = dedicated_host_group_reference_deleted_model
+ dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_reference_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_reference_model['name'] = 'my-host-group'
+ dedicated_host_group_reference_model['resource_type'] = 'dedicated_host_group'
+
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_reference_model = {} # InstanceReference
+ instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['deleted'] = instance_reference_deleted_model
+ instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['name'] = 'my-instance'
+
+ dedicated_host_profile_reference_model = {} # DedicatedHostProfileReference
+ dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_profile_reference_model['name'] = 'mx2-host-152x1216'
+
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
+
+ instance_profile_reference_model = {} # InstanceProfileReference
+ instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
+ instance_profile_reference_model['name'] = 'bc1-4x16'
+
+ 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 DedicatedHost model
+ dedicated_host_model_json = {}
+ dedicated_host_model_json['available_memory'] = 128
+ dedicated_host_model_json['available_vcpu'] = vcpu_model
+ dedicated_host_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ dedicated_host_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_model_json['disks'] = [dedicated_host_disk_model]
+ dedicated_host_model_json['group'] = dedicated_host_group_reference_model
+ dedicated_host_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_model_json['instance_placement_enabled'] = True
+ dedicated_host_model_json['instances'] = [instance_reference_model]
+ dedicated_host_model_json['lifecycle_state'] = 'stable'
+ dedicated_host_model_json['memory'] = 128
+ dedicated_host_model_json['name'] = 'my-host'
+ dedicated_host_model_json['profile'] = dedicated_host_profile_reference_model
+ dedicated_host_model_json['provisionable'] = True
+ dedicated_host_model_json['resource_group'] = resource_group_reference_model
+ dedicated_host_model_json['resource_type'] = 'dedicated_host'
+ dedicated_host_model_json['socket_count'] = 4
+ dedicated_host_model_json['state'] = 'available'
+ dedicated_host_model_json['supported_instance_profiles'] = [instance_profile_reference_model]
+ dedicated_host_model_json['vcpu'] = vcpu_model
+ dedicated_host_model_json['zone'] = zone_reference_model
+
+ # Construct a model instance of DedicatedHost by calling from_dict on the json representation
+ dedicated_host_model = DedicatedHost.from_dict(dedicated_host_model_json)
+ assert dedicated_host_model != False
+
+ # Construct a model instance of DedicatedHost by calling from_dict on the json representation
+ dedicated_host_model_dict = DedicatedHost.from_dict(dedicated_host_model_json).__dict__
+ dedicated_host_model2 = DedicatedHost(**dedicated_host_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_model == dedicated_host_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_model_json2 = dedicated_host_model.to_dict()
+ assert dedicated_host_model_json2 == dedicated_host_model_json
+
+class TestModel_DedicatedHostCollection():
+ """
+ Test Class for DedicatedHostCollection
+ """
+
+ def test_dedicated_host_collection_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ vcpu_model = {} # VCPU
+ vcpu_model['architecture'] = 'amd64'
+ vcpu_model['count'] = 4
+
+ instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
+ instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_disk_reference_model = {} # InstanceDiskReference
+ instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model
+ instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model['name'] = 'my-instance-disk'
+ instance_disk_reference_model['resource_type'] = 'instance_disk'
+
+ dedicated_host_disk_model = {} # DedicatedHostDisk
+ dedicated_host_disk_model['available'] = 38
+ dedicated_host_disk_model['created_at'] = "2019-01-01T12:00:00Z"
+ dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model]
+ dedicated_host_disk_model['interface_type'] = 'nvme'
+ dedicated_host_disk_model['lifecycle_state'] = 'stable'
+ dedicated_host_disk_model['name'] = 'my-dedicated-host-disk'
+ dedicated_host_disk_model['provisionable'] = True
+ dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk'
+ dedicated_host_disk_model['size'] = 38
+ dedicated_host_disk_model['supported_instance_interface_types'] = ['nvme']
+
+ dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
+ dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ dedicated_host_group_reference_model = {} # DedicatedHostGroupReference
+ dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_reference_model['deleted'] = dedicated_host_group_reference_deleted_model
+ dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_reference_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_reference_model['name'] = 'my-host-group'
+ dedicated_host_group_reference_model['resource_type'] = 'dedicated_host_group'
+
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_reference_model = {} # InstanceReference
+ instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['deleted'] = instance_reference_deleted_model
+ instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['name'] = 'my-instance'
+
+ dedicated_host_profile_reference_model = {} # DedicatedHostProfileReference
+ dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_profile_reference_model['name'] = 'mx2-host-152x1216'
+
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
+
+ instance_profile_reference_model = {} # InstanceProfileReference
+ instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
+ instance_profile_reference_model['name'] = 'bc1-4x16'
+
+ 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'
+
+ dedicated_host_model = {} # DedicatedHost
+ dedicated_host_model['available_memory'] = 128
+ dedicated_host_model['available_vcpu'] = vcpu_model
+ dedicated_host_model['created_at'] = "2019-01-01T12:00:00Z"
+ dedicated_host_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_model['disks'] = [dedicated_host_disk_model]
+ dedicated_host_model['group'] = dedicated_host_group_reference_model
+ dedicated_host_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_model['instance_placement_enabled'] = True
+ dedicated_host_model['instances'] = [instance_reference_model]
+ dedicated_host_model['lifecycle_state'] = 'stable'
+ dedicated_host_model['memory'] = 128
+ dedicated_host_model['name'] = 'my-host'
+ dedicated_host_model['profile'] = dedicated_host_profile_reference_model
+ dedicated_host_model['provisionable'] = True
+ dedicated_host_model['resource_group'] = resource_group_reference_model
+ dedicated_host_model['resource_type'] = 'dedicated_host'
+ dedicated_host_model['socket_count'] = 4
+ dedicated_host_model['state'] = 'available'
+ dedicated_host_model['supported_instance_profiles'] = [instance_profile_reference_model]
+ dedicated_host_model['vcpu'] = vcpu_model
+ dedicated_host_model['zone'] = zone_reference_model
+
+ dedicated_host_collection_first_model = {} # DedicatedHostCollectionFirst
+ dedicated_host_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20'
+
+ dedicated_host_collection_next_model = {} # DedicatedHostCollectionNext
+ dedicated_host_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a json representation of a DedicatedHostCollection model
+ dedicated_host_collection_model_json = {}
+ dedicated_host_collection_model_json['dedicated_hosts'] = [dedicated_host_model]
+ dedicated_host_collection_model_json['first'] = dedicated_host_collection_first_model
+ dedicated_host_collection_model_json['limit'] = 20
+ dedicated_host_collection_model_json['next'] = dedicated_host_collection_next_model
+ dedicated_host_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of DedicatedHostCollection by calling from_dict on the json representation
+ dedicated_host_collection_model = DedicatedHostCollection.from_dict(dedicated_host_collection_model_json)
+ assert dedicated_host_collection_model != False
+
+ # Construct a model instance of DedicatedHostCollection by calling from_dict on the json representation
+ dedicated_host_collection_model_dict = DedicatedHostCollection.from_dict(dedicated_host_collection_model_json).__dict__
+ dedicated_host_collection_model2 = DedicatedHostCollection(**dedicated_host_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_collection_model == dedicated_host_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_collection_model_json2 = dedicated_host_collection_model.to_dict()
+ assert dedicated_host_collection_model_json2 == dedicated_host_collection_model_json
+
+class TestModel_DedicatedHostCollectionFirst():
+ """
+ Test Class for DedicatedHostCollectionFirst
+ """
+
+ def test_dedicated_host_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostCollectionFirst
+ """
+
+ # Construct a json representation of a DedicatedHostCollectionFirst model
+ dedicated_host_collection_first_model_json = {}
+ dedicated_host_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20'
+
+ # Construct a model instance of DedicatedHostCollectionFirst by calling from_dict on the json representation
+ dedicated_host_collection_first_model = DedicatedHostCollectionFirst.from_dict(dedicated_host_collection_first_model_json)
+ assert dedicated_host_collection_first_model != False
+
+ # Construct a model instance of DedicatedHostCollectionFirst by calling from_dict on the json representation
+ dedicated_host_collection_first_model_dict = DedicatedHostCollectionFirst.from_dict(dedicated_host_collection_first_model_json).__dict__
+ dedicated_host_collection_first_model2 = DedicatedHostCollectionFirst(**dedicated_host_collection_first_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_collection_first_model == dedicated_host_collection_first_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_collection_first_model_json2 = dedicated_host_collection_first_model.to_dict()
+ assert dedicated_host_collection_first_model_json2 == dedicated_host_collection_first_model_json
+
+class TestModel_DedicatedHostCollectionNext():
+ """
+ Test Class for DedicatedHostCollectionNext
+ """
+
+ def test_dedicated_host_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostCollectionNext
+ """
+
+ # Construct a json representation of a DedicatedHostCollectionNext model
+ dedicated_host_collection_next_model_json = {}
+ dedicated_host_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a model instance of DedicatedHostCollectionNext by calling from_dict on the json representation
+ dedicated_host_collection_next_model = DedicatedHostCollectionNext.from_dict(dedicated_host_collection_next_model_json)
+ assert dedicated_host_collection_next_model != False
+
+ # Construct a model instance of DedicatedHostCollectionNext by calling from_dict on the json representation
+ dedicated_host_collection_next_model_dict = DedicatedHostCollectionNext.from_dict(dedicated_host_collection_next_model_json).__dict__
+ dedicated_host_collection_next_model2 = DedicatedHostCollectionNext(**dedicated_host_collection_next_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_collection_next_model == dedicated_host_collection_next_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_collection_next_model_json2 = dedicated_host_collection_next_model.to_dict()
+ assert dedicated_host_collection_next_model_json2 == dedicated_host_collection_next_model_json
+
+class TestModel_DedicatedHostDisk():
+ """
+ Test Class for DedicatedHostDisk
+ """
+
+ def test_dedicated_host_disk_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostDisk
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
+ instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_disk_reference_model = {} # InstanceDiskReference
+ instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model
+ instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model['name'] = 'my-instance-disk'
+ instance_disk_reference_model['resource_type'] = 'instance_disk'
+
+ # Construct a json representation of a DedicatedHostDisk model
+ dedicated_host_disk_model_json = {}
+ dedicated_host_disk_model_json['available'] = 38
+ dedicated_host_disk_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ dedicated_host_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ dedicated_host_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ dedicated_host_disk_model_json['instance_disks'] = [instance_disk_reference_model]
+ dedicated_host_disk_model_json['interface_type'] = 'nvme'
+ dedicated_host_disk_model_json['lifecycle_state'] = 'stable'
+ dedicated_host_disk_model_json['name'] = 'my-dedicated-host-disk'
+ dedicated_host_disk_model_json['provisionable'] = True
+ dedicated_host_disk_model_json['resource_type'] = 'dedicated_host_disk'
+ dedicated_host_disk_model_json['size'] = 38
+ dedicated_host_disk_model_json['supported_instance_interface_types'] = ['nvme']
+
+ # Construct a model instance of DedicatedHostDisk by calling from_dict on the json representation
+ dedicated_host_disk_model = DedicatedHostDisk.from_dict(dedicated_host_disk_model_json)
+ assert dedicated_host_disk_model != False
+
+ # Construct a model instance of DedicatedHostDisk by calling from_dict on the json representation
+ dedicated_host_disk_model_dict = DedicatedHostDisk.from_dict(dedicated_host_disk_model_json).__dict__
+ dedicated_host_disk_model2 = DedicatedHostDisk(**dedicated_host_disk_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_disk_model == dedicated_host_disk_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_disk_model_json2 = dedicated_host_disk_model.to_dict()
+ assert dedicated_host_disk_model_json2 == dedicated_host_disk_model_json
+
+class TestModel_DedicatedHostDiskCollection():
+ """
+ Test Class for DedicatedHostDiskCollection
+ """
+
+ def test_dedicated_host_disk_collection_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostDiskCollection
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
+ instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_disk_reference_model = {} # InstanceDiskReference
+ instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model
+ instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model['name'] = 'my-instance-disk'
+ instance_disk_reference_model['resource_type'] = 'instance_disk'
+
+ dedicated_host_disk_model = {} # DedicatedHostDisk
+ dedicated_host_disk_model['available'] = 38
+ dedicated_host_disk_model['created_at'] = "2019-01-01T12:00:00Z"
+ dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model]
+ dedicated_host_disk_model['interface_type'] = 'nvme'
+ dedicated_host_disk_model['lifecycle_state'] = 'stable'
+ dedicated_host_disk_model['name'] = 'my-dedicated-host-disk'
+ dedicated_host_disk_model['provisionable'] = True
+ dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk'
+ dedicated_host_disk_model['size'] = 38
+ dedicated_host_disk_model['supported_instance_interface_types'] = ['nvme']
+
+ # Construct a json representation of a DedicatedHostDiskCollection model
+ dedicated_host_disk_collection_model_json = {}
+ dedicated_host_disk_collection_model_json['disks'] = [dedicated_host_disk_model]
+
+ # Construct a model instance of DedicatedHostDiskCollection by calling from_dict on the json representation
+ dedicated_host_disk_collection_model = DedicatedHostDiskCollection.from_dict(dedicated_host_disk_collection_model_json)
+ assert dedicated_host_disk_collection_model != False
+
+ # Construct a model instance of DedicatedHostDiskCollection by calling from_dict on the json representation
+ dedicated_host_disk_collection_model_dict = DedicatedHostDiskCollection.from_dict(dedicated_host_disk_collection_model_json).__dict__
+ dedicated_host_disk_collection_model2 = DedicatedHostDiskCollection(**dedicated_host_disk_collection_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_disk_collection_model == dedicated_host_disk_collection_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_disk_collection_model_json2 = dedicated_host_disk_collection_model.to_dict()
+ assert dedicated_host_disk_collection_model_json2 == dedicated_host_disk_collection_model_json
+
+class TestModel_DedicatedHostDiskPatch():
+ """
+ Test Class for DedicatedHostDiskPatch
+ """
+
+ def test_dedicated_host_disk_patch_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostDiskPatch
+ """
+
+ # Construct a json representation of a DedicatedHostDiskPatch model
+ dedicated_host_disk_patch_model_json = {}
+ dedicated_host_disk_patch_model_json['name'] = 'my-disk-updated'
+
+ # Construct a model instance of DedicatedHostDiskPatch by calling from_dict on the json representation
+ dedicated_host_disk_patch_model = DedicatedHostDiskPatch.from_dict(dedicated_host_disk_patch_model_json)
+ assert dedicated_host_disk_patch_model != False
+
+ # Construct a model instance of DedicatedHostDiskPatch by calling from_dict on the json representation
+ dedicated_host_disk_patch_model_dict = DedicatedHostDiskPatch.from_dict(dedicated_host_disk_patch_model_json).__dict__
+ dedicated_host_disk_patch_model2 = DedicatedHostDiskPatch(**dedicated_host_disk_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_disk_patch_model == dedicated_host_disk_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_disk_patch_model_json2 = dedicated_host_disk_patch_model.to_dict()
+ assert dedicated_host_disk_patch_model_json2 == dedicated_host_disk_patch_model_json
+
+class TestModel_DedicatedHostGroup():
+ """
+ Test Class for DedicatedHostGroup
+ """
+
+ def test_dedicated_host_group_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroup
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
+ dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ dedicated_host_reference_model = {} # DedicatedHostReference
+ dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model
+ dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model['name'] = 'my-host'
+ dedicated_host_reference_model['resource_type'] = 'dedicated_host'
+
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
+
+ instance_profile_reference_model = {} # InstanceProfileReference
+ instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
+ instance_profile_reference_model['name'] = 'bc1-4x16'
+
+ 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'
-##############################################################################
-# Start of Model Tests
-##############################################################################
-# region
-class TestModel_AddressPrefix():
+ # Construct a json representation of a DedicatedHostGroup model
+ dedicated_host_group_model_json = {}
+ dedicated_host_group_model_json['class'] = 'mx2'
+ dedicated_host_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ dedicated_host_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_model_json['dedicated_hosts'] = [dedicated_host_reference_model]
+ dedicated_host_group_model_json['family'] = 'balanced'
+ dedicated_host_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_model_json['name'] = 'my-host-group'
+ dedicated_host_group_model_json['resource_group'] = resource_group_reference_model
+ dedicated_host_group_model_json['resource_type'] = 'dedicated_host_group'
+ dedicated_host_group_model_json['supported_instance_profiles'] = [instance_profile_reference_model]
+ dedicated_host_group_model_json['zone'] = zone_reference_model
+
+ # Construct a model instance of DedicatedHostGroup by calling from_dict on the json representation
+ dedicated_host_group_model = DedicatedHostGroup.from_dict(dedicated_host_group_model_json)
+ assert dedicated_host_group_model != False
+
+ # Construct a model instance of DedicatedHostGroup by calling from_dict on the json representation
+ dedicated_host_group_model_dict = DedicatedHostGroup.from_dict(dedicated_host_group_model_json).__dict__
+ dedicated_host_group_model2 = DedicatedHostGroup(**dedicated_host_group_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_group_model == dedicated_host_group_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_group_model_json2 = dedicated_host_group_model.to_dict()
+ assert dedicated_host_group_model_json2 == dedicated_host_group_model_json
+
+class TestModel_DedicatedHostGroupCollection():
"""
- Test Class for AddressPrefix
+ Test Class for DedicatedHostGroupCollection
"""
- def test_address_prefix_serialization(self):
+ def test_dedicated_host_group_collection_serialization(self):
"""
- Test serialization/deserialization for AddressPrefix
+ Test serialization/deserialization for DedicatedHostGroupCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
+ dedicated_host_group_collection_first_model = {} # DedicatedHostGroupCollectionFirst
+ dedicated_host_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20'
+
+ dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
+ dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ dedicated_host_reference_model = {} # DedicatedHostReference
+ dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model
+ dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model['name'] = 'my-host'
+ dedicated_host_reference_model['resource_type'] = 'dedicated_host'
+
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
+
+ instance_profile_reference_model = {} # InstanceProfileReference
+ instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
+ instance_profile_reference_model['name'] = 'bc1-4x16'
+
zone_reference_model = {} # ZoneReference
zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
zone_reference_model['name'] = 'us-south-1'
- # Construct a json representation of a AddressPrefix model
- address_prefix_model_json = {}
- address_prefix_model_json['cidr'] = '192.168.3.0/24'
- address_prefix_model_json['created_at'] = "2019-01-01T12:00:00Z"
- address_prefix_model_json['has_subnets'] = True
- address_prefix_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- address_prefix_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- address_prefix_model_json['is_default'] = False
- address_prefix_model_json['name'] = 'my-address-prefix-2'
- address_prefix_model_json['zone'] = zone_reference_model
+ dedicated_host_group_model = {} # DedicatedHostGroup
+ dedicated_host_group_model['class'] = 'mx2'
+ dedicated_host_group_model['created_at'] = "2019-01-01T12:00:00Z"
+ dedicated_host_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_model['dedicated_hosts'] = [dedicated_host_reference_model]
+ dedicated_host_group_model['family'] = 'balanced'
+ dedicated_host_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_model['name'] = 'my-host-group'
+ dedicated_host_group_model['resource_group'] = resource_group_reference_model
+ dedicated_host_group_model['resource_type'] = 'dedicated_host_group'
+ dedicated_host_group_model['supported_instance_profiles'] = [instance_profile_reference_model]
+ dedicated_host_group_model['zone'] = zone_reference_model
- # Construct a model instance of AddressPrefix by calling from_dict on the json representation
- address_prefix_model = AddressPrefix.from_dict(address_prefix_model_json)
- assert address_prefix_model != False
+ dedicated_host_group_collection_next_model = {} # DedicatedHostGroupCollectionNext
+ dedicated_host_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of AddressPrefix by calling from_dict on the json representation
- address_prefix_model_dict = AddressPrefix.from_dict(address_prefix_model_json).__dict__
- address_prefix_model2 = AddressPrefix(**address_prefix_model_dict)
+ # Construct a json representation of a DedicatedHostGroupCollection model
+ dedicated_host_group_collection_model_json = {}
+ dedicated_host_group_collection_model_json['first'] = dedicated_host_group_collection_first_model
+ dedicated_host_group_collection_model_json['groups'] = [dedicated_host_group_model]
+ dedicated_host_group_collection_model_json['limit'] = 20
+ dedicated_host_group_collection_model_json['next'] = dedicated_host_group_collection_next_model
+ dedicated_host_group_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of DedicatedHostGroupCollection by calling from_dict on the json representation
+ dedicated_host_group_collection_model = DedicatedHostGroupCollection.from_dict(dedicated_host_group_collection_model_json)
+ assert dedicated_host_group_collection_model != False
+
+ # Construct a model instance of DedicatedHostGroupCollection by calling from_dict on the json representation
+ dedicated_host_group_collection_model_dict = DedicatedHostGroupCollection.from_dict(dedicated_host_group_collection_model_json).__dict__
+ dedicated_host_group_collection_model2 = DedicatedHostGroupCollection(**dedicated_host_group_collection_model_dict)
# Verify the model instances are equivalent
- assert address_prefix_model == address_prefix_model2
+ assert dedicated_host_group_collection_model == dedicated_host_group_collection_model2
# Convert model instance back to dict and verify no loss of data
- address_prefix_model_json2 = address_prefix_model.to_dict()
- assert address_prefix_model_json2 == address_prefix_model_json
+ dedicated_host_group_collection_model_json2 = dedicated_host_group_collection_model.to_dict()
+ assert dedicated_host_group_collection_model_json2 == dedicated_host_group_collection_model_json
-class TestModel_AddressPrefixCollection():
+class TestModel_DedicatedHostGroupCollectionFirst():
"""
- Test Class for AddressPrefixCollection
+ Test Class for DedicatedHostGroupCollectionFirst
"""
- def test_address_prefix_collection_serialization(self):
+ def test_dedicated_host_group_collection_first_serialization(self):
"""
- Test serialization/deserialization for AddressPrefixCollection
+ Test serialization/deserialization for DedicatedHostGroupCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a DedicatedHostGroupCollectionFirst model
+ dedicated_host_group_collection_first_model_json = {}
+ dedicated_host_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20'
- 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 model instance of DedicatedHostGroupCollectionFirst by calling from_dict on the json representation
+ dedicated_host_group_collection_first_model = DedicatedHostGroupCollectionFirst.from_dict(dedicated_host_group_collection_first_model_json)
+ assert dedicated_host_group_collection_first_model != False
- address_prefix_model = {} # AddressPrefix
- address_prefix_model['cidr'] = '192.168.3.0/24'
- address_prefix_model['created_at'] = "2019-01-01T12:00:00Z"
- address_prefix_model['has_subnets'] = True
- address_prefix_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/address_prefixes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- address_prefix_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- address_prefix_model['is_default'] = False
- address_prefix_model['name'] = 'my-address-prefix-2'
- address_prefix_model['zone'] = zone_reference_model
+ # Construct a model instance of DedicatedHostGroupCollectionFirst by calling from_dict on the json representation
+ dedicated_host_group_collection_first_model_dict = DedicatedHostGroupCollectionFirst.from_dict(dedicated_host_group_collection_first_model_json).__dict__
+ dedicated_host_group_collection_first_model2 = DedicatedHostGroupCollectionFirst(**dedicated_host_group_collection_first_model_dict)
- address_prefix_collection_first_model = {} # AddressPrefixCollectionFirst
- address_prefix_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20'
+ # Verify the model instances are equivalent
+ assert dedicated_host_group_collection_first_model == dedicated_host_group_collection_first_model2
- address_prefix_collection_next_model = {} # AddressPrefixCollectionNext
- address_prefix_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_group_collection_first_model_json2 = dedicated_host_group_collection_first_model.to_dict()
+ assert dedicated_host_group_collection_first_model_json2 == dedicated_host_group_collection_first_model_json
- # Construct a json representation of a AddressPrefixCollection model
- address_prefix_collection_model_json = {}
- address_prefix_collection_model_json['address_prefixes'] = [address_prefix_model]
- address_prefix_collection_model_json['first'] = address_prefix_collection_first_model
- address_prefix_collection_model_json['limit'] = 20
- address_prefix_collection_model_json['next'] = address_prefix_collection_next_model
- address_prefix_collection_model_json['total_count'] = 132
+class TestModel_DedicatedHostGroupCollectionNext():
+ """
+ Test Class for DedicatedHostGroupCollectionNext
+ """
- # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation
- address_prefix_collection_model = AddressPrefixCollection.from_dict(address_prefix_collection_model_json)
- assert address_prefix_collection_model != False
+ def test_dedicated_host_group_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostGroupCollectionNext
+ """
- # Construct a model instance of AddressPrefixCollection by calling from_dict on the json representation
- address_prefix_collection_model_dict = AddressPrefixCollection.from_dict(address_prefix_collection_model_json).__dict__
- address_prefix_collection_model2 = AddressPrefixCollection(**address_prefix_collection_model_dict)
+ # Construct a json representation of a DedicatedHostGroupCollectionNext model
+ dedicated_host_group_collection_next_model_json = {}
+ dedicated_host_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a model instance of DedicatedHostGroupCollectionNext by calling from_dict on the json representation
+ dedicated_host_group_collection_next_model = DedicatedHostGroupCollectionNext.from_dict(dedicated_host_group_collection_next_model_json)
+ assert dedicated_host_group_collection_next_model != False
+
+ # Construct a model instance of DedicatedHostGroupCollectionNext by calling from_dict on the json representation
+ dedicated_host_group_collection_next_model_dict = DedicatedHostGroupCollectionNext.from_dict(dedicated_host_group_collection_next_model_json).__dict__
+ dedicated_host_group_collection_next_model2 = DedicatedHostGroupCollectionNext(**dedicated_host_group_collection_next_model_dict)
# Verify the model instances are equivalent
- assert address_prefix_collection_model == address_prefix_collection_model2
+ assert dedicated_host_group_collection_next_model == dedicated_host_group_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- address_prefix_collection_model_json2 = address_prefix_collection_model.to_dict()
- assert address_prefix_collection_model_json2 == address_prefix_collection_model_json
+ dedicated_host_group_collection_next_model_json2 = dedicated_host_group_collection_next_model.to_dict()
+ assert dedicated_host_group_collection_next_model_json2 == dedicated_host_group_collection_next_model_json
-class TestModel_AddressPrefixCollectionFirst():
+class TestModel_DedicatedHostGroupPatch():
"""
- Test Class for AddressPrefixCollectionFirst
+ Test Class for DedicatedHostGroupPatch
"""
- def test_address_prefix_collection_first_serialization(self):
+ def test_dedicated_host_group_patch_serialization(self):
"""
- Test serialization/deserialization for AddressPrefixCollectionFirst
+ Test serialization/deserialization for DedicatedHostGroupPatch
"""
- # Construct a json representation of a AddressPrefixCollectionFirst model
- address_prefix_collection_first_model_json = {}
- address_prefix_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?limit=20'
+ # Construct a json representation of a DedicatedHostGroupPatch model
+ dedicated_host_group_patch_model_json = {}
+ dedicated_host_group_patch_model_json['name'] = 'my-host-group'
- # Construct a model instance of AddressPrefixCollectionFirst by calling from_dict on the json representation
- address_prefix_collection_first_model = AddressPrefixCollectionFirst.from_dict(address_prefix_collection_first_model_json)
- assert address_prefix_collection_first_model != False
+ # Construct a model instance of DedicatedHostGroupPatch by calling from_dict on the json representation
+ dedicated_host_group_patch_model = DedicatedHostGroupPatch.from_dict(dedicated_host_group_patch_model_json)
+ assert dedicated_host_group_patch_model != False
- # Construct a model instance of AddressPrefixCollectionFirst by calling from_dict on the json representation
- address_prefix_collection_first_model_dict = AddressPrefixCollectionFirst.from_dict(address_prefix_collection_first_model_json).__dict__
- address_prefix_collection_first_model2 = AddressPrefixCollectionFirst(**address_prefix_collection_first_model_dict)
+ # Construct a model instance of DedicatedHostGroupPatch by calling from_dict on the json representation
+ dedicated_host_group_patch_model_dict = DedicatedHostGroupPatch.from_dict(dedicated_host_group_patch_model_json).__dict__
+ dedicated_host_group_patch_model2 = DedicatedHostGroupPatch(**dedicated_host_group_patch_model_dict)
# Verify the model instances are equivalent
- assert address_prefix_collection_first_model == address_prefix_collection_first_model2
+ assert dedicated_host_group_patch_model == dedicated_host_group_patch_model2
# Convert model instance back to dict and verify no loss of data
- address_prefix_collection_first_model_json2 = address_prefix_collection_first_model.to_dict()
- assert address_prefix_collection_first_model_json2 == address_prefix_collection_first_model_json
+ dedicated_host_group_patch_model_json2 = dedicated_host_group_patch_model.to_dict()
+ assert dedicated_host_group_patch_model_json2 == dedicated_host_group_patch_model_json
-class TestModel_AddressPrefixCollectionNext():
+class TestModel_DedicatedHostGroupPrototypeDedicatedHostByZoneContext():
"""
- Test Class for AddressPrefixCollectionNext
+ Test Class for DedicatedHostGroupPrototypeDedicatedHostByZoneContext
"""
- def test_address_prefix_collection_next_serialization(self):
+ def test_dedicated_host_group_prototype_dedicated_host_by_zone_context_serialization(self):
"""
- Test serialization/deserialization for AddressPrefixCollectionNext
+ Test serialization/deserialization for DedicatedHostGroupPrototypeDedicatedHostByZoneContext
"""
- # Construct a json representation of a AddressPrefixCollectionNext model
- address_prefix_collection_next_model_json = {}
- address_prefix_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/a4e28308-8ee7-46ab-8108-9f881f22bdbf/address_prefixes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of AddressPrefixCollectionNext by calling from_dict on the json representation
- address_prefix_collection_next_model = AddressPrefixCollectionNext.from_dict(address_prefix_collection_next_model_json)
- assert address_prefix_collection_next_model != False
+ resource_group_identity_model = {} # ResourceGroupIdentityById
+ resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- # Construct a model instance of AddressPrefixCollectionNext by calling from_dict on the json representation
- address_prefix_collection_next_model_dict = AddressPrefixCollectionNext.from_dict(address_prefix_collection_next_model_json).__dict__
- address_prefix_collection_next_model2 = AddressPrefixCollectionNext(**address_prefix_collection_next_model_dict)
+ # Construct a json representation of a DedicatedHostGroupPrototypeDedicatedHostByZoneContext model
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json = {}
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json['name'] = 'my-host-group'
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json['resource_group'] = resource_group_identity_model
+
+ # Construct a model instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext by calling from_dict on the json representation
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json)
+ assert dedicated_host_group_prototype_dedicated_host_by_zone_context_model != False
+
+ # Construct a model instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext by calling from_dict on the json representation
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model_dict = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json).__dict__
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model2 = DedicatedHostGroupPrototypeDedicatedHostByZoneContext(**dedicated_host_group_prototype_dedicated_host_by_zone_context_model_dict)
# Verify the model instances are equivalent
- assert address_prefix_collection_next_model == address_prefix_collection_next_model2
+ assert dedicated_host_group_prototype_dedicated_host_by_zone_context_model == dedicated_host_group_prototype_dedicated_host_by_zone_context_model2
# Convert model instance back to dict and verify no loss of data
- address_prefix_collection_next_model_json2 = address_prefix_collection_next_model.to_dict()
- assert address_prefix_collection_next_model_json2 == address_prefix_collection_next_model_json
+ dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json2 = dedicated_host_group_prototype_dedicated_host_by_zone_context_model.to_dict()
+ assert dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json2 == dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json
-class TestModel_AddressPrefixPatch():
+class TestModel_DedicatedHostGroupReference():
"""
- Test Class for AddressPrefixPatch
+ Test Class for DedicatedHostGroupReference
"""
- def test_address_prefix_patch_serialization(self):
+ def test_dedicated_host_group_reference_serialization(self):
"""
- Test serialization/deserialization for AddressPrefixPatch
+ Test serialization/deserialization for DedicatedHostGroupReference
"""
- # Construct a json representation of a AddressPrefixPatch model
- address_prefix_patch_model_json = {}
- address_prefix_patch_model_json['is_default'] = False
- address_prefix_patch_model_json['name'] = 'my-address-prefix-2'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation
- address_prefix_patch_model = AddressPrefixPatch.from_dict(address_prefix_patch_model_json)
- assert address_prefix_patch_model != False
+ dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
+ dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of AddressPrefixPatch by calling from_dict on the json representation
- address_prefix_patch_model_dict = AddressPrefixPatch.from_dict(address_prefix_patch_model_json).__dict__
- address_prefix_patch_model2 = AddressPrefixPatch(**address_prefix_patch_model_dict)
+ # Construct a json representation of a DedicatedHostGroupReference model
+ dedicated_host_group_reference_model_json = {}
+ dedicated_host_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_reference_model_json['deleted'] = dedicated_host_group_reference_deleted_model
+ dedicated_host_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_reference_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ dedicated_host_group_reference_model_json['name'] = 'my-host-group'
+ dedicated_host_group_reference_model_json['resource_type'] = 'dedicated_host_group'
+
+ # Construct a model instance of DedicatedHostGroupReference by calling from_dict on the json representation
+ dedicated_host_group_reference_model = DedicatedHostGroupReference.from_dict(dedicated_host_group_reference_model_json)
+ assert dedicated_host_group_reference_model != False
+
+ # Construct a model instance of DedicatedHostGroupReference by calling from_dict on the json representation
+ dedicated_host_group_reference_model_dict = DedicatedHostGroupReference.from_dict(dedicated_host_group_reference_model_json).__dict__
+ dedicated_host_group_reference_model2 = DedicatedHostGroupReference(**dedicated_host_group_reference_model_dict)
# Verify the model instances are equivalent
- assert address_prefix_patch_model == address_prefix_patch_model2
+ assert dedicated_host_group_reference_model == dedicated_host_group_reference_model2
# Convert model instance back to dict and verify no loss of data
- address_prefix_patch_model_json2 = address_prefix_patch_model.to_dict()
- assert address_prefix_patch_model_json2 == address_prefix_patch_model_json
+ dedicated_host_group_reference_model_json2 = dedicated_host_group_reference_model.to_dict()
+ assert dedicated_host_group_reference_model_json2 == dedicated_host_group_reference_model_json
-class TestModel_CertificateInstanceReference():
+class TestModel_DedicatedHostGroupReferenceDeleted():
"""
- Test Class for CertificateInstanceReference
+ Test Class for DedicatedHostGroupReferenceDeleted
"""
- def test_certificate_instance_reference_serialization(self):
+ def test_dedicated_host_group_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for CertificateInstanceReference
+ Test serialization/deserialization for DedicatedHostGroupReferenceDeleted
"""
- # Construct a json representation of a CertificateInstanceReference model
- certificate_instance_reference_model_json = {}
- certificate_instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
+ # Construct a json representation of a DedicatedHostGroupReferenceDeleted model
+ dedicated_host_group_reference_deleted_model_json = {}
+ dedicated_host_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation
- certificate_instance_reference_model = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json)
- assert certificate_instance_reference_model != False
+ # Construct a model instance of DedicatedHostGroupReferenceDeleted by calling from_dict on the json representation
+ dedicated_host_group_reference_deleted_model = DedicatedHostGroupReferenceDeleted.from_dict(dedicated_host_group_reference_deleted_model_json)
+ assert dedicated_host_group_reference_deleted_model != False
- # Construct a model instance of CertificateInstanceReference by calling from_dict on the json representation
- certificate_instance_reference_model_dict = CertificateInstanceReference.from_dict(certificate_instance_reference_model_json).__dict__
- certificate_instance_reference_model2 = CertificateInstanceReference(**certificate_instance_reference_model_dict)
+ # Construct a model instance of DedicatedHostGroupReferenceDeleted by calling from_dict on the json representation
+ dedicated_host_group_reference_deleted_model_dict = DedicatedHostGroupReferenceDeleted.from_dict(dedicated_host_group_reference_deleted_model_json).__dict__
+ dedicated_host_group_reference_deleted_model2 = DedicatedHostGroupReferenceDeleted(**dedicated_host_group_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert certificate_instance_reference_model == certificate_instance_reference_model2
+ assert dedicated_host_group_reference_deleted_model == dedicated_host_group_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- certificate_instance_reference_model_json2 = certificate_instance_reference_model.to_dict()
- assert certificate_instance_reference_model_json2 == certificate_instance_reference_model_json
+ dedicated_host_group_reference_deleted_model_json2 = dedicated_host_group_reference_deleted_model.to_dict()
+ assert dedicated_host_group_reference_deleted_model_json2 == dedicated_host_group_reference_deleted_model_json
-class TestModel_CloudObjectStorageBucketReference():
+class TestModel_DedicatedHostPatch():
"""
- Test Class for CloudObjectStorageBucketReference
+ Test Class for DedicatedHostPatch
"""
- def test_cloud_object_storage_bucket_reference_serialization(self):
+ def test_dedicated_host_patch_serialization(self):
"""
- Test serialization/deserialization for CloudObjectStorageBucketReference
+ Test serialization/deserialization for DedicatedHostPatch
"""
- # Construct a json representation of a CloudObjectStorageBucketReference model
- cloud_object_storage_bucket_reference_model_json = {}
- cloud_object_storage_bucket_reference_model_json['name'] = 'bucket-27200-lwx4cfvcue'
+ # Construct a json representation of a DedicatedHostPatch model
+ dedicated_host_patch_model_json = {}
+ dedicated_host_patch_model_json['instance_placement_enabled'] = True
+ dedicated_host_patch_model_json['name'] = 'my-host'
- # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation
- cloud_object_storage_bucket_reference_model = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json)
- assert cloud_object_storage_bucket_reference_model != False
+ # Construct a model instance of DedicatedHostPatch by calling from_dict on the json representation
+ dedicated_host_patch_model = DedicatedHostPatch.from_dict(dedicated_host_patch_model_json)
+ assert dedicated_host_patch_model != False
- # Construct a model instance of CloudObjectStorageBucketReference by calling from_dict on the json representation
- cloud_object_storage_bucket_reference_model_dict = CloudObjectStorageBucketReference.from_dict(cloud_object_storage_bucket_reference_model_json).__dict__
- cloud_object_storage_bucket_reference_model2 = CloudObjectStorageBucketReference(**cloud_object_storage_bucket_reference_model_dict)
+ # Construct a model instance of DedicatedHostPatch by calling from_dict on the json representation
+ dedicated_host_patch_model_dict = DedicatedHostPatch.from_dict(dedicated_host_patch_model_json).__dict__
+ dedicated_host_patch_model2 = DedicatedHostPatch(**dedicated_host_patch_model_dict)
# Verify the model instances are equivalent
- assert cloud_object_storage_bucket_reference_model == cloud_object_storage_bucket_reference_model2
+ assert dedicated_host_patch_model == dedicated_host_patch_model2
# Convert model instance back to dict and verify no loss of data
- cloud_object_storage_bucket_reference_model_json2 = cloud_object_storage_bucket_reference_model.to_dict()
- assert cloud_object_storage_bucket_reference_model_json2 == cloud_object_storage_bucket_reference_model_json
+ dedicated_host_patch_model_json2 = dedicated_host_patch_model.to_dict()
+ assert dedicated_host_patch_model_json2 == dedicated_host_patch_model_json
-class TestModel_DedicatedHost():
+class TestModel_DedicatedHostProfile():
"""
- Test Class for DedicatedHost
+ Test Class for DedicatedHostProfile
"""
- def test_dedicated_host_serialization(self):
+ def test_dedicated_host_profile_serialization(self):
"""
- Test serialization/deserialization for DedicatedHost
+ Test serialization/deserialization for DedicatedHostProfile
"""
# Construct dict forms of any model objects needed in order to build this model.
- vcpu_model = {} # VCPU
- vcpu_model['architecture'] = 'amd64'
- vcpu_model['count'] = 4
-
- instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
- instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- instance_disk_reference_model = {} # InstanceDiskReference
- instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model
- instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model['name'] = 'my-instance-disk'
- instance_disk_reference_model['resource_type'] = 'instance_disk'
-
- dedicated_host_disk_model = {} # DedicatedHostDisk
- dedicated_host_disk_model['available'] = 38
- dedicated_host_disk_model['created_at'] = "2019-01-01T12:00:00Z"
- dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model]
- dedicated_host_disk_model['interface_type'] = 'nvme'
- dedicated_host_disk_model['lifecycle_state'] = 'stable'
- dedicated_host_disk_model['name'] = 'my-dedicated-host-disk'
- dedicated_host_disk_model['provisionable'] = True
- dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk'
- dedicated_host_disk_model['size'] = 38
- dedicated_host_disk_model['supported_instance_interface_types'] = ['nvme']
+ dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface
+ dedicated_host_profile_disk_interface_model['type'] = 'fixed'
+ dedicated_host_profile_disk_interface_model['value'] = 'nvme'
- dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
- dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ dedicated_host_profile_disk_quantity_model = {} # DedicatedHostProfileDiskQuantity
+ dedicated_host_profile_disk_quantity_model['type'] = 'fixed'
+ dedicated_host_profile_disk_quantity_model['value'] = 4
- dedicated_host_group_reference_model = {} # DedicatedHostGroupReference
- dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_reference_model['deleted'] = dedicated_host_group_reference_deleted_model
- dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_reference_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_reference_model['name'] = 'my-host-group'
- dedicated_host_group_reference_model['resource_type'] = 'dedicated_host_group'
+ dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize
+ dedicated_host_profile_disk_size_model['type'] = 'fixed'
+ dedicated_host_profile_disk_size_model['value'] = 3200
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ dedicated_host_profile_disk_supported_interfaces_model = {} # DedicatedHostProfileDiskSupportedInterfaces
+ dedicated_host_profile_disk_supported_interfaces_model['type'] = 'fixed'
+ dedicated_host_profile_disk_supported_interfaces_model['value'] = ['nvme']
- instance_reference_model = {} # InstanceReference
- instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['deleted'] = instance_reference_deleted_model
- instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['name'] = 'my-instance'
+ dedicated_host_profile_disk_model = {} # DedicatedHostProfileDisk
+ dedicated_host_profile_disk_model['interface_type'] = dedicated_host_profile_disk_interface_model
+ dedicated_host_profile_disk_model['quantity'] = dedicated_host_profile_disk_quantity_model
+ dedicated_host_profile_disk_model['size'] = dedicated_host_profile_disk_size_model
+ dedicated_host_profile_disk_model['supported_instance_interface_types'] = dedicated_host_profile_disk_supported_interfaces_model
- dedicated_host_profile_reference_model = {} # DedicatedHostProfileReference
- dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_profile_reference_model['name'] = 'mx2-host-152x1216'
+ dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed
+ dedicated_host_profile_memory_model['type'] = 'fixed'
+ dedicated_host_profile_memory_model['value'] = 16
- 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'
+ dedicated_host_profile_socket_model = {} # DedicatedHostProfileSocketFixed
+ dedicated_host_profile_socket_model['type'] = 'fixed'
+ dedicated_host_profile_socket_model['value'] = 2
instance_profile_reference_model = {} # InstanceProfileReference
instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
instance_profile_reference_model['name'] = 'bc1-4x16'
- 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'
+ dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture
+ dedicated_host_profile_vcpu_architecture_model['type'] = 'fixed'
+ dedicated_host_profile_vcpu_architecture_model['value'] = 'amd64'
- # Construct a json representation of a DedicatedHost model
- dedicated_host_model_json = {}
- dedicated_host_model_json['available_memory'] = 128
- dedicated_host_model_json['available_vcpu'] = vcpu_model
- dedicated_host_model_json['created_at'] = "2019-01-01T12:00:00Z"
- dedicated_host_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_model_json['disks'] = [dedicated_host_disk_model]
- dedicated_host_model_json['group'] = dedicated_host_group_reference_model
- dedicated_host_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_model_json['instance_placement_enabled'] = True
- dedicated_host_model_json['instances'] = [instance_reference_model]
- dedicated_host_model_json['lifecycle_state'] = 'stable'
- dedicated_host_model_json['memory'] = 128
- dedicated_host_model_json['name'] = 'my-host'
- dedicated_host_model_json['profile'] = dedicated_host_profile_reference_model
- dedicated_host_model_json['provisionable'] = True
- dedicated_host_model_json['resource_group'] = resource_group_reference_model
- dedicated_host_model_json['resource_type'] = 'dedicated_host'
- dedicated_host_model_json['socket_count'] = 4
- dedicated_host_model_json['state'] = 'available'
- dedicated_host_model_json['supported_instance_profiles'] = [instance_profile_reference_model]
- dedicated_host_model_json['vcpu'] = vcpu_model
- dedicated_host_model_json['zone'] = zone_reference_model
+ dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed
+ dedicated_host_profile_vcpu_model['type'] = 'fixed'
+ dedicated_host_profile_vcpu_model['value'] = 16
- # Construct a model instance of DedicatedHost by calling from_dict on the json representation
- dedicated_host_model = DedicatedHost.from_dict(dedicated_host_model_json)
- assert dedicated_host_model != False
+ # Construct a json representation of a DedicatedHostProfile model
+ dedicated_host_profile_model_json = {}
+ dedicated_host_profile_model_json['class'] = 'mx2'
+ dedicated_host_profile_model_json['disks'] = [dedicated_host_profile_disk_model]
+ dedicated_host_profile_model_json['family'] = 'balanced'
+ dedicated_host_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_profile_model_json['memory'] = dedicated_host_profile_memory_model
+ dedicated_host_profile_model_json['name'] = 'mx2-host-152x1216'
+ dedicated_host_profile_model_json['socket_count'] = dedicated_host_profile_socket_model
+ dedicated_host_profile_model_json['supported_instance_profiles'] = [instance_profile_reference_model]
+ dedicated_host_profile_model_json['vcpu_architecture'] = dedicated_host_profile_vcpu_architecture_model
+ dedicated_host_profile_model_json['vcpu_count'] = dedicated_host_profile_vcpu_model
- # Construct a model instance of DedicatedHost by calling from_dict on the json representation
- dedicated_host_model_dict = DedicatedHost.from_dict(dedicated_host_model_json).__dict__
- dedicated_host_model2 = DedicatedHost(**dedicated_host_model_dict)
+ # Construct a model instance of DedicatedHostProfile by calling from_dict on the json representation
+ dedicated_host_profile_model = DedicatedHostProfile.from_dict(dedicated_host_profile_model_json)
+ assert dedicated_host_profile_model != False
+
+ # Construct a model instance of DedicatedHostProfile by calling from_dict on the json representation
+ dedicated_host_profile_model_dict = DedicatedHostProfile.from_dict(dedicated_host_profile_model_json).__dict__
+ dedicated_host_profile_model2 = DedicatedHostProfile(**dedicated_host_profile_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_model == dedicated_host_model2
+ assert dedicated_host_profile_model == dedicated_host_profile_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_model_json2 = dedicated_host_model.to_dict()
- assert dedicated_host_model_json2 == dedicated_host_model_json
+ dedicated_host_profile_model_json2 = dedicated_host_profile_model.to_dict()
+ assert dedicated_host_profile_model_json2 == dedicated_host_profile_model_json
-class TestModel_DedicatedHostCollection():
+class TestModel_DedicatedHostProfileCollection():
"""
- Test Class for DedicatedHostCollection
+ Test Class for DedicatedHostProfileCollection
"""
- def test_dedicated_host_collection_serialization(self):
+ def test_dedicated_host_profile_collection_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostCollection
+ Test serialization/deserialization for DedicatedHostProfileCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- vcpu_model = {} # VCPU
- vcpu_model['architecture'] = 'amd64'
- vcpu_model['count'] = 4
-
- instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
- instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ dedicated_host_profile_collection_first_model = {} # DedicatedHostProfileCollectionFirst
+ dedicated_host_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20'
- instance_disk_reference_model = {} # InstanceDiskReference
- instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model
- instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model['name'] = 'my-instance-disk'
- instance_disk_reference_model['resource_type'] = 'instance_disk'
+ dedicated_host_profile_collection_next_model = {} # DedicatedHostProfileCollectionNext
+ dedicated_host_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20'
- dedicated_host_disk_model = {} # DedicatedHostDisk
- dedicated_host_disk_model['available'] = 38
- dedicated_host_disk_model['created_at'] = "2019-01-01T12:00:00Z"
- dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model]
- dedicated_host_disk_model['interface_type'] = 'nvme'
- dedicated_host_disk_model['lifecycle_state'] = 'stable'
- dedicated_host_disk_model['name'] = 'my-dedicated-host-disk'
- dedicated_host_disk_model['provisionable'] = True
- dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk'
- dedicated_host_disk_model['size'] = 38
- dedicated_host_disk_model['supported_instance_interface_types'] = ['nvme']
+ dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface
+ dedicated_host_profile_disk_interface_model['type'] = 'fixed'
+ dedicated_host_profile_disk_interface_model['value'] = 'nvme'
- dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
- dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ dedicated_host_profile_disk_quantity_model = {} # DedicatedHostProfileDiskQuantity
+ dedicated_host_profile_disk_quantity_model['type'] = 'fixed'
+ dedicated_host_profile_disk_quantity_model['value'] = 4
- dedicated_host_group_reference_model = {} # DedicatedHostGroupReference
- dedicated_host_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_reference_model['deleted'] = dedicated_host_group_reference_deleted_model
- dedicated_host_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_reference_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_reference_model['name'] = 'my-host-group'
- dedicated_host_group_reference_model['resource_type'] = 'dedicated_host_group'
+ dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize
+ dedicated_host_profile_disk_size_model['type'] = 'fixed'
+ dedicated_host_profile_disk_size_model['value'] = 3200
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ dedicated_host_profile_disk_supported_interfaces_model = {} # DedicatedHostProfileDiskSupportedInterfaces
+ dedicated_host_profile_disk_supported_interfaces_model['type'] = 'fixed'
+ dedicated_host_profile_disk_supported_interfaces_model['value'] = ['nvme']
- instance_reference_model = {} # InstanceReference
- instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['deleted'] = instance_reference_deleted_model
- instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['name'] = 'my-instance'
+ dedicated_host_profile_disk_model = {} # DedicatedHostProfileDisk
+ dedicated_host_profile_disk_model['interface_type'] = dedicated_host_profile_disk_interface_model
+ dedicated_host_profile_disk_model['quantity'] = dedicated_host_profile_disk_quantity_model
+ dedicated_host_profile_disk_model['size'] = dedicated_host_profile_disk_size_model
+ dedicated_host_profile_disk_model['supported_instance_interface_types'] = dedicated_host_profile_disk_supported_interfaces_model
- dedicated_host_profile_reference_model = {} # DedicatedHostProfileReference
- dedicated_host_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_profile_reference_model['name'] = 'mx2-host-152x1216'
+ dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed
+ dedicated_host_profile_memory_model['type'] = 'fixed'
+ dedicated_host_profile_memory_model['value'] = 16
- 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'
+ dedicated_host_profile_socket_model = {} # DedicatedHostProfileSocketFixed
+ dedicated_host_profile_socket_model['type'] = 'fixed'
+ dedicated_host_profile_socket_model['value'] = 2
instance_profile_reference_model = {} # InstanceProfileReference
instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
instance_profile_reference_model['name'] = 'bc1-4x16'
- 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'
-
- dedicated_host_model = {} # DedicatedHost
- dedicated_host_model['available_memory'] = 128
- dedicated_host_model['available_vcpu'] = vcpu_model
- dedicated_host_model['created_at'] = "2019-01-01T12:00:00Z"
- dedicated_host_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_model['disks'] = [dedicated_host_disk_model]
- dedicated_host_model['group'] = dedicated_host_group_reference_model
- dedicated_host_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_model['instance_placement_enabled'] = True
- dedicated_host_model['instances'] = [instance_reference_model]
- dedicated_host_model['lifecycle_state'] = 'stable'
- dedicated_host_model['memory'] = 128
- dedicated_host_model['name'] = 'my-host'
- dedicated_host_model['profile'] = dedicated_host_profile_reference_model
- dedicated_host_model['provisionable'] = True
- dedicated_host_model['resource_group'] = resource_group_reference_model
- dedicated_host_model['resource_type'] = 'dedicated_host'
- dedicated_host_model['socket_count'] = 4
- dedicated_host_model['state'] = 'available'
- dedicated_host_model['supported_instance_profiles'] = [instance_profile_reference_model]
- dedicated_host_model['vcpu'] = vcpu_model
- dedicated_host_model['zone'] = zone_reference_model
+ dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture
+ dedicated_host_profile_vcpu_architecture_model['type'] = 'fixed'
+ dedicated_host_profile_vcpu_architecture_model['value'] = 'amd64'
- dedicated_host_collection_first_model = {} # DedicatedHostCollectionFirst
- dedicated_host_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20'
+ dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed
+ dedicated_host_profile_vcpu_model['type'] = 'fixed'
+ dedicated_host_profile_vcpu_model['value'] = 16
- dedicated_host_collection_next_model = {} # DedicatedHostCollectionNext
- dedicated_host_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ dedicated_host_profile_model = {} # DedicatedHostProfile
+ dedicated_host_profile_model['class'] = 'mx2'
+ dedicated_host_profile_model['disks'] = [dedicated_host_profile_disk_model]
+ dedicated_host_profile_model['family'] = 'balanced'
+ dedicated_host_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_profile_model['memory'] = dedicated_host_profile_memory_model
+ dedicated_host_profile_model['name'] = 'mx2-host-152x1216'
+ dedicated_host_profile_model['socket_count'] = dedicated_host_profile_socket_model
+ dedicated_host_profile_model['supported_instance_profiles'] = [instance_profile_reference_model]
+ dedicated_host_profile_model['vcpu_architecture'] = dedicated_host_profile_vcpu_architecture_model
+ dedicated_host_profile_model['vcpu_count'] = dedicated_host_profile_vcpu_model
- # Construct a json representation of a DedicatedHostCollection model
- dedicated_host_collection_model_json = {}
- dedicated_host_collection_model_json['dedicated_hosts'] = [dedicated_host_model]
- dedicated_host_collection_model_json['first'] = dedicated_host_collection_first_model
- dedicated_host_collection_model_json['limit'] = 20
- dedicated_host_collection_model_json['next'] = dedicated_host_collection_next_model
- dedicated_host_collection_model_json['total_count'] = 132
+ # Construct a json representation of a DedicatedHostProfileCollection model
+ dedicated_host_profile_collection_model_json = {}
+ dedicated_host_profile_collection_model_json['first'] = dedicated_host_profile_collection_first_model
+ dedicated_host_profile_collection_model_json['limit'] = 20
+ dedicated_host_profile_collection_model_json['next'] = dedicated_host_profile_collection_next_model
+ dedicated_host_profile_collection_model_json['profiles'] = [dedicated_host_profile_model]
+ dedicated_host_profile_collection_model_json['total_count'] = 132
- # Construct a model instance of DedicatedHostCollection by calling from_dict on the json representation
- dedicated_host_collection_model = DedicatedHostCollection.from_dict(dedicated_host_collection_model_json)
- assert dedicated_host_collection_model != False
+ # Construct a model instance of DedicatedHostProfileCollection by calling from_dict on the json representation
+ dedicated_host_profile_collection_model = DedicatedHostProfileCollection.from_dict(dedicated_host_profile_collection_model_json)
+ assert dedicated_host_profile_collection_model != False
- # Construct a model instance of DedicatedHostCollection by calling from_dict on the json representation
- dedicated_host_collection_model_dict = DedicatedHostCollection.from_dict(dedicated_host_collection_model_json).__dict__
- dedicated_host_collection_model2 = DedicatedHostCollection(**dedicated_host_collection_model_dict)
+ # Construct a model instance of DedicatedHostProfileCollection by calling from_dict on the json representation
+ dedicated_host_profile_collection_model_dict = DedicatedHostProfileCollection.from_dict(dedicated_host_profile_collection_model_json).__dict__
+ dedicated_host_profile_collection_model2 = DedicatedHostProfileCollection(**dedicated_host_profile_collection_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_collection_model == dedicated_host_collection_model2
+ assert dedicated_host_profile_collection_model == dedicated_host_profile_collection_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_collection_model_json2 = dedicated_host_collection_model.to_dict()
- assert dedicated_host_collection_model_json2 == dedicated_host_collection_model_json
+ dedicated_host_profile_collection_model_json2 = dedicated_host_profile_collection_model.to_dict()
+ assert dedicated_host_profile_collection_model_json2 == dedicated_host_profile_collection_model_json
-class TestModel_DedicatedHostCollectionFirst():
+class TestModel_DedicatedHostProfileCollectionFirst():
"""
- Test Class for DedicatedHostCollectionFirst
+ Test Class for DedicatedHostProfileCollectionFirst
"""
- def test_dedicated_host_collection_first_serialization(self):
+ def test_dedicated_host_profile_collection_first_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostCollectionFirst
+ Test serialization/deserialization for DedicatedHostProfileCollectionFirst
"""
- # Construct a json representation of a DedicatedHostCollectionFirst model
- dedicated_host_collection_first_model_json = {}
- dedicated_host_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?limit=20'
+ # Construct a json representation of a DedicatedHostProfileCollectionFirst model
+ dedicated_host_profile_collection_first_model_json = {}
+ dedicated_host_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20'
- # Construct a model instance of DedicatedHostCollectionFirst by calling from_dict on the json representation
- dedicated_host_collection_first_model = DedicatedHostCollectionFirst.from_dict(dedicated_host_collection_first_model_json)
- assert dedicated_host_collection_first_model != False
+ # Construct a model instance of DedicatedHostProfileCollectionFirst by calling from_dict on the json representation
+ dedicated_host_profile_collection_first_model = DedicatedHostProfileCollectionFirst.from_dict(dedicated_host_profile_collection_first_model_json)
+ assert dedicated_host_profile_collection_first_model != False
- # Construct a model instance of DedicatedHostCollectionFirst by calling from_dict on the json representation
- dedicated_host_collection_first_model_dict = DedicatedHostCollectionFirst.from_dict(dedicated_host_collection_first_model_json).__dict__
- dedicated_host_collection_first_model2 = DedicatedHostCollectionFirst(**dedicated_host_collection_first_model_dict)
+ # Construct a model instance of DedicatedHostProfileCollectionFirst by calling from_dict on the json representation
+ dedicated_host_profile_collection_first_model_dict = DedicatedHostProfileCollectionFirst.from_dict(dedicated_host_profile_collection_first_model_json).__dict__
+ dedicated_host_profile_collection_first_model2 = DedicatedHostProfileCollectionFirst(**dedicated_host_profile_collection_first_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_collection_first_model == dedicated_host_collection_first_model2
+ assert dedicated_host_profile_collection_first_model == dedicated_host_profile_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_collection_first_model_json2 = dedicated_host_collection_first_model.to_dict()
- assert dedicated_host_collection_first_model_json2 == dedicated_host_collection_first_model_json
+ dedicated_host_profile_collection_first_model_json2 = dedicated_host_profile_collection_first_model.to_dict()
+ assert dedicated_host_profile_collection_first_model_json2 == dedicated_host_profile_collection_first_model_json
-class TestModel_DedicatedHostCollectionNext():
+class TestModel_DedicatedHostProfileCollectionNext():
"""
- Test Class for DedicatedHostCollectionNext
+ Test Class for DedicatedHostProfileCollectionNext
"""
- def test_dedicated_host_collection_next_serialization(self):
+ def test_dedicated_host_profile_collection_next_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostCollectionNext
+ Test serialization/deserialization for DedicatedHostProfileCollectionNext
"""
- # Construct a json representation of a DedicatedHostCollectionNext model
- dedicated_host_collection_next_model_json = {}
- dedicated_host_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a DedicatedHostProfileCollectionNext model
+ dedicated_host_profile_collection_next_model_json = {}
+ dedicated_host_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20'
- # Construct a model instance of DedicatedHostCollectionNext by calling from_dict on the json representation
- dedicated_host_collection_next_model = DedicatedHostCollectionNext.from_dict(dedicated_host_collection_next_model_json)
- assert dedicated_host_collection_next_model != False
+ # Construct a model instance of DedicatedHostProfileCollectionNext by calling from_dict on the json representation
+ dedicated_host_profile_collection_next_model = DedicatedHostProfileCollectionNext.from_dict(dedicated_host_profile_collection_next_model_json)
+ assert dedicated_host_profile_collection_next_model != False
- # Construct a model instance of DedicatedHostCollectionNext by calling from_dict on the json representation
- dedicated_host_collection_next_model_dict = DedicatedHostCollectionNext.from_dict(dedicated_host_collection_next_model_json).__dict__
- dedicated_host_collection_next_model2 = DedicatedHostCollectionNext(**dedicated_host_collection_next_model_dict)
+ # Construct a model instance of DedicatedHostProfileCollectionNext by calling from_dict on the json representation
+ dedicated_host_profile_collection_next_model_dict = DedicatedHostProfileCollectionNext.from_dict(dedicated_host_profile_collection_next_model_json).__dict__
+ dedicated_host_profile_collection_next_model2 = DedicatedHostProfileCollectionNext(**dedicated_host_profile_collection_next_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_collection_next_model == dedicated_host_collection_next_model2
+ assert dedicated_host_profile_collection_next_model == dedicated_host_profile_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_collection_next_model_json2 = dedicated_host_collection_next_model.to_dict()
- assert dedicated_host_collection_next_model_json2 == dedicated_host_collection_next_model_json
+ dedicated_host_profile_collection_next_model_json2 = dedicated_host_profile_collection_next_model.to_dict()
+ assert dedicated_host_profile_collection_next_model_json2 == dedicated_host_profile_collection_next_model_json
-class TestModel_DedicatedHostDisk():
+class TestModel_DedicatedHostProfileDisk():
"""
- Test Class for DedicatedHostDisk
+ Test Class for DedicatedHostProfileDisk
"""
- def test_dedicated_host_disk_serialization(self):
+ def test_dedicated_host_profile_disk_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostDisk
+ Test serialization/deserialization for DedicatedHostProfileDisk
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
- instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface
+ dedicated_host_profile_disk_interface_model['type'] = 'fixed'
+ dedicated_host_profile_disk_interface_model['value'] = 'nvme'
- instance_disk_reference_model = {} # InstanceDiskReference
- instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model
- instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model['name'] = 'my-instance-disk'
- instance_disk_reference_model['resource_type'] = 'instance_disk'
+ dedicated_host_profile_disk_quantity_model = {} # DedicatedHostProfileDiskQuantity
+ dedicated_host_profile_disk_quantity_model['type'] = 'fixed'
+ dedicated_host_profile_disk_quantity_model['value'] = 4
- # Construct a json representation of a DedicatedHostDisk model
- dedicated_host_disk_model_json = {}
- dedicated_host_disk_model_json['available'] = 38
- dedicated_host_disk_model_json['created_at'] = "2019-01-01T12:00:00Z"
- dedicated_host_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- dedicated_host_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- dedicated_host_disk_model_json['instance_disks'] = [instance_disk_reference_model]
- dedicated_host_disk_model_json['interface_type'] = 'nvme'
- dedicated_host_disk_model_json['lifecycle_state'] = 'stable'
- dedicated_host_disk_model_json['name'] = 'my-dedicated-host-disk'
- dedicated_host_disk_model_json['provisionable'] = True
- dedicated_host_disk_model_json['resource_type'] = 'dedicated_host_disk'
- dedicated_host_disk_model_json['size'] = 38
- dedicated_host_disk_model_json['supported_instance_interface_types'] = ['nvme']
+ dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize
+ dedicated_host_profile_disk_size_model['type'] = 'fixed'
+ dedicated_host_profile_disk_size_model['value'] = 3200
- # Construct a model instance of DedicatedHostDisk by calling from_dict on the json representation
- dedicated_host_disk_model = DedicatedHostDisk.from_dict(dedicated_host_disk_model_json)
- assert dedicated_host_disk_model != False
+ dedicated_host_profile_disk_supported_interfaces_model = {} # DedicatedHostProfileDiskSupportedInterfaces
+ dedicated_host_profile_disk_supported_interfaces_model['type'] = 'fixed'
+ dedicated_host_profile_disk_supported_interfaces_model['value'] = ['nvme']
- # Construct a model instance of DedicatedHostDisk by calling from_dict on the json representation
- dedicated_host_disk_model_dict = DedicatedHostDisk.from_dict(dedicated_host_disk_model_json).__dict__
- dedicated_host_disk_model2 = DedicatedHostDisk(**dedicated_host_disk_model_dict)
+ # Construct a json representation of a DedicatedHostProfileDisk model
+ dedicated_host_profile_disk_model_json = {}
+ dedicated_host_profile_disk_model_json['interface_type'] = dedicated_host_profile_disk_interface_model
+ dedicated_host_profile_disk_model_json['quantity'] = dedicated_host_profile_disk_quantity_model
+ dedicated_host_profile_disk_model_json['size'] = dedicated_host_profile_disk_size_model
+ dedicated_host_profile_disk_model_json['supported_instance_interface_types'] = dedicated_host_profile_disk_supported_interfaces_model
+
+ # Construct a model instance of DedicatedHostProfileDisk by calling from_dict on the json representation
+ dedicated_host_profile_disk_model = DedicatedHostProfileDisk.from_dict(dedicated_host_profile_disk_model_json)
+ assert dedicated_host_profile_disk_model != False
+
+ # Construct a model instance of DedicatedHostProfileDisk by calling from_dict on the json representation
+ dedicated_host_profile_disk_model_dict = DedicatedHostProfileDisk.from_dict(dedicated_host_profile_disk_model_json).__dict__
+ dedicated_host_profile_disk_model2 = DedicatedHostProfileDisk(**dedicated_host_profile_disk_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_disk_model == dedicated_host_disk_model2
+ assert dedicated_host_profile_disk_model == dedicated_host_profile_disk_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_disk_model_json2 = dedicated_host_disk_model.to_dict()
- assert dedicated_host_disk_model_json2 == dedicated_host_disk_model_json
+ dedicated_host_profile_disk_model_json2 = dedicated_host_profile_disk_model.to_dict()
+ assert dedicated_host_profile_disk_model_json2 == dedicated_host_profile_disk_model_json
-class TestModel_DedicatedHostDiskCollection():
+class TestModel_DedicatedHostProfileDiskInterface():
"""
- Test Class for DedicatedHostDiskCollection
+ Test Class for DedicatedHostProfileDiskInterface
"""
- def test_dedicated_host_disk_collection_serialization(self):
+ def test_dedicated_host_profile_disk_interface_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostDiskCollection
+ Test serialization/deserialization for DedicatedHostProfileDiskInterface
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a DedicatedHostProfileDiskInterface model
+ dedicated_host_profile_disk_interface_model_json = {}
+ dedicated_host_profile_disk_interface_model_json['type'] = 'fixed'
+ dedicated_host_profile_disk_interface_model_json['value'] = 'nvme'
- instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
- instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of DedicatedHostProfileDiskInterface by calling from_dict on the json representation
+ dedicated_host_profile_disk_interface_model = DedicatedHostProfileDiskInterface.from_dict(dedicated_host_profile_disk_interface_model_json)
+ assert dedicated_host_profile_disk_interface_model != False
- instance_disk_reference_model = {} # InstanceDiskReference
- instance_disk_reference_model['deleted'] = instance_disk_reference_deleted_model
- instance_disk_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model['name'] = 'my-instance-disk'
- instance_disk_reference_model['resource_type'] = 'instance_disk'
+ # Construct a model instance of DedicatedHostProfileDiskInterface by calling from_dict on the json representation
+ dedicated_host_profile_disk_interface_model_dict = DedicatedHostProfileDiskInterface.from_dict(dedicated_host_profile_disk_interface_model_json).__dict__
+ dedicated_host_profile_disk_interface_model2 = DedicatedHostProfileDiskInterface(**dedicated_host_profile_disk_interface_model_dict)
- dedicated_host_disk_model = {} # DedicatedHostDisk
- dedicated_host_disk_model['available'] = 38
- dedicated_host_disk_model['created_at'] = "2019-01-01T12:00:00Z"
- dedicated_host_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- dedicated_host_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- dedicated_host_disk_model['instance_disks'] = [instance_disk_reference_model]
- dedicated_host_disk_model['interface_type'] = 'nvme'
- dedicated_host_disk_model['lifecycle_state'] = 'stable'
- dedicated_host_disk_model['name'] = 'my-dedicated-host-disk'
- dedicated_host_disk_model['provisionable'] = True
- dedicated_host_disk_model['resource_type'] = 'dedicated_host_disk'
- dedicated_host_disk_model['size'] = 38
- dedicated_host_disk_model['supported_instance_interface_types'] = ['nvme']
+ # Verify the model instances are equivalent
+ assert dedicated_host_profile_disk_interface_model == dedicated_host_profile_disk_interface_model2
- # Construct a json representation of a DedicatedHostDiskCollection model
- dedicated_host_disk_collection_model_json = {}
- dedicated_host_disk_collection_model_json['disks'] = [dedicated_host_disk_model]
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_profile_disk_interface_model_json2 = dedicated_host_profile_disk_interface_model.to_dict()
+ assert dedicated_host_profile_disk_interface_model_json2 == dedicated_host_profile_disk_interface_model_json
- # Construct a model instance of DedicatedHostDiskCollection by calling from_dict on the json representation
- dedicated_host_disk_collection_model = DedicatedHostDiskCollection.from_dict(dedicated_host_disk_collection_model_json)
- assert dedicated_host_disk_collection_model != False
+class TestModel_DedicatedHostProfileDiskQuantity():
+ """
+ Test Class for DedicatedHostProfileDiskQuantity
+ """
- # Construct a model instance of DedicatedHostDiskCollection by calling from_dict on the json representation
- dedicated_host_disk_collection_model_dict = DedicatedHostDiskCollection.from_dict(dedicated_host_disk_collection_model_json).__dict__
- dedicated_host_disk_collection_model2 = DedicatedHostDiskCollection(**dedicated_host_disk_collection_model_dict)
+ def test_dedicated_host_profile_disk_quantity_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileDiskQuantity
+ """
+
+ # Construct a json representation of a DedicatedHostProfileDiskQuantity model
+ dedicated_host_profile_disk_quantity_model_json = {}
+ dedicated_host_profile_disk_quantity_model_json['type'] = 'fixed'
+ dedicated_host_profile_disk_quantity_model_json['value'] = 4
+
+ # Construct a model instance of DedicatedHostProfileDiskQuantity by calling from_dict on the json representation
+ dedicated_host_profile_disk_quantity_model = DedicatedHostProfileDiskQuantity.from_dict(dedicated_host_profile_disk_quantity_model_json)
+ assert dedicated_host_profile_disk_quantity_model != False
+
+ # Construct a model instance of DedicatedHostProfileDiskQuantity by calling from_dict on the json representation
+ dedicated_host_profile_disk_quantity_model_dict = DedicatedHostProfileDiskQuantity.from_dict(dedicated_host_profile_disk_quantity_model_json).__dict__
+ dedicated_host_profile_disk_quantity_model2 = DedicatedHostProfileDiskQuantity(**dedicated_host_profile_disk_quantity_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_disk_collection_model == dedicated_host_disk_collection_model2
+ assert dedicated_host_profile_disk_quantity_model == dedicated_host_profile_disk_quantity_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_disk_collection_model_json2 = dedicated_host_disk_collection_model.to_dict()
- assert dedicated_host_disk_collection_model_json2 == dedicated_host_disk_collection_model_json
+ dedicated_host_profile_disk_quantity_model_json2 = dedicated_host_profile_disk_quantity_model.to_dict()
+ assert dedicated_host_profile_disk_quantity_model_json2 == dedicated_host_profile_disk_quantity_model_json
-class TestModel_DedicatedHostDiskPatch():
+class TestModel_DedicatedHostProfileDiskSize():
"""
- Test Class for DedicatedHostDiskPatch
+ Test Class for DedicatedHostProfileDiskSize
"""
- def test_dedicated_host_disk_patch_serialization(self):
+ def test_dedicated_host_profile_disk_size_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostDiskPatch
+ Test serialization/deserialization for DedicatedHostProfileDiskSize
"""
- # Construct a json representation of a DedicatedHostDiskPatch model
- dedicated_host_disk_patch_model_json = {}
- dedicated_host_disk_patch_model_json['name'] = 'my-disk-updated'
+ # Construct a json representation of a DedicatedHostProfileDiskSize model
+ dedicated_host_profile_disk_size_model_json = {}
+ dedicated_host_profile_disk_size_model_json['type'] = 'fixed'
+ dedicated_host_profile_disk_size_model_json['value'] = 3200
- # Construct a model instance of DedicatedHostDiskPatch by calling from_dict on the json representation
- dedicated_host_disk_patch_model = DedicatedHostDiskPatch.from_dict(dedicated_host_disk_patch_model_json)
- assert dedicated_host_disk_patch_model != False
+ # Construct a model instance of DedicatedHostProfileDiskSize by calling from_dict on the json representation
+ dedicated_host_profile_disk_size_model = DedicatedHostProfileDiskSize.from_dict(dedicated_host_profile_disk_size_model_json)
+ assert dedicated_host_profile_disk_size_model != False
- # Construct a model instance of DedicatedHostDiskPatch by calling from_dict on the json representation
- dedicated_host_disk_patch_model_dict = DedicatedHostDiskPatch.from_dict(dedicated_host_disk_patch_model_json).__dict__
- dedicated_host_disk_patch_model2 = DedicatedHostDiskPatch(**dedicated_host_disk_patch_model_dict)
+ # Construct a model instance of DedicatedHostProfileDiskSize by calling from_dict on the json representation
+ dedicated_host_profile_disk_size_model_dict = DedicatedHostProfileDiskSize.from_dict(dedicated_host_profile_disk_size_model_json).__dict__
+ dedicated_host_profile_disk_size_model2 = DedicatedHostProfileDiskSize(**dedicated_host_profile_disk_size_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_disk_patch_model == dedicated_host_disk_patch_model2
+ assert dedicated_host_profile_disk_size_model == dedicated_host_profile_disk_size_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_disk_patch_model_json2 = dedicated_host_disk_patch_model.to_dict()
- assert dedicated_host_disk_patch_model_json2 == dedicated_host_disk_patch_model_json
+ dedicated_host_profile_disk_size_model_json2 = dedicated_host_profile_disk_size_model.to_dict()
+ assert dedicated_host_profile_disk_size_model_json2 == dedicated_host_profile_disk_size_model_json
-class TestModel_DedicatedHostGroup():
+class TestModel_DedicatedHostProfileDiskSupportedInterfaces():
"""
- Test Class for DedicatedHostGroup
+ Test Class for DedicatedHostProfileDiskSupportedInterfaces
"""
- def test_dedicated_host_group_serialization(self):
+ def test_dedicated_host_profile_disk_supported_interfaces_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroup
+ Test serialization/deserialization for DedicatedHostProfileDiskSupportedInterfaces
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a DedicatedHostProfileDiskSupportedInterfaces model
+ dedicated_host_profile_disk_supported_interfaces_model_json = {}
+ dedicated_host_profile_disk_supported_interfaces_model_json['type'] = 'fixed'
+ dedicated_host_profile_disk_supported_interfaces_model_json['value'] = ['nvme']
- dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
- dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of DedicatedHostProfileDiskSupportedInterfaces by calling from_dict on the json representation
+ dedicated_host_profile_disk_supported_interfaces_model = DedicatedHostProfileDiskSupportedInterfaces.from_dict(dedicated_host_profile_disk_supported_interfaces_model_json)
+ assert dedicated_host_profile_disk_supported_interfaces_model != False
- dedicated_host_reference_model = {} # DedicatedHostReference
- dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model
- dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model['name'] = 'my-host'
- dedicated_host_reference_model['resource_type'] = 'dedicated_host'
+ # Construct a model instance of DedicatedHostProfileDiskSupportedInterfaces by calling from_dict on the json representation
+ dedicated_host_profile_disk_supported_interfaces_model_dict = DedicatedHostProfileDiskSupportedInterfaces.from_dict(dedicated_host_profile_disk_supported_interfaces_model_json).__dict__
+ dedicated_host_profile_disk_supported_interfaces_model2 = DedicatedHostProfileDiskSupportedInterfaces(**dedicated_host_profile_disk_supported_interfaces_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert dedicated_host_profile_disk_supported_interfaces_model == dedicated_host_profile_disk_supported_interfaces_model2
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
- instance_profile_reference_model['name'] = 'bc1-4x16'
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_profile_disk_supported_interfaces_model_json2 = dedicated_host_profile_disk_supported_interfaces_model.to_dict()
+ assert dedicated_host_profile_disk_supported_interfaces_model_json2 == dedicated_host_profile_disk_supported_interfaces_model_json
- 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'
+class TestModel_DedicatedHostProfileReference():
+ """
+ Test Class for DedicatedHostProfileReference
+ """
- # Construct a json representation of a DedicatedHostGroup model
- dedicated_host_group_model_json = {}
- dedicated_host_group_model_json['class'] = 'mx2'
- dedicated_host_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
- dedicated_host_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_model_json['dedicated_hosts'] = [dedicated_host_reference_model]
- dedicated_host_group_model_json['family'] = 'balanced'
- dedicated_host_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_model_json['name'] = 'my-host-group'
- dedicated_host_group_model_json['resource_group'] = resource_group_reference_model
- dedicated_host_group_model_json['resource_type'] = 'dedicated_host_group'
- dedicated_host_group_model_json['supported_instance_profiles'] = [instance_profile_reference_model]
- dedicated_host_group_model_json['zone'] = zone_reference_model
+ def test_dedicated_host_profile_reference_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileReference
+ """
+
+ # Construct a json representation of a DedicatedHostProfileReference model
+ dedicated_host_profile_reference_model_json = {}
+ dedicated_host_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_profile_reference_model_json['name'] = 'mx2-host-152x1216'
+
+ # Construct a model instance of DedicatedHostProfileReference by calling from_dict on the json representation
+ dedicated_host_profile_reference_model = DedicatedHostProfileReference.from_dict(dedicated_host_profile_reference_model_json)
+ assert dedicated_host_profile_reference_model != False
+
+ # Construct a model instance of DedicatedHostProfileReference by calling from_dict on the json representation
+ dedicated_host_profile_reference_model_dict = DedicatedHostProfileReference.from_dict(dedicated_host_profile_reference_model_json).__dict__
+ dedicated_host_profile_reference_model2 = DedicatedHostProfileReference(**dedicated_host_profile_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert dedicated_host_profile_reference_model == dedicated_host_profile_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ dedicated_host_profile_reference_model_json2 = dedicated_host_profile_reference_model.to_dict()
+ assert dedicated_host_profile_reference_model_json2 == dedicated_host_profile_reference_model_json
+
+class TestModel_DedicatedHostProfileVCPUArchitecture():
+ """
+ Test Class for DedicatedHostProfileVCPUArchitecture
+ """
+
+ def test_dedicated_host_profile_vcpu_architecture_serialization(self):
+ """
+ Test serialization/deserialization for DedicatedHostProfileVCPUArchitecture
+ """
- # Construct a model instance of DedicatedHostGroup by calling from_dict on the json representation
- dedicated_host_group_model = DedicatedHostGroup.from_dict(dedicated_host_group_model_json)
- assert dedicated_host_group_model != False
+ # Construct a json representation of a DedicatedHostProfileVCPUArchitecture model
+ dedicated_host_profile_vcpu_architecture_model_json = {}
+ dedicated_host_profile_vcpu_architecture_model_json['type'] = 'fixed'
+ dedicated_host_profile_vcpu_architecture_model_json['value'] = 'amd64'
- # Construct a model instance of DedicatedHostGroup by calling from_dict on the json representation
- dedicated_host_group_model_dict = DedicatedHostGroup.from_dict(dedicated_host_group_model_json).__dict__
- dedicated_host_group_model2 = DedicatedHostGroup(**dedicated_host_group_model_dict)
+ # Construct a model instance of DedicatedHostProfileVCPUArchitecture by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_architecture_model = DedicatedHostProfileVCPUArchitecture.from_dict(dedicated_host_profile_vcpu_architecture_model_json)
+ assert dedicated_host_profile_vcpu_architecture_model != False
+
+ # Construct a model instance of DedicatedHostProfileVCPUArchitecture by calling from_dict on the json representation
+ dedicated_host_profile_vcpu_architecture_model_dict = DedicatedHostProfileVCPUArchitecture.from_dict(dedicated_host_profile_vcpu_architecture_model_json).__dict__
+ dedicated_host_profile_vcpu_architecture_model2 = DedicatedHostProfileVCPUArchitecture(**dedicated_host_profile_vcpu_architecture_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_model == dedicated_host_group_model2
+ assert dedicated_host_profile_vcpu_architecture_model == dedicated_host_profile_vcpu_architecture_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_model_json2 = dedicated_host_group_model.to_dict()
- assert dedicated_host_group_model_json2 == dedicated_host_group_model_json
+ dedicated_host_profile_vcpu_architecture_model_json2 = dedicated_host_profile_vcpu_architecture_model.to_dict()
+ assert dedicated_host_profile_vcpu_architecture_model_json2 == dedicated_host_profile_vcpu_architecture_model_json
-class TestModel_DedicatedHostGroupCollection():
+class TestModel_DedicatedHostReference():
"""
- Test Class for DedicatedHostGroupCollection
+ Test Class for DedicatedHostReference
"""
- def test_dedicated_host_group_collection_serialization(self):
+ def test_dedicated_host_reference_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupCollection
+ Test serialization/deserialization for DedicatedHostReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- dedicated_host_group_collection_first_model = {} # DedicatedHostGroupCollectionFirst
- dedicated_host_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20'
-
dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- dedicated_host_reference_model = {} # DedicatedHostReference
- dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model
- dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model['name'] = 'my-host'
- dedicated_host_reference_model['resource_type'] = 'dedicated_host'
-
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
-
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
- instance_profile_reference_model['name'] = 'bc1-4x16'
-
- 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'
-
- dedicated_host_group_model = {} # DedicatedHostGroup
- dedicated_host_group_model['class'] = 'mx2'
- dedicated_host_group_model['created_at'] = "2019-01-01T12:00:00Z"
- dedicated_host_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_model['dedicated_hosts'] = [dedicated_host_reference_model]
- dedicated_host_group_model['family'] = 'balanced'
- dedicated_host_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_model['name'] = 'my-host-group'
- dedicated_host_group_model['resource_group'] = resource_group_reference_model
- dedicated_host_group_model['resource_type'] = 'dedicated_host_group'
- dedicated_host_group_model['supported_instance_profiles'] = [instance_profile_reference_model]
- dedicated_host_group_model['zone'] = zone_reference_model
-
- dedicated_host_group_collection_next_model = {} # DedicatedHostGroupCollectionNext
- dedicated_host_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- # Construct a json representation of a DedicatedHostGroupCollection model
- dedicated_host_group_collection_model_json = {}
- dedicated_host_group_collection_model_json['first'] = dedicated_host_group_collection_first_model
- dedicated_host_group_collection_model_json['groups'] = [dedicated_host_group_model]
- dedicated_host_group_collection_model_json['limit'] = 20
- dedicated_host_group_collection_model_json['next'] = dedicated_host_group_collection_next_model
- dedicated_host_group_collection_model_json['total_count'] = 132
+ # Construct a json representation of a DedicatedHostReference model
+ dedicated_host_reference_model_json = {}
+ dedicated_host_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model_json['deleted'] = dedicated_host_reference_deleted_model
+ dedicated_host_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model_json['name'] = 'my-host'
+ dedicated_host_reference_model_json['resource_type'] = 'dedicated_host'
- # Construct a model instance of DedicatedHostGroupCollection by calling from_dict on the json representation
- dedicated_host_group_collection_model = DedicatedHostGroupCollection.from_dict(dedicated_host_group_collection_model_json)
- assert dedicated_host_group_collection_model != False
+ # Construct a model instance of DedicatedHostReference by calling from_dict on the json representation
+ dedicated_host_reference_model = DedicatedHostReference.from_dict(dedicated_host_reference_model_json)
+ assert dedicated_host_reference_model != False
- # Construct a model instance of DedicatedHostGroupCollection by calling from_dict on the json representation
- dedicated_host_group_collection_model_dict = DedicatedHostGroupCollection.from_dict(dedicated_host_group_collection_model_json).__dict__
- dedicated_host_group_collection_model2 = DedicatedHostGroupCollection(**dedicated_host_group_collection_model_dict)
+ # Construct a model instance of DedicatedHostReference by calling from_dict on the json representation
+ dedicated_host_reference_model_dict = DedicatedHostReference.from_dict(dedicated_host_reference_model_json).__dict__
+ dedicated_host_reference_model2 = DedicatedHostReference(**dedicated_host_reference_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_collection_model == dedicated_host_group_collection_model2
+ assert dedicated_host_reference_model == dedicated_host_reference_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_collection_model_json2 = dedicated_host_group_collection_model.to_dict()
- assert dedicated_host_group_collection_model_json2 == dedicated_host_group_collection_model_json
+ dedicated_host_reference_model_json2 = dedicated_host_reference_model.to_dict()
+ assert dedicated_host_reference_model_json2 == dedicated_host_reference_model_json
-class TestModel_DedicatedHostGroupCollectionFirst():
+class TestModel_DedicatedHostReferenceDeleted():
"""
- Test Class for DedicatedHostGroupCollectionFirst
+ Test Class for DedicatedHostReferenceDeleted
"""
- def test_dedicated_host_group_collection_first_serialization(self):
+ def test_dedicated_host_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupCollectionFirst
+ Test serialization/deserialization for DedicatedHostReferenceDeleted
"""
- # Construct a json representation of a DedicatedHostGroupCollectionFirst model
- dedicated_host_group_collection_first_model_json = {}
- dedicated_host_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?limit=20'
+ # Construct a json representation of a DedicatedHostReferenceDeleted model
+ dedicated_host_reference_deleted_model_json = {}
+ dedicated_host_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of DedicatedHostGroupCollectionFirst by calling from_dict on the json representation
- dedicated_host_group_collection_first_model = DedicatedHostGroupCollectionFirst.from_dict(dedicated_host_group_collection_first_model_json)
- assert dedicated_host_group_collection_first_model != False
+ # Construct a model instance of DedicatedHostReferenceDeleted by calling from_dict on the json representation
+ dedicated_host_reference_deleted_model = DedicatedHostReferenceDeleted.from_dict(dedicated_host_reference_deleted_model_json)
+ assert dedicated_host_reference_deleted_model != False
- # Construct a model instance of DedicatedHostGroupCollectionFirst by calling from_dict on the json representation
- dedicated_host_group_collection_first_model_dict = DedicatedHostGroupCollectionFirst.from_dict(dedicated_host_group_collection_first_model_json).__dict__
- dedicated_host_group_collection_first_model2 = DedicatedHostGroupCollectionFirst(**dedicated_host_group_collection_first_model_dict)
+ # Construct a model instance of DedicatedHostReferenceDeleted by calling from_dict on the json representation
+ dedicated_host_reference_deleted_model_dict = DedicatedHostReferenceDeleted.from_dict(dedicated_host_reference_deleted_model_json).__dict__
+ dedicated_host_reference_deleted_model2 = DedicatedHostReferenceDeleted(**dedicated_host_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_collection_first_model == dedicated_host_group_collection_first_model2
+ assert dedicated_host_reference_deleted_model == dedicated_host_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_collection_first_model_json2 = dedicated_host_group_collection_first_model.to_dict()
- assert dedicated_host_group_collection_first_model_json2 == dedicated_host_group_collection_first_model_json
+ dedicated_host_reference_deleted_model_json2 = dedicated_host_reference_deleted_model.to_dict()
+ assert dedicated_host_reference_deleted_model_json2 == dedicated_host_reference_deleted_model_json
-class TestModel_DedicatedHostGroupCollectionNext():
+class TestModel_DefaultNetworkACL():
"""
- Test Class for DedicatedHostGroupCollectionNext
+ Test Class for DefaultNetworkACL
"""
- def test_dedicated_host_group_collection_next_serialization(self):
+ def test_default_network_acl_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupCollectionNext
+ Test serialization/deserialization for DefaultNetworkACL
"""
- # Construct a json representation of a DedicatedHostGroupCollectionNext model
- dedicated_host_group_collection_next_model_json = {}
- dedicated_host_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of DedicatedHostGroupCollectionNext by calling from_dict on the json representation
- dedicated_host_group_collection_next_model = DedicatedHostGroupCollectionNext.from_dict(dedicated_host_group_collection_next_model_json)
- assert dedicated_host_group_collection_next_model != False
+ 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'
- # Construct a model instance of DedicatedHostGroupCollectionNext by calling from_dict on the json representation
- dedicated_host_group_collection_next_model_dict = DedicatedHostGroupCollectionNext.from_dict(dedicated_host_group_collection_next_model_json).__dict__
- dedicated_host_group_collection_next_model2 = DedicatedHostGroupCollectionNext(**dedicated_host_group_collection_next_model_dict)
+ network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
+ network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert dedicated_host_group_collection_next_model == dedicated_host_group_collection_next_model2
+ network_acl_rule_reference_model = {} # NetworkACLRuleReference
+ network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model
+ network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model['name'] = 'my-rule-1'
- # Convert model instance back to dict and verify no loss of data
- dedicated_host_group_collection_next_model_json2 = dedicated_host_group_collection_next_model.to_dict()
- assert dedicated_host_group_collection_next_model_json2 == dedicated_host_group_collection_next_model_json
+ network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP
+ network_acl_rule_item_model['action'] = 'allow'
+ network_acl_rule_item_model['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_model['created_at'] = "2019-01-01T12:00:00Z"
+ network_acl_rule_item_model['destination'] = '192.168.3.0/24'
+ network_acl_rule_item_model['direction'] = 'inbound'
+ network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_model['ip_version'] = 'ipv4'
+ network_acl_rule_item_model['name'] = 'my-rule-2'
+ network_acl_rule_item_model['source'] = '192.168.3.0/24'
+ network_acl_rule_item_model['code'] = 0
+ network_acl_rule_item_model['protocol'] = 'icmp'
+ network_acl_rule_item_model['type'] = 8
-class TestModel_DedicatedHostGroupPatch():
- """
- Test Class for DedicatedHostGroupPatch
- """
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_dedicated_host_group_patch_serialization(self):
- """
- Test serialization/deserialization for DedicatedHostGroupPatch
- """
+ 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'
- # Construct a json representation of a DedicatedHostGroupPatch model
- dedicated_host_group_patch_model_json = {}
- dedicated_host_group_patch_model_json['name'] = 'my-host-group'
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of DedicatedHostGroupPatch by calling from_dict on the json representation
- dedicated_host_group_patch_model = DedicatedHostGroupPatch.from_dict(dedicated_host_group_patch_model_json)
- assert dedicated_host_group_patch_model != False
+ 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'
- # Construct a model instance of DedicatedHostGroupPatch by calling from_dict on the json representation
- dedicated_host_group_patch_model_dict = DedicatedHostGroupPatch.from_dict(dedicated_host_group_patch_model_json).__dict__
- dedicated_host_group_patch_model2 = DedicatedHostGroupPatch(**dedicated_host_group_patch_model_dict)
+ # Construct a json representation of a DefaultNetworkACL model
+ default_network_acl_model_json = {}
+ default_network_acl_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ default_network_acl_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ default_network_acl_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ default_network_acl_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ default_network_acl_model_json['name'] = 'mnemonic-ersatz-eatery-malaise'
+ default_network_acl_model_json['resource_group'] = resource_group_reference_model
+ default_network_acl_model_json['rules'] = [network_acl_rule_item_model]
+ default_network_acl_model_json['subnets'] = [subnet_reference_model]
+ default_network_acl_model_json['vpc'] = vpc_reference_model
+
+ # Construct a model instance of DefaultNetworkACL by calling from_dict on the json representation
+ default_network_acl_model = DefaultNetworkACL.from_dict(default_network_acl_model_json)
+ assert default_network_acl_model != False
+
+ # Construct a model instance of DefaultNetworkACL by calling from_dict on the json representation
+ default_network_acl_model_dict = DefaultNetworkACL.from_dict(default_network_acl_model_json).__dict__
+ default_network_acl_model2 = DefaultNetworkACL(**default_network_acl_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_patch_model == dedicated_host_group_patch_model2
+ assert default_network_acl_model == default_network_acl_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_patch_model_json2 = dedicated_host_group_patch_model.to_dict()
- assert dedicated_host_group_patch_model_json2 == dedicated_host_group_patch_model_json
+ default_network_acl_model_json2 = default_network_acl_model.to_dict()
+ assert default_network_acl_model_json2 == default_network_acl_model_json
-class TestModel_DedicatedHostGroupPrototypeDedicatedHostByZoneContext():
+class TestModel_DefaultRoutingTable():
"""
- Test Class for DedicatedHostGroupPrototypeDedicatedHostByZoneContext
+ Test Class for DefaultRoutingTable
"""
- def test_dedicated_host_group_prototype_dedicated_host_by_zone_context_serialization(self):
+ def test_default_routing_table_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupPrototypeDedicatedHostByZoneContext
+ Test serialization/deserialization for DefaultRoutingTable
"""
# Construct dict forms of any model objects needed in order to build this model.
- resource_group_identity_model = {} # ResourceGroupIdentityById
- resource_group_identity_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ route_reference_deleted_model = {} # RouteReferenceDeleted
+ route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a DedicatedHostGroupPrototypeDedicatedHostByZoneContext model
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json = {}
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json['name'] = 'my-host-group'
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json['resource_group'] = resource_group_identity_model
+ route_reference_model = {} # RouteReference
+ route_reference_model['deleted'] = route_reference_deleted_model
+ route_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model['name'] = 'my-route-1'
- # Construct a model instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext by calling from_dict on the json representation
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json)
- assert dedicated_host_group_prototype_dedicated_host_by_zone_context_model != False
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of DedicatedHostGroupPrototypeDedicatedHostByZoneContext by calling from_dict on the json representation
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model_dict = DedicatedHostGroupPrototypeDedicatedHostByZoneContext.from_dict(dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json).__dict__
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model2 = DedicatedHostGroupPrototypeDedicatedHostByZoneContext(**dedicated_host_group_prototype_dedicated_host_by_zone_context_model_dict)
+ 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'
+
+ # Construct a json representation of a DefaultRoutingTable model
+ default_routing_table_model_json = {}
+ default_routing_table_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ default_routing_table_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
+ default_routing_table_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ default_routing_table_model_json['is_default'] = True
+ default_routing_table_model_json['lifecycle_state'] = 'stable'
+ default_routing_table_model_json['name'] = 'milled-easy-equine-machines'
+ default_routing_table_model_json['resource_type'] = 'routing_table'
+ default_routing_table_model_json['route_direct_link_ingress'] = True
+ default_routing_table_model_json['route_transit_gateway_ingress'] = True
+ default_routing_table_model_json['route_vpc_zone_ingress'] = True
+ default_routing_table_model_json['routes'] = [route_reference_model]
+ default_routing_table_model_json['subnets'] = [subnet_reference_model]
+
+ # Construct a model instance of DefaultRoutingTable by calling from_dict on the json representation
+ default_routing_table_model = DefaultRoutingTable.from_dict(default_routing_table_model_json)
+ assert default_routing_table_model != False
+
+ # Construct a model instance of DefaultRoutingTable by calling from_dict on the json representation
+ default_routing_table_model_dict = DefaultRoutingTable.from_dict(default_routing_table_model_json).__dict__
+ default_routing_table_model2 = DefaultRoutingTable(**default_routing_table_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_prototype_dedicated_host_by_zone_context_model == dedicated_host_group_prototype_dedicated_host_by_zone_context_model2
+ assert default_routing_table_model == default_routing_table_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json2 = dedicated_host_group_prototype_dedicated_host_by_zone_context_model.to_dict()
- assert dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json2 == dedicated_host_group_prototype_dedicated_host_by_zone_context_model_json
+ default_routing_table_model_json2 = default_routing_table_model.to_dict()
+ assert default_routing_table_model_json2 == default_routing_table_model_json
-class TestModel_DedicatedHostGroupReference():
+class TestModel_DefaultSecurityGroup():
"""
- Test Class for DedicatedHostGroupReference
+ Test Class for DefaultSecurityGroup
"""
- def test_dedicated_host_group_reference_serialization(self):
+ def test_default_security_group_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupReference
+ Test serialization/deserialization for DefaultSecurityGroup
"""
# Construct dict forms of any model objects needed in order to build this model.
- dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
- dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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'
- # Construct a json representation of a DedicatedHostGroupReference model
- dedicated_host_group_reference_model_json = {}
- dedicated_host_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_reference_model_json['deleted'] = dedicated_host_group_reference_deleted_model
- dedicated_host_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_reference_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- dedicated_host_group_reference_model_json['name'] = 'my-host-group'
- dedicated_host_group_reference_model_json['resource_type'] = 'dedicated_host_group'
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_model['address'] = '192.168.3.4'
- # Construct a model instance of DedicatedHostGroupReference by calling from_dict on the json representation
- dedicated_host_group_reference_model = DedicatedHostGroupReference.from_dict(dedicated_host_group_reference_model_json)
- assert dedicated_host_group_reference_model != False
+ security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll
+ security_group_rule_model['direction'] = 'inbound'
+ security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_model['ip_version'] = 'ipv4'
+ security_group_rule_model['remote'] = security_group_rule_remote_model
+ security_group_rule_model['protocol'] = 'all'
- # Construct a model instance of DedicatedHostGroupReference by calling from_dict on the json representation
- dedicated_host_group_reference_model_dict = DedicatedHostGroupReference.from_dict(dedicated_host_group_reference_model_json).__dict__
- dedicated_host_group_reference_model2 = DedicatedHostGroupReference(**dedicated_host_group_reference_model_dict)
+ 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'
+
+ # Construct a json representation of a DefaultSecurityGroup model
+ default_security_group_model_json = {}
+ default_security_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ default_security_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ default_security_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ default_security_group_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ default_security_group_model_json['name'] = 'observant-chip-emphatic-engraver'
+ default_security_group_model_json['resource_group'] = resource_group_reference_model
+ default_security_group_model_json['rules'] = [security_group_rule_model]
+ default_security_group_model_json['vpc'] = vpc_reference_model
+
+ # Construct a model instance of DefaultSecurityGroup by calling from_dict on the json representation
+ default_security_group_model = DefaultSecurityGroup.from_dict(default_security_group_model_json)
+ assert default_security_group_model != False
+
+ # Construct a model instance of DefaultSecurityGroup by calling from_dict on the json representation
+ default_security_group_model_dict = DefaultSecurityGroup.from_dict(default_security_group_model_json).__dict__
+ default_security_group_model2 = DefaultSecurityGroup(**default_security_group_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_reference_model == dedicated_host_group_reference_model2
+ assert default_security_group_model == default_security_group_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_reference_model_json2 = dedicated_host_group_reference_model.to_dict()
- assert dedicated_host_group_reference_model_json2 == dedicated_host_group_reference_model_json
+ default_security_group_model_json2 = default_security_group_model.to_dict()
+ assert default_security_group_model_json2 == default_security_group_model_json
-class TestModel_DedicatedHostGroupReferenceDeleted():
+class TestModel_EncryptionKeyReference():
"""
- Test Class for DedicatedHostGroupReferenceDeleted
+ Test Class for EncryptionKeyReference
"""
- def test_dedicated_host_group_reference_deleted_serialization(self):
+ def test_encryption_key_reference_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostGroupReferenceDeleted
+ Test serialization/deserialization for EncryptionKeyReference
"""
- # Construct a json representation of a DedicatedHostGroupReferenceDeleted model
- dedicated_host_group_reference_deleted_model_json = {}
- dedicated_host_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a EncryptionKeyReference model
+ encryption_key_reference_model_json = {}
+ encryption_key_reference_model_json['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Construct a model instance of DedicatedHostGroupReferenceDeleted by calling from_dict on the json representation
- dedicated_host_group_reference_deleted_model = DedicatedHostGroupReferenceDeleted.from_dict(dedicated_host_group_reference_deleted_model_json)
- assert dedicated_host_group_reference_deleted_model != False
+ # Construct a model instance of EncryptionKeyReference by calling from_dict on the json representation
+ encryption_key_reference_model = EncryptionKeyReference.from_dict(encryption_key_reference_model_json)
+ assert encryption_key_reference_model != False
- # Construct a model instance of DedicatedHostGroupReferenceDeleted by calling from_dict on the json representation
- dedicated_host_group_reference_deleted_model_dict = DedicatedHostGroupReferenceDeleted.from_dict(dedicated_host_group_reference_deleted_model_json).__dict__
- dedicated_host_group_reference_deleted_model2 = DedicatedHostGroupReferenceDeleted(**dedicated_host_group_reference_deleted_model_dict)
+ # Construct a model instance of EncryptionKeyReference by calling from_dict on the json representation
+ encryption_key_reference_model_dict = EncryptionKeyReference.from_dict(encryption_key_reference_model_json).__dict__
+ encryption_key_reference_model2 = EncryptionKeyReference(**encryption_key_reference_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_group_reference_deleted_model == dedicated_host_group_reference_deleted_model2
+ assert encryption_key_reference_model == encryption_key_reference_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_group_reference_deleted_model_json2 = dedicated_host_group_reference_deleted_model.to_dict()
- assert dedicated_host_group_reference_deleted_model_json2 == dedicated_host_group_reference_deleted_model_json
+ encryption_key_reference_model_json2 = encryption_key_reference_model.to_dict()
+ assert encryption_key_reference_model_json2 == encryption_key_reference_model_json
-class TestModel_DedicatedHostPatch():
+class TestModel_EndpointGateway():
"""
- Test Class for DedicatedHostPatch
+ Test Class for EndpointGateway
"""
- def test_dedicated_host_patch_serialization(self):
+ def test_endpoint_gateway_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostPatch
+ Test serialization/deserialization for EndpointGateway
"""
- # Construct a json representation of a DedicatedHostPatch model
- dedicated_host_patch_model_json = {}
- dedicated_host_patch_model_json['instance_placement_enabled'] = True
- dedicated_host_patch_model_json['name'] = 'my-host'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of DedicatedHostPatch by calling from_dict on the json representation
- dedicated_host_patch_model = DedicatedHostPatch.from_dict(dedicated_host_patch_model_json)
- assert dedicated_host_patch_model != False
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of DedicatedHostPatch by calling from_dict on the json representation
- dedicated_host_patch_model_dict = DedicatedHostPatch.from_dict(dedicated_host_patch_model_json).__dict__
- dedicated_host_patch_model2 = DedicatedHostPatch(**dedicated_host_patch_model_dict)
+ 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'
+
+ 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'
+
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
+
+ endpoint_gateway_target_model = {} # EndpointGatewayTargetProviderCloudServiceReference
+ endpoint_gateway_target_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
+ endpoint_gateway_target_model['resource_type'] = 'provider_cloud_service'
+
+ 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'
+
+ # Construct a json representation of a EndpointGateway model
+ endpoint_gateway_model_json = {}
+ endpoint_gateway_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ endpoint_gateway_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model_json['health_state'] = 'ok'
+ endpoint_gateway_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model_json['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model_json['ips'] = [reserved_ip_reference_model]
+ endpoint_gateway_model_json['lifecycle_state'] = 'stable'
+ endpoint_gateway_model_json['name'] = 'my-endpoint-gateway'
+ endpoint_gateway_model_json['resource_group'] = resource_group_reference_model
+ endpoint_gateway_model_json['resource_type'] = 'endpoint_gateway'
+ endpoint_gateway_model_json['security_groups'] = [security_group_reference_model]
+ endpoint_gateway_model_json['service_endpoint'] = 'my-cloudant-instance.appdomain.cloud'
+ endpoint_gateway_model_json['service_endpoints'] = ['my-cloudant-instance.appdomain.cloud']
+ endpoint_gateway_model_json['target'] = endpoint_gateway_target_model
+ endpoint_gateway_model_json['vpc'] = vpc_reference_model
+
+ # Construct a model instance of EndpointGateway by calling from_dict on the json representation
+ endpoint_gateway_model = EndpointGateway.from_dict(endpoint_gateway_model_json)
+ assert endpoint_gateway_model != False
+
+ # Construct a model instance of EndpointGateway by calling from_dict on the json representation
+ endpoint_gateway_model_dict = EndpointGateway.from_dict(endpoint_gateway_model_json).__dict__
+ endpoint_gateway_model2 = EndpointGateway(**endpoint_gateway_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_patch_model == dedicated_host_patch_model2
+ assert endpoint_gateway_model == endpoint_gateway_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_patch_model_json2 = dedicated_host_patch_model.to_dict()
- assert dedicated_host_patch_model_json2 == dedicated_host_patch_model_json
+ endpoint_gateway_model_json2 = endpoint_gateway_model.to_dict()
+ assert endpoint_gateway_model_json2 == endpoint_gateway_model_json
-class TestModel_DedicatedHostProfile():
+class TestModel_EndpointGatewayCollection():
"""
- Test Class for DedicatedHostProfile
+ Test Class for EndpointGatewayCollection
"""
- def test_dedicated_host_profile_serialization(self):
+ def test_endpoint_gateway_collection_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfile
+ Test serialization/deserialization for EndpointGatewayCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface
- dedicated_host_profile_disk_interface_model['type'] = 'fixed'
- dedicated_host_profile_disk_interface_model['value'] = 'nvme'
+ 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'
- dedicated_host_profile_disk_quantity_model = {} # DedicatedHostProfileDiskQuantity
- dedicated_host_profile_disk_quantity_model['type'] = 'fixed'
- dedicated_host_profile_disk_quantity_model['value'] = 4
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
- dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize
- dedicated_host_profile_disk_size_model['type'] = 'fixed'
- dedicated_host_profile_disk_size_model['value'] = 3200
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- dedicated_host_profile_disk_supported_interfaces_model = {} # DedicatedHostProfileDiskSupportedInterfaces
- dedicated_host_profile_disk_supported_interfaces_model['type'] = 'fixed'
- dedicated_host_profile_disk_supported_interfaces_model['value'] = ['nvme']
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
- dedicated_host_profile_disk_model = {} # DedicatedHostProfileDisk
- dedicated_host_profile_disk_model['interface_type'] = dedicated_host_profile_disk_interface_model
- dedicated_host_profile_disk_model['quantity'] = dedicated_host_profile_disk_quantity_model
- dedicated_host_profile_disk_model['size'] = dedicated_host_profile_disk_size_model
- dedicated_host_profile_disk_model['supported_instance_interface_types'] = dedicated_host_profile_disk_supported_interfaces_model
+ endpoint_gateway_target_model = {} # EndpointGatewayTargetProviderCloudServiceReference
+ endpoint_gateway_target_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
+ endpoint_gateway_target_model['resource_type'] = 'provider_cloud_service'
- dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed
- dedicated_host_profile_memory_model['type'] = 'fixed'
- dedicated_host_profile_memory_model['value'] = 16
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- dedicated_host_profile_socket_model = {} # DedicatedHostProfileSocketFixed
- dedicated_host_profile_socket_model['type'] = 'fixed'
- dedicated_host_profile_socket_model['value'] = 2
+ 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'
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
- instance_profile_reference_model['name'] = 'bc1-4x16'
+ endpoint_gateway_model = {} # EndpointGateway
+ endpoint_gateway_model['created_at'] = "2019-01-01T12:00:00Z"
+ endpoint_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model['health_state'] = 'ok'
+ endpoint_gateway_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ endpoint_gateway_model['ips'] = [reserved_ip_reference_model]
+ endpoint_gateway_model['lifecycle_state'] = 'stable'
+ endpoint_gateway_model['name'] = 'my-endpoint-gateway'
+ endpoint_gateway_model['resource_group'] = resource_group_reference_model
+ endpoint_gateway_model['resource_type'] = 'endpoint_gateway'
+ endpoint_gateway_model['security_groups'] = [security_group_reference_model]
+ endpoint_gateway_model['service_endpoint'] = 'my-cloudant-instance.appdomain.cloud'
+ endpoint_gateway_model['service_endpoints'] = ['my-cloudant-instance.appdomain.cloud']
+ endpoint_gateway_model['target'] = endpoint_gateway_target_model
+ endpoint_gateway_model['vpc'] = vpc_reference_model
- dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture
- dedicated_host_profile_vcpu_architecture_model['type'] = 'fixed'
- dedicated_host_profile_vcpu_architecture_model['value'] = 'amd64'
+ endpoint_gateway_collection_first_model = {} # EndpointGatewayCollectionFirst
+ endpoint_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20'
- dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed
- dedicated_host_profile_vcpu_model['type'] = 'fixed'
- dedicated_host_profile_vcpu_model['value'] = 16
+ endpoint_gateway_collection_next_model = {} # EndpointGatewayCollectionNext
+ endpoint_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20'
- # Construct a json representation of a DedicatedHostProfile model
- dedicated_host_profile_model_json = {}
- dedicated_host_profile_model_json['class'] = 'mx2'
- dedicated_host_profile_model_json['disks'] = [dedicated_host_profile_disk_model]
- dedicated_host_profile_model_json['family'] = 'balanced'
- dedicated_host_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_profile_model_json['memory'] = dedicated_host_profile_memory_model
- dedicated_host_profile_model_json['name'] = 'mx2-host-152x1216'
- dedicated_host_profile_model_json['socket_count'] = dedicated_host_profile_socket_model
- dedicated_host_profile_model_json['supported_instance_profiles'] = [instance_profile_reference_model]
- dedicated_host_profile_model_json['vcpu_architecture'] = dedicated_host_profile_vcpu_architecture_model
- dedicated_host_profile_model_json['vcpu_count'] = dedicated_host_profile_vcpu_model
+ # Construct a json representation of a EndpointGatewayCollection model
+ endpoint_gateway_collection_model_json = {}
+ endpoint_gateway_collection_model_json['endpoint_gateways'] = [endpoint_gateway_model]
+ endpoint_gateway_collection_model_json['first'] = endpoint_gateway_collection_first_model
+ endpoint_gateway_collection_model_json['limit'] = 20
+ endpoint_gateway_collection_model_json['next'] = endpoint_gateway_collection_next_model
+ endpoint_gateway_collection_model_json['total_count'] = 132
- # Construct a model instance of DedicatedHostProfile by calling from_dict on the json representation
- dedicated_host_profile_model = DedicatedHostProfile.from_dict(dedicated_host_profile_model_json)
- assert dedicated_host_profile_model != False
+ # Construct a model instance of EndpointGatewayCollection by calling from_dict on the json representation
+ endpoint_gateway_collection_model = EndpointGatewayCollection.from_dict(endpoint_gateway_collection_model_json)
+ assert endpoint_gateway_collection_model != False
- # Construct a model instance of DedicatedHostProfile by calling from_dict on the json representation
- dedicated_host_profile_model_dict = DedicatedHostProfile.from_dict(dedicated_host_profile_model_json).__dict__
- dedicated_host_profile_model2 = DedicatedHostProfile(**dedicated_host_profile_model_dict)
+ # Construct a model instance of EndpointGatewayCollection by calling from_dict on the json representation
+ endpoint_gateway_collection_model_dict = EndpointGatewayCollection.from_dict(endpoint_gateway_collection_model_json).__dict__
+ endpoint_gateway_collection_model2 = EndpointGatewayCollection(**endpoint_gateway_collection_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_model == dedicated_host_profile_model2
+ assert endpoint_gateway_collection_model == endpoint_gateway_collection_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_model_json2 = dedicated_host_profile_model.to_dict()
- assert dedicated_host_profile_model_json2 == dedicated_host_profile_model_json
+ endpoint_gateway_collection_model_json2 = endpoint_gateway_collection_model.to_dict()
+ assert endpoint_gateway_collection_model_json2 == endpoint_gateway_collection_model_json
-class TestModel_DedicatedHostProfileCollection():
+class TestModel_EndpointGatewayCollectionFirst():
"""
- Test Class for DedicatedHostProfileCollection
+ Test Class for EndpointGatewayCollectionFirst
"""
- def test_dedicated_host_profile_collection_serialization(self):
+ def test_endpoint_gateway_collection_first_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileCollection
+ Test serialization/deserialization for EndpointGatewayCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- dedicated_host_profile_collection_first_model = {} # DedicatedHostProfileCollectionFirst
- dedicated_host_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20'
-
- dedicated_host_profile_collection_next_model = {} # DedicatedHostProfileCollectionNext
- dedicated_host_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20'
-
- dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface
- dedicated_host_profile_disk_interface_model['type'] = 'fixed'
- dedicated_host_profile_disk_interface_model['value'] = 'nvme'
-
- dedicated_host_profile_disk_quantity_model = {} # DedicatedHostProfileDiskQuantity
- dedicated_host_profile_disk_quantity_model['type'] = 'fixed'
- dedicated_host_profile_disk_quantity_model['value'] = 4
-
- dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize
- dedicated_host_profile_disk_size_model['type'] = 'fixed'
- dedicated_host_profile_disk_size_model['value'] = 3200
-
- dedicated_host_profile_disk_supported_interfaces_model = {} # DedicatedHostProfileDiskSupportedInterfaces
- dedicated_host_profile_disk_supported_interfaces_model['type'] = 'fixed'
- dedicated_host_profile_disk_supported_interfaces_model['value'] = ['nvme']
-
- dedicated_host_profile_disk_model = {} # DedicatedHostProfileDisk
- dedicated_host_profile_disk_model['interface_type'] = dedicated_host_profile_disk_interface_model
- dedicated_host_profile_disk_model['quantity'] = dedicated_host_profile_disk_quantity_model
- dedicated_host_profile_disk_model['size'] = dedicated_host_profile_disk_size_model
- dedicated_host_profile_disk_model['supported_instance_interface_types'] = dedicated_host_profile_disk_supported_interfaces_model
+ # Construct a json representation of a EndpointGatewayCollectionFirst model
+ endpoint_gateway_collection_first_model_json = {}
+ endpoint_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20'
- dedicated_host_profile_memory_model = {} # DedicatedHostProfileMemoryFixed
- dedicated_host_profile_memory_model['type'] = 'fixed'
- dedicated_host_profile_memory_model['value'] = 16
+ # Construct a model instance of EndpointGatewayCollectionFirst by calling from_dict on the json representation
+ endpoint_gateway_collection_first_model = EndpointGatewayCollectionFirst.from_dict(endpoint_gateway_collection_first_model_json)
+ assert endpoint_gateway_collection_first_model != False
- dedicated_host_profile_socket_model = {} # DedicatedHostProfileSocketFixed
- dedicated_host_profile_socket_model['type'] = 'fixed'
- dedicated_host_profile_socket_model['value'] = 2
+ # Construct a model instance of EndpointGatewayCollectionFirst by calling from_dict on the json representation
+ endpoint_gateway_collection_first_model_dict = EndpointGatewayCollectionFirst.from_dict(endpoint_gateway_collection_first_model_json).__dict__
+ endpoint_gateway_collection_first_model2 = EndpointGatewayCollectionFirst(**endpoint_gateway_collection_first_model_dict)
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
- instance_profile_reference_model['name'] = 'bc1-4x16'
+ # Verify the model instances are equivalent
+ assert endpoint_gateway_collection_first_model == endpoint_gateway_collection_first_model2
- dedicated_host_profile_vcpu_architecture_model = {} # DedicatedHostProfileVCPUArchitecture
- dedicated_host_profile_vcpu_architecture_model['type'] = 'fixed'
- dedicated_host_profile_vcpu_architecture_model['value'] = 'amd64'
+ # Convert model instance back to dict and verify no loss of data
+ endpoint_gateway_collection_first_model_json2 = endpoint_gateway_collection_first_model.to_dict()
+ assert endpoint_gateway_collection_first_model_json2 == endpoint_gateway_collection_first_model_json
- dedicated_host_profile_vcpu_model = {} # DedicatedHostProfileVCPUFixed
- dedicated_host_profile_vcpu_model['type'] = 'fixed'
- dedicated_host_profile_vcpu_model['value'] = 16
+class TestModel_EndpointGatewayCollectionNext():
+ """
+ Test Class for EndpointGatewayCollectionNext
+ """
- dedicated_host_profile_model = {} # DedicatedHostProfile
- dedicated_host_profile_model['class'] = 'mx2'
- dedicated_host_profile_model['disks'] = [dedicated_host_profile_disk_model]
- dedicated_host_profile_model['family'] = 'balanced'
- dedicated_host_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_profile_model['memory'] = dedicated_host_profile_memory_model
- dedicated_host_profile_model['name'] = 'mx2-host-152x1216'
- dedicated_host_profile_model['socket_count'] = dedicated_host_profile_socket_model
- dedicated_host_profile_model['supported_instance_profiles'] = [instance_profile_reference_model]
- dedicated_host_profile_model['vcpu_architecture'] = dedicated_host_profile_vcpu_architecture_model
- dedicated_host_profile_model['vcpu_count'] = dedicated_host_profile_vcpu_model
+ def test_endpoint_gateway_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for EndpointGatewayCollectionNext
+ """
- # Construct a json representation of a DedicatedHostProfileCollection model
- dedicated_host_profile_collection_model_json = {}
- dedicated_host_profile_collection_model_json['first'] = dedicated_host_profile_collection_first_model
- dedicated_host_profile_collection_model_json['limit'] = 20
- dedicated_host_profile_collection_model_json['next'] = dedicated_host_profile_collection_next_model
- dedicated_host_profile_collection_model_json['profiles'] = [dedicated_host_profile_model]
- dedicated_host_profile_collection_model_json['total_count'] = 132
+ # Construct a json representation of a EndpointGatewayCollectionNext model
+ endpoint_gateway_collection_next_model_json = {}
+ endpoint_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20'
- # Construct a model instance of DedicatedHostProfileCollection by calling from_dict on the json representation
- dedicated_host_profile_collection_model = DedicatedHostProfileCollection.from_dict(dedicated_host_profile_collection_model_json)
- assert dedicated_host_profile_collection_model != False
+ # Construct a model instance of EndpointGatewayCollectionNext by calling from_dict on the json representation
+ endpoint_gateway_collection_next_model = EndpointGatewayCollectionNext.from_dict(endpoint_gateway_collection_next_model_json)
+ assert endpoint_gateway_collection_next_model != False
- # Construct a model instance of DedicatedHostProfileCollection by calling from_dict on the json representation
- dedicated_host_profile_collection_model_dict = DedicatedHostProfileCollection.from_dict(dedicated_host_profile_collection_model_json).__dict__
- dedicated_host_profile_collection_model2 = DedicatedHostProfileCollection(**dedicated_host_profile_collection_model_dict)
+ # Construct a model instance of EndpointGatewayCollectionNext by calling from_dict on the json representation
+ endpoint_gateway_collection_next_model_dict = EndpointGatewayCollectionNext.from_dict(endpoint_gateway_collection_next_model_json).__dict__
+ endpoint_gateway_collection_next_model2 = EndpointGatewayCollectionNext(**endpoint_gateway_collection_next_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_collection_model == dedicated_host_profile_collection_model2
+ assert endpoint_gateway_collection_next_model == endpoint_gateway_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_collection_model_json2 = dedicated_host_profile_collection_model.to_dict()
- assert dedicated_host_profile_collection_model_json2 == dedicated_host_profile_collection_model_json
+ endpoint_gateway_collection_next_model_json2 = endpoint_gateway_collection_next_model.to_dict()
+ assert endpoint_gateway_collection_next_model_json2 == endpoint_gateway_collection_next_model_json
-class TestModel_DedicatedHostProfileCollectionFirst():
+class TestModel_EndpointGatewayPatch():
"""
- Test Class for DedicatedHostProfileCollectionFirst
+ Test Class for EndpointGatewayPatch
"""
- def test_dedicated_host_profile_collection_first_serialization(self):
+ def test_endpoint_gateway_patch_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileCollectionFirst
+ Test serialization/deserialization for EndpointGatewayPatch
"""
- # Construct a json representation of a DedicatedHostProfileCollectionFirst model
- dedicated_host_profile_collection_first_model_json = {}
- dedicated_host_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?limit=20'
+ # Construct a json representation of a EndpointGatewayPatch model
+ endpoint_gateway_patch_model_json = {}
+ endpoint_gateway_patch_model_json['name'] = 'my-endpoint-gateway'
- # Construct a model instance of DedicatedHostProfileCollectionFirst by calling from_dict on the json representation
- dedicated_host_profile_collection_first_model = DedicatedHostProfileCollectionFirst.from_dict(dedicated_host_profile_collection_first_model_json)
- assert dedicated_host_profile_collection_first_model != False
+ # Construct a model instance of EndpointGatewayPatch by calling from_dict on the json representation
+ endpoint_gateway_patch_model = EndpointGatewayPatch.from_dict(endpoint_gateway_patch_model_json)
+ assert endpoint_gateway_patch_model != False
- # Construct a model instance of DedicatedHostProfileCollectionFirst by calling from_dict on the json representation
- dedicated_host_profile_collection_first_model_dict = DedicatedHostProfileCollectionFirst.from_dict(dedicated_host_profile_collection_first_model_json).__dict__
- dedicated_host_profile_collection_first_model2 = DedicatedHostProfileCollectionFirst(**dedicated_host_profile_collection_first_model_dict)
+ # Construct a model instance of EndpointGatewayPatch by calling from_dict on the json representation
+ endpoint_gateway_patch_model_dict = EndpointGatewayPatch.from_dict(endpoint_gateway_patch_model_json).__dict__
+ endpoint_gateway_patch_model2 = EndpointGatewayPatch(**endpoint_gateway_patch_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_collection_first_model == dedicated_host_profile_collection_first_model2
+ assert endpoint_gateway_patch_model == endpoint_gateway_patch_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_collection_first_model_json2 = dedicated_host_profile_collection_first_model.to_dict()
- assert dedicated_host_profile_collection_first_model_json2 == dedicated_host_profile_collection_first_model_json
+ endpoint_gateway_patch_model_json2 = endpoint_gateway_patch_model.to_dict()
+ assert endpoint_gateway_patch_model_json2 == endpoint_gateway_patch_model_json
-class TestModel_DedicatedHostProfileCollectionNext():
+class TestModel_EndpointGatewayReferenceDeleted():
"""
- Test Class for DedicatedHostProfileCollectionNext
+ Test Class for EndpointGatewayReferenceDeleted
"""
- def test_dedicated_host_profile_collection_next_serialization(self):
+ def test_endpoint_gateway_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileCollectionNext
+ Test serialization/deserialization for EndpointGatewayReferenceDeleted
"""
- # Construct a json representation of a DedicatedHostProfileCollectionNext model
- dedicated_host_profile_collection_next_model_json = {}
- dedicated_host_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/profiles?start=9da91&limit=20'
+ # Construct a json representation of a EndpointGatewayReferenceDeleted model
+ endpoint_gateway_reference_deleted_model_json = {}
+ endpoint_gateway_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of DedicatedHostProfileCollectionNext by calling from_dict on the json representation
- dedicated_host_profile_collection_next_model = DedicatedHostProfileCollectionNext.from_dict(dedicated_host_profile_collection_next_model_json)
- assert dedicated_host_profile_collection_next_model != False
+ # Construct a model instance of EndpointGatewayReferenceDeleted by calling from_dict on the json representation
+ endpoint_gateway_reference_deleted_model = EndpointGatewayReferenceDeleted.from_dict(endpoint_gateway_reference_deleted_model_json)
+ assert endpoint_gateway_reference_deleted_model != False
- # Construct a model instance of DedicatedHostProfileCollectionNext by calling from_dict on the json representation
- dedicated_host_profile_collection_next_model_dict = DedicatedHostProfileCollectionNext.from_dict(dedicated_host_profile_collection_next_model_json).__dict__
- dedicated_host_profile_collection_next_model2 = DedicatedHostProfileCollectionNext(**dedicated_host_profile_collection_next_model_dict)
+ # Construct a model instance of EndpointGatewayReferenceDeleted by calling from_dict on the json representation
+ endpoint_gateway_reference_deleted_model_dict = EndpointGatewayReferenceDeleted.from_dict(endpoint_gateway_reference_deleted_model_json).__dict__
+ endpoint_gateway_reference_deleted_model2 = EndpointGatewayReferenceDeleted(**endpoint_gateway_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_collection_next_model == dedicated_host_profile_collection_next_model2
+ assert endpoint_gateway_reference_deleted_model == endpoint_gateway_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_collection_next_model_json2 = dedicated_host_profile_collection_next_model.to_dict()
- assert dedicated_host_profile_collection_next_model_json2 == dedicated_host_profile_collection_next_model_json
+ endpoint_gateway_reference_deleted_model_json2 = endpoint_gateway_reference_deleted_model.to_dict()
+ assert endpoint_gateway_reference_deleted_model_json2 == endpoint_gateway_reference_deleted_model_json
-class TestModel_DedicatedHostProfileDisk():
+class TestModel_FloatingIP():
"""
- Test Class for DedicatedHostProfileDisk
+ Test Class for FloatingIP
"""
- def test_dedicated_host_profile_disk_serialization(self):
+ def test_floating_ip_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileDisk
+ Test serialization/deserialization for FloatingIP
"""
# Construct dict forms of any model objects needed in order to build this model.
- dedicated_host_profile_disk_interface_model = {} # DedicatedHostProfileDiskInterface
- dedicated_host_profile_disk_interface_model['type'] = 'fixed'
- dedicated_host_profile_disk_interface_model['value'] = 'nvme'
+ 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'
- dedicated_host_profile_disk_quantity_model = {} # DedicatedHostProfileDiskQuantity
- dedicated_host_profile_disk_quantity_model['type'] = 'fixed'
- dedicated_host_profile_disk_quantity_model['value'] = 4
+ network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
+ network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- dedicated_host_profile_disk_size_model = {} # DedicatedHostProfileDiskSize
- dedicated_host_profile_disk_size_model['type'] = 'fixed'
- dedicated_host_profile_disk_size_model['value'] = 3200
+ floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference
+ floating_ip_target_model['deleted'] = network_interface_reference_deleted_model
+ floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_model['name'] = 'my-network-interface'
+ floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4'
+ floating_ip_target_model['resource_type'] = 'network_interface'
- dedicated_host_profile_disk_supported_interfaces_model = {} # DedicatedHostProfileDiskSupportedInterfaces
- dedicated_host_profile_disk_supported_interfaces_model['type'] = 'fixed'
- dedicated_host_profile_disk_supported_interfaces_model['value'] = ['nvme']
+ 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 DedicatedHostProfileDisk model
- dedicated_host_profile_disk_model_json = {}
- dedicated_host_profile_disk_model_json['interface_type'] = dedicated_host_profile_disk_interface_model
- dedicated_host_profile_disk_model_json['quantity'] = dedicated_host_profile_disk_quantity_model
- dedicated_host_profile_disk_model_json['size'] = dedicated_host_profile_disk_size_model
- dedicated_host_profile_disk_model_json['supported_instance_interface_types'] = dedicated_host_profile_disk_supported_interfaces_model
+ # Construct a json representation of a FloatingIP model
+ floating_ip_model_json = {}
+ floating_ip_model_json['address'] = '203.0.113.1'
+ floating_ip_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_model_json['name'] = 'my-floating-ip'
+ floating_ip_model_json['resource_group'] = resource_group_reference_model
+ floating_ip_model_json['status'] = 'available'
+ floating_ip_model_json['target'] = floating_ip_target_model
+ floating_ip_model_json['zone'] = zone_reference_model
- # Construct a model instance of DedicatedHostProfileDisk by calling from_dict on the json representation
- dedicated_host_profile_disk_model = DedicatedHostProfileDisk.from_dict(dedicated_host_profile_disk_model_json)
- assert dedicated_host_profile_disk_model != False
+ # Construct a model instance of FloatingIP by calling from_dict on the json representation
+ floating_ip_model = FloatingIP.from_dict(floating_ip_model_json)
+ assert floating_ip_model != False
- # Construct a model instance of DedicatedHostProfileDisk by calling from_dict on the json representation
- dedicated_host_profile_disk_model_dict = DedicatedHostProfileDisk.from_dict(dedicated_host_profile_disk_model_json).__dict__
- dedicated_host_profile_disk_model2 = DedicatedHostProfileDisk(**dedicated_host_profile_disk_model_dict)
+ # Construct a model instance of FloatingIP by calling from_dict on the json representation
+ floating_ip_model_dict = FloatingIP.from_dict(floating_ip_model_json).__dict__
+ floating_ip_model2 = FloatingIP(**floating_ip_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_disk_model == dedicated_host_profile_disk_model2
+ assert floating_ip_model == floating_ip_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_disk_model_json2 = dedicated_host_profile_disk_model.to_dict()
- assert dedicated_host_profile_disk_model_json2 == dedicated_host_profile_disk_model_json
+ floating_ip_model_json2 = floating_ip_model.to_dict()
+ assert floating_ip_model_json2 == floating_ip_model_json
-class TestModel_DedicatedHostProfileDiskInterface():
+class TestModel_FloatingIPCollection():
"""
- Test Class for DedicatedHostProfileDiskInterface
+ Test Class for FloatingIPCollection
"""
- def test_dedicated_host_profile_disk_interface_serialization(self):
+ def test_floating_ip_collection_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileDiskInterface
+ Test serialization/deserialization for FloatingIPCollection
"""
- # Construct a json representation of a DedicatedHostProfileDiskInterface model
- dedicated_host_profile_disk_interface_model_json = {}
- dedicated_host_profile_disk_interface_model_json['type'] = 'fixed'
- dedicated_host_profile_disk_interface_model_json['value'] = 'nvme'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of DedicatedHostProfileDiskInterface by calling from_dict on the json representation
- dedicated_host_profile_disk_interface_model = DedicatedHostProfileDiskInterface.from_dict(dedicated_host_profile_disk_interface_model_json)
- assert dedicated_host_profile_disk_interface_model != False
+ floating_ip_collection_first_model = {} # FloatingIPCollectionFirst
+ floating_ip_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20'
- # Construct a model instance of DedicatedHostProfileDiskInterface by calling from_dict on the json representation
- dedicated_host_profile_disk_interface_model_dict = DedicatedHostProfileDiskInterface.from_dict(dedicated_host_profile_disk_interface_model_json).__dict__
- dedicated_host_profile_disk_interface_model2 = DedicatedHostProfileDiskInterface(**dedicated_host_profile_disk_interface_model_dict)
+ 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'
+
+ network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
+ network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference
+ floating_ip_target_model['deleted'] = network_interface_reference_deleted_model
+ floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_model['name'] = 'my-network-interface'
+ floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4'
+ floating_ip_target_model['resource_type'] = 'network_interface'
+
+ 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'
+
+ floating_ip_model = {} # FloatingIP
+ floating_ip_model['address'] = '203.0.113.1'
+ floating_ip_model['created_at'] = "2019-01-01T12:00:00Z"
+ floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_model['name'] = 'my-floating-ip'
+ floating_ip_model['resource_group'] = resource_group_reference_model
+ floating_ip_model['status'] = 'available'
+ floating_ip_model['target'] = floating_ip_target_model
+ floating_ip_model['zone'] = zone_reference_model
+
+ floating_ip_collection_next_model = {} # FloatingIPCollectionNext
+ floating_ip_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a json representation of a FloatingIPCollection model
+ floating_ip_collection_model_json = {}
+ floating_ip_collection_model_json['first'] = floating_ip_collection_first_model
+ floating_ip_collection_model_json['floating_ips'] = [floating_ip_model]
+ floating_ip_collection_model_json['limit'] = 20
+ floating_ip_collection_model_json['next'] = floating_ip_collection_next_model
+ floating_ip_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of FloatingIPCollection by calling from_dict on the json representation
+ floating_ip_collection_model = FloatingIPCollection.from_dict(floating_ip_collection_model_json)
+ assert floating_ip_collection_model != False
+
+ # Construct a model instance of FloatingIPCollection by calling from_dict on the json representation
+ floating_ip_collection_model_dict = FloatingIPCollection.from_dict(floating_ip_collection_model_json).__dict__
+ floating_ip_collection_model2 = FloatingIPCollection(**floating_ip_collection_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_disk_interface_model == dedicated_host_profile_disk_interface_model2
+ assert floating_ip_collection_model == floating_ip_collection_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_disk_interface_model_json2 = dedicated_host_profile_disk_interface_model.to_dict()
- assert dedicated_host_profile_disk_interface_model_json2 == dedicated_host_profile_disk_interface_model_json
+ floating_ip_collection_model_json2 = floating_ip_collection_model.to_dict()
+ assert floating_ip_collection_model_json2 == floating_ip_collection_model_json
-class TestModel_DedicatedHostProfileDiskQuantity():
+class TestModel_FloatingIPCollectionFirst():
"""
- Test Class for DedicatedHostProfileDiskQuantity
+ Test Class for FloatingIPCollectionFirst
"""
- def test_dedicated_host_profile_disk_quantity_serialization(self):
+ def test_floating_ip_collection_first_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileDiskQuantity
+ Test serialization/deserialization for FloatingIPCollectionFirst
"""
- # Construct a json representation of a DedicatedHostProfileDiskQuantity model
- dedicated_host_profile_disk_quantity_model_json = {}
- dedicated_host_profile_disk_quantity_model_json['type'] = 'fixed'
- dedicated_host_profile_disk_quantity_model_json['value'] = 4
+ # Construct a json representation of a FloatingIPCollectionFirst model
+ floating_ip_collection_first_model_json = {}
+ floating_ip_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20'
- # Construct a model instance of DedicatedHostProfileDiskQuantity by calling from_dict on the json representation
- dedicated_host_profile_disk_quantity_model = DedicatedHostProfileDiskQuantity.from_dict(dedicated_host_profile_disk_quantity_model_json)
- assert dedicated_host_profile_disk_quantity_model != False
+ # Construct a model instance of FloatingIPCollectionFirst by calling from_dict on the json representation
+ floating_ip_collection_first_model = FloatingIPCollectionFirst.from_dict(floating_ip_collection_first_model_json)
+ assert floating_ip_collection_first_model != False
- # Construct a model instance of DedicatedHostProfileDiskQuantity by calling from_dict on the json representation
- dedicated_host_profile_disk_quantity_model_dict = DedicatedHostProfileDiskQuantity.from_dict(dedicated_host_profile_disk_quantity_model_json).__dict__
- dedicated_host_profile_disk_quantity_model2 = DedicatedHostProfileDiskQuantity(**dedicated_host_profile_disk_quantity_model_dict)
+ # Construct a model instance of FloatingIPCollectionFirst by calling from_dict on the json representation
+ floating_ip_collection_first_model_dict = FloatingIPCollectionFirst.from_dict(floating_ip_collection_first_model_json).__dict__
+ floating_ip_collection_first_model2 = FloatingIPCollectionFirst(**floating_ip_collection_first_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_disk_quantity_model == dedicated_host_profile_disk_quantity_model2
+ assert floating_ip_collection_first_model == floating_ip_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_disk_quantity_model_json2 = dedicated_host_profile_disk_quantity_model.to_dict()
- assert dedicated_host_profile_disk_quantity_model_json2 == dedicated_host_profile_disk_quantity_model_json
+ floating_ip_collection_first_model_json2 = floating_ip_collection_first_model.to_dict()
+ assert floating_ip_collection_first_model_json2 == floating_ip_collection_first_model_json
-class TestModel_DedicatedHostProfileDiskSize():
+class TestModel_FloatingIPCollectionNext():
"""
- Test Class for DedicatedHostProfileDiskSize
+ Test Class for FloatingIPCollectionNext
"""
- def test_dedicated_host_profile_disk_size_serialization(self):
+ def test_floating_ip_collection_next_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileDiskSize
+ Test serialization/deserialization for FloatingIPCollectionNext
"""
- # Construct a json representation of a DedicatedHostProfileDiskSize model
- dedicated_host_profile_disk_size_model_json = {}
- dedicated_host_profile_disk_size_model_json['type'] = 'fixed'
- dedicated_host_profile_disk_size_model_json['value'] = 3200
+ # Construct a json representation of a FloatingIPCollectionNext model
+ floating_ip_collection_next_model_json = {}
+ floating_ip_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of DedicatedHostProfileDiskSize by calling from_dict on the json representation
- dedicated_host_profile_disk_size_model = DedicatedHostProfileDiskSize.from_dict(dedicated_host_profile_disk_size_model_json)
- assert dedicated_host_profile_disk_size_model != False
+ # Construct a model instance of FloatingIPCollectionNext by calling from_dict on the json representation
+ floating_ip_collection_next_model = FloatingIPCollectionNext.from_dict(floating_ip_collection_next_model_json)
+ assert floating_ip_collection_next_model != False
- # Construct a model instance of DedicatedHostProfileDiskSize by calling from_dict on the json representation
- dedicated_host_profile_disk_size_model_dict = DedicatedHostProfileDiskSize.from_dict(dedicated_host_profile_disk_size_model_json).__dict__
- dedicated_host_profile_disk_size_model2 = DedicatedHostProfileDiskSize(**dedicated_host_profile_disk_size_model_dict)
+ # Construct a model instance of FloatingIPCollectionNext by calling from_dict on the json representation
+ floating_ip_collection_next_model_dict = FloatingIPCollectionNext.from_dict(floating_ip_collection_next_model_json).__dict__
+ floating_ip_collection_next_model2 = FloatingIPCollectionNext(**floating_ip_collection_next_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_disk_size_model == dedicated_host_profile_disk_size_model2
+ assert floating_ip_collection_next_model == floating_ip_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_disk_size_model_json2 = dedicated_host_profile_disk_size_model.to_dict()
- assert dedicated_host_profile_disk_size_model_json2 == dedicated_host_profile_disk_size_model_json
+ floating_ip_collection_next_model_json2 = floating_ip_collection_next_model.to_dict()
+ assert floating_ip_collection_next_model_json2 == floating_ip_collection_next_model_json
-class TestModel_DedicatedHostProfileDiskSupportedInterfaces():
+class TestModel_FloatingIPPatch():
"""
- Test Class for DedicatedHostProfileDiskSupportedInterfaces
+ Test Class for FloatingIPPatch
"""
- def test_dedicated_host_profile_disk_supported_interfaces_serialization(self):
+ def test_floating_ip_patch_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileDiskSupportedInterfaces
+ Test serialization/deserialization for FloatingIPPatch
"""
- # Construct a json representation of a DedicatedHostProfileDiskSupportedInterfaces model
- dedicated_host_profile_disk_supported_interfaces_model_json = {}
- dedicated_host_profile_disk_supported_interfaces_model_json['type'] = 'fixed'
- dedicated_host_profile_disk_supported_interfaces_model_json['value'] = ['nvme']
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of DedicatedHostProfileDiskSupportedInterfaces by calling from_dict on the json representation
- dedicated_host_profile_disk_supported_interfaces_model = DedicatedHostProfileDiskSupportedInterfaces.from_dict(dedicated_host_profile_disk_supported_interfaces_model_json)
- assert dedicated_host_profile_disk_supported_interfaces_model != False
+ floating_ip_target_patch_model = {} # FloatingIPTargetPatchNetworkInterfaceIdentityById
+ floating_ip_target_patch_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- # Construct a model instance of DedicatedHostProfileDiskSupportedInterfaces by calling from_dict on the json representation
- dedicated_host_profile_disk_supported_interfaces_model_dict = DedicatedHostProfileDiskSupportedInterfaces.from_dict(dedicated_host_profile_disk_supported_interfaces_model_json).__dict__
- dedicated_host_profile_disk_supported_interfaces_model2 = DedicatedHostProfileDiskSupportedInterfaces(**dedicated_host_profile_disk_supported_interfaces_model_dict)
+ # Construct a json representation of a FloatingIPPatch model
+ floating_ip_patch_model_json = {}
+ floating_ip_patch_model_json['name'] = 'my-floating-ip'
+ floating_ip_patch_model_json['target'] = floating_ip_target_patch_model
+
+ # Construct a model instance of FloatingIPPatch by calling from_dict on the json representation
+ floating_ip_patch_model = FloatingIPPatch.from_dict(floating_ip_patch_model_json)
+ assert floating_ip_patch_model != False
+
+ # Construct a model instance of FloatingIPPatch by calling from_dict on the json representation
+ floating_ip_patch_model_dict = FloatingIPPatch.from_dict(floating_ip_patch_model_json).__dict__
+ floating_ip_patch_model2 = FloatingIPPatch(**floating_ip_patch_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_disk_supported_interfaces_model == dedicated_host_profile_disk_supported_interfaces_model2
+ assert floating_ip_patch_model == floating_ip_patch_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_disk_supported_interfaces_model_json2 = dedicated_host_profile_disk_supported_interfaces_model.to_dict()
- assert dedicated_host_profile_disk_supported_interfaces_model_json2 == dedicated_host_profile_disk_supported_interfaces_model_json
+ floating_ip_patch_model_json2 = floating_ip_patch_model.to_dict()
+ assert floating_ip_patch_model_json2 == floating_ip_patch_model_json
-class TestModel_DedicatedHostProfileReference():
+class TestModel_FloatingIPReference():
"""
- Test Class for DedicatedHostProfileReference
+ Test Class for FloatingIPReference
"""
- def test_dedicated_host_profile_reference_serialization(self):
+ def test_floating_ip_reference_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileReference
+ Test serialization/deserialization for FloatingIPReference
"""
- # Construct a json representation of a DedicatedHostProfileReference model
- dedicated_host_profile_reference_model_json = {}
- dedicated_host_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_profile_reference_model_json['name'] = 'mx2-host-152x1216'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of DedicatedHostProfileReference by calling from_dict on the json representation
- dedicated_host_profile_reference_model = DedicatedHostProfileReference.from_dict(dedicated_host_profile_reference_model_json)
- assert dedicated_host_profile_reference_model != False
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of DedicatedHostProfileReference by calling from_dict on the json representation
- dedicated_host_profile_reference_model_dict = DedicatedHostProfileReference.from_dict(dedicated_host_profile_reference_model_json).__dict__
- dedicated_host_profile_reference_model2 = DedicatedHostProfileReference(**dedicated_host_profile_reference_model_dict)
+ # Construct a json representation of a FloatingIPReference model
+ floating_ip_reference_model_json = {}
+ floating_ip_reference_model_json['address'] = '203.0.113.1'
+ floating_ip_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model_json['deleted'] = floating_ip_reference_deleted_model
+ floating_ip_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model_json['name'] = 'my-floating-ip'
+
+ # Construct a model instance of FloatingIPReference by calling from_dict on the json representation
+ floating_ip_reference_model = FloatingIPReference.from_dict(floating_ip_reference_model_json)
+ assert floating_ip_reference_model != False
+
+ # Construct a model instance of FloatingIPReference by calling from_dict on the json representation
+ floating_ip_reference_model_dict = FloatingIPReference.from_dict(floating_ip_reference_model_json).__dict__
+ floating_ip_reference_model2 = FloatingIPReference(**floating_ip_reference_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_reference_model == dedicated_host_profile_reference_model2
+ assert floating_ip_reference_model == floating_ip_reference_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_reference_model_json2 = dedicated_host_profile_reference_model.to_dict()
- assert dedicated_host_profile_reference_model_json2 == dedicated_host_profile_reference_model_json
+ floating_ip_reference_model_json2 = floating_ip_reference_model.to_dict()
+ assert floating_ip_reference_model_json2 == floating_ip_reference_model_json
-class TestModel_DedicatedHostProfileVCPUArchitecture():
+class TestModel_FloatingIPReferenceDeleted():
"""
- Test Class for DedicatedHostProfileVCPUArchitecture
+ Test Class for FloatingIPReferenceDeleted
"""
- def test_dedicated_host_profile_vcpu_architecture_serialization(self):
+ def test_floating_ip_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostProfileVCPUArchitecture
+ Test serialization/deserialization for FloatingIPReferenceDeleted
"""
- # Construct a json representation of a DedicatedHostProfileVCPUArchitecture model
- dedicated_host_profile_vcpu_architecture_model_json = {}
- dedicated_host_profile_vcpu_architecture_model_json['type'] = 'fixed'
- dedicated_host_profile_vcpu_architecture_model_json['value'] = 'amd64'
+ # Construct a json representation of a FloatingIPReferenceDeleted model
+ floating_ip_reference_deleted_model_json = {}
+ floating_ip_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of DedicatedHostProfileVCPUArchitecture by calling from_dict on the json representation
- dedicated_host_profile_vcpu_architecture_model = DedicatedHostProfileVCPUArchitecture.from_dict(dedicated_host_profile_vcpu_architecture_model_json)
- assert dedicated_host_profile_vcpu_architecture_model != False
+ # Construct a model instance of FloatingIPReferenceDeleted by calling from_dict on the json representation
+ floating_ip_reference_deleted_model = FloatingIPReferenceDeleted.from_dict(floating_ip_reference_deleted_model_json)
+ assert floating_ip_reference_deleted_model != False
- # Construct a model instance of DedicatedHostProfileVCPUArchitecture by calling from_dict on the json representation
- dedicated_host_profile_vcpu_architecture_model_dict = DedicatedHostProfileVCPUArchitecture.from_dict(dedicated_host_profile_vcpu_architecture_model_json).__dict__
- dedicated_host_profile_vcpu_architecture_model2 = DedicatedHostProfileVCPUArchitecture(**dedicated_host_profile_vcpu_architecture_model_dict)
+ # Construct a model instance of FloatingIPReferenceDeleted by calling from_dict on the json representation
+ floating_ip_reference_deleted_model_dict = FloatingIPReferenceDeleted.from_dict(floating_ip_reference_deleted_model_json).__dict__
+ floating_ip_reference_deleted_model2 = FloatingIPReferenceDeleted(**floating_ip_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_profile_vcpu_architecture_model == dedicated_host_profile_vcpu_architecture_model2
+ assert floating_ip_reference_deleted_model == floating_ip_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_profile_vcpu_architecture_model_json2 = dedicated_host_profile_vcpu_architecture_model.to_dict()
- assert dedicated_host_profile_vcpu_architecture_model_json2 == dedicated_host_profile_vcpu_architecture_model_json
+ floating_ip_reference_deleted_model_json2 = floating_ip_reference_deleted_model.to_dict()
+ assert floating_ip_reference_deleted_model_json2 == floating_ip_reference_deleted_model_json
-class TestModel_DedicatedHostReference():
+class TestModel_FloatingIPUnpaginatedCollection():
"""
- Test Class for DedicatedHostReference
+ Test Class for FloatingIPUnpaginatedCollection
"""
- def test_dedicated_host_reference_serialization(self):
+ def test_floating_ip_unpaginated_collection_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostReference
+ Test serialization/deserialization for FloatingIPUnpaginatedCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
- dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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'
- # Construct a json representation of a DedicatedHostReference model
- dedicated_host_reference_model_json = {}
- dedicated_host_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model_json['deleted'] = dedicated_host_reference_deleted_model
- dedicated_host_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model_json['name'] = 'my-host'
- dedicated_host_reference_model_json['resource_type'] = 'dedicated_host'
+ network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
+ network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of DedicatedHostReference by calling from_dict on the json representation
- dedicated_host_reference_model = DedicatedHostReference.from_dict(dedicated_host_reference_model_json)
- assert dedicated_host_reference_model != False
+ floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference
+ floating_ip_target_model['deleted'] = network_interface_reference_deleted_model
+ floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ floating_ip_target_model['name'] = 'my-network-interface'
+ floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4'
+ floating_ip_target_model['resource_type'] = 'network_interface'
- # Construct a model instance of DedicatedHostReference by calling from_dict on the json representation
- dedicated_host_reference_model_dict = DedicatedHostReference.from_dict(dedicated_host_reference_model_json).__dict__
- dedicated_host_reference_model2 = DedicatedHostReference(**dedicated_host_reference_model_dict)
+ zone_reference_model = {} # ZoneReference
+ zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model['name'] = 'us-south-1'
+
+ floating_ip_model = {} # FloatingIP
+ floating_ip_model['address'] = '203.0.113.1'
+ floating_ip_model['created_at'] = "2019-01-01T12:00:00Z"
+ floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_model['name'] = 'my-floating-ip'
+ floating_ip_model['resource_group'] = resource_group_reference_model
+ floating_ip_model['status'] = 'available'
+ floating_ip_model['target'] = floating_ip_target_model
+ floating_ip_model['zone'] = zone_reference_model
+
+ # Construct a json representation of a FloatingIPUnpaginatedCollection model
+ floating_ip_unpaginated_collection_model_json = {}
+ floating_ip_unpaginated_collection_model_json['floating_ips'] = [floating_ip_model]
+
+ # Construct a model instance of FloatingIPUnpaginatedCollection by calling from_dict on the json representation
+ floating_ip_unpaginated_collection_model = FloatingIPUnpaginatedCollection.from_dict(floating_ip_unpaginated_collection_model_json)
+ assert floating_ip_unpaginated_collection_model != False
+
+ # Construct a model instance of FloatingIPUnpaginatedCollection by calling from_dict on the json representation
+ floating_ip_unpaginated_collection_model_dict = FloatingIPUnpaginatedCollection.from_dict(floating_ip_unpaginated_collection_model_json).__dict__
+ floating_ip_unpaginated_collection_model2 = FloatingIPUnpaginatedCollection(**floating_ip_unpaginated_collection_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_reference_model == dedicated_host_reference_model2
+ assert floating_ip_unpaginated_collection_model == floating_ip_unpaginated_collection_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_reference_model_json2 = dedicated_host_reference_model.to_dict()
- assert dedicated_host_reference_model_json2 == dedicated_host_reference_model_json
+ floating_ip_unpaginated_collection_model_json2 = floating_ip_unpaginated_collection_model.to_dict()
+ assert floating_ip_unpaginated_collection_model_json2 == floating_ip_unpaginated_collection_model_json
-class TestModel_DedicatedHostReferenceDeleted():
+class TestModel_FlowLogCollector():
"""
- Test Class for DedicatedHostReferenceDeleted
+ Test Class for FlowLogCollector
"""
- def test_dedicated_host_reference_deleted_serialization(self):
+ def test_flow_log_collector_serialization(self):
"""
- Test serialization/deserialization for DedicatedHostReferenceDeleted
+ Test serialization/deserialization for FlowLogCollector
"""
- # Construct a json representation of a DedicatedHostReferenceDeleted model
- dedicated_host_reference_deleted_model_json = {}
- dedicated_host_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of DedicatedHostReferenceDeleted by calling from_dict on the json representation
- dedicated_host_reference_deleted_model = DedicatedHostReferenceDeleted.from_dict(dedicated_host_reference_deleted_model_json)
- assert dedicated_host_reference_deleted_model != False
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
- # Construct a model instance of DedicatedHostReferenceDeleted by calling from_dict on the json representation
- dedicated_host_reference_deleted_model_dict = DedicatedHostReferenceDeleted.from_dict(dedicated_host_reference_deleted_model_json).__dict__
- dedicated_host_reference_deleted_model2 = DedicatedHostReferenceDeleted(**dedicated_host_reference_deleted_model_dict)
+ cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference
+ cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
+
+ network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
+ network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ flow_log_collector_target_model = {} # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext
+ 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['resource_type'] = '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'
+
+ # Construct a json representation of a FlowLogCollector model
+ flow_log_collector_model_json = {}
+ flow_log_collector_model_json['active'] = True
+ flow_log_collector_model_json['auto_delete'] = True
+ flow_log_collector_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ flow_log_collector_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689'
+ flow_log_collector_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689'
+ flow_log_collector_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ flow_log_collector_model_json['lifecycle_state'] = 'stable'
+ flow_log_collector_model_json['name'] = 'my-flow-log-collector'
+ flow_log_collector_model_json['resource_group'] = resource_group_reference_model
+ flow_log_collector_model_json['storage_bucket'] = cloud_object_storage_bucket_reference_model
+ flow_log_collector_model_json['target'] = flow_log_collector_target_model
+ flow_log_collector_model_json['vpc'] = vpc_reference_model
+
+ # Construct a model instance of FlowLogCollector by calling from_dict on the json representation
+ flow_log_collector_model = FlowLogCollector.from_dict(flow_log_collector_model_json)
+ assert flow_log_collector_model != False
+
+ # Construct a model instance of FlowLogCollector by calling from_dict on the json representation
+ flow_log_collector_model_dict = FlowLogCollector.from_dict(flow_log_collector_model_json).__dict__
+ flow_log_collector_model2 = FlowLogCollector(**flow_log_collector_model_dict)
# Verify the model instances are equivalent
- assert dedicated_host_reference_deleted_model == dedicated_host_reference_deleted_model2
+ assert flow_log_collector_model == flow_log_collector_model2
# Convert model instance back to dict and verify no loss of data
- dedicated_host_reference_deleted_model_json2 = dedicated_host_reference_deleted_model.to_dict()
- assert dedicated_host_reference_deleted_model_json2 == dedicated_host_reference_deleted_model_json
+ flow_log_collector_model_json2 = flow_log_collector_model.to_dict()
+ assert flow_log_collector_model_json2 == flow_log_collector_model_json
-class TestModel_DefaultNetworkACL():
+class TestModel_FlowLogCollectorCollection():
"""
- Test Class for DefaultNetworkACL
+ Test Class for FlowLogCollectorCollection
"""
- def test_default_network_acl_serialization(self):
+ def test_flow_log_collector_collection_serialization(self):
"""
- Test serialization/deserialization for DefaultNetworkACL
+ Test serialization/deserialization for FlowLogCollectorCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
+ flow_log_collector_collection_first_model = {} # FlowLogCollectorCollectionFirst
+ flow_log_collector_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20'
+
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'
- network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
- network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- network_acl_rule_reference_model = {} # NetworkACLRuleReference
- network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model
- network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model['name'] = 'my-rule-1'
-
- network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP
- network_acl_rule_item_model['action'] = 'allow'
- network_acl_rule_item_model['before'] = network_acl_rule_reference_model
- network_acl_rule_item_model['created_at'] = "2019-01-01T12:00:00Z"
- network_acl_rule_item_model['destination'] = '192.168.3.0/24'
- network_acl_rule_item_model['direction'] = 'inbound'
- network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_model['ip_version'] = 'ipv4'
- network_acl_rule_item_model['name'] = 'my-rule-2'
- network_acl_rule_item_model['source'] = '192.168.3.0/24'
- network_acl_rule_item_model['code'] = 0
- network_acl_rule_item_model['protocol'] = 'icmp'
- network_acl_rule_item_model['type'] = 8
+ cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference
+ cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
+ network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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'
+ flow_log_collector_target_model = {} # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext
+ 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['resource_type'] = 'network_interface'
vpc_reference_deleted_model = {} # VPCReferenceDeleted
vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -31314,2844 +33233,3036 @@ def test_default_network_acl_serialization(self):
vpc_reference_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
vpc_reference_model['name'] = 'my-vpc'
- # Construct a json representation of a DefaultNetworkACL model
- default_network_acl_model_json = {}
- default_network_acl_model_json['created_at'] = "2019-01-01T12:00:00Z"
- default_network_acl_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- default_network_acl_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- default_network_acl_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- default_network_acl_model_json['name'] = 'mnemonic-ersatz-eatery-malaise'
- default_network_acl_model_json['resource_group'] = resource_group_reference_model
- default_network_acl_model_json['rules'] = [network_acl_rule_item_model]
- default_network_acl_model_json['subnets'] = [subnet_reference_model]
- default_network_acl_model_json['vpc'] = vpc_reference_model
+ flow_log_collector_model = {} # FlowLogCollector
+ flow_log_collector_model['active'] = True
+ flow_log_collector_model['auto_delete'] = True
+ flow_log_collector_model['created_at'] = "2019-01-01T12:00:00Z"
+ flow_log_collector_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689'
+ flow_log_collector_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689'
+ flow_log_collector_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ flow_log_collector_model['lifecycle_state'] = 'stable'
+ flow_log_collector_model['name'] = 'my-flow-log-collector'
+ flow_log_collector_model['resource_group'] = resource_group_reference_model
+ flow_log_collector_model['storage_bucket'] = cloud_object_storage_bucket_reference_model
+ flow_log_collector_model['target'] = flow_log_collector_target_model
+ flow_log_collector_model['vpc'] = vpc_reference_model
- # Construct a model instance of DefaultNetworkACL by calling from_dict on the json representation
- default_network_acl_model = DefaultNetworkACL.from_dict(default_network_acl_model_json)
- assert default_network_acl_model != False
+ flow_log_collector_collection_next_model = {} # FlowLogCollectorCollectionNext
+ flow_log_collector_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of DefaultNetworkACL by calling from_dict on the json representation
- default_network_acl_model_dict = DefaultNetworkACL.from_dict(default_network_acl_model_json).__dict__
- default_network_acl_model2 = DefaultNetworkACL(**default_network_acl_model_dict)
+ # Construct a json representation of a FlowLogCollectorCollection model
+ flow_log_collector_collection_model_json = {}
+ flow_log_collector_collection_model_json['first'] = flow_log_collector_collection_first_model
+ flow_log_collector_collection_model_json['flow_log_collectors'] = [flow_log_collector_model]
+ flow_log_collector_collection_model_json['limit'] = 20
+ flow_log_collector_collection_model_json['next'] = flow_log_collector_collection_next_model
+ flow_log_collector_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of FlowLogCollectorCollection by calling from_dict on the json representation
+ flow_log_collector_collection_model = FlowLogCollectorCollection.from_dict(flow_log_collector_collection_model_json)
+ assert flow_log_collector_collection_model != False
+
+ # Construct a model instance of FlowLogCollectorCollection by calling from_dict on the json representation
+ flow_log_collector_collection_model_dict = FlowLogCollectorCollection.from_dict(flow_log_collector_collection_model_json).__dict__
+ flow_log_collector_collection_model2 = FlowLogCollectorCollection(**flow_log_collector_collection_model_dict)
# Verify the model instances are equivalent
- assert default_network_acl_model == default_network_acl_model2
+ assert flow_log_collector_collection_model == flow_log_collector_collection_model2
# Convert model instance back to dict and verify no loss of data
- default_network_acl_model_json2 = default_network_acl_model.to_dict()
- assert default_network_acl_model_json2 == default_network_acl_model_json
+ flow_log_collector_collection_model_json2 = flow_log_collector_collection_model.to_dict()
+ assert flow_log_collector_collection_model_json2 == flow_log_collector_collection_model_json
-class TestModel_DefaultRoutingTable():
+class TestModel_FlowLogCollectorCollectionFirst():
"""
- Test Class for DefaultRoutingTable
+ Test Class for FlowLogCollectorCollectionFirst
"""
- def test_default_routing_table_serialization(self):
+ def test_flow_log_collector_collection_first_serialization(self):
"""
- Test serialization/deserialization for DefaultRoutingTable
+ Test serialization/deserialization for FlowLogCollectorCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- route_reference_deleted_model = {} # RouteReferenceDeleted
- route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- route_reference_model = {} # RouteReference
- route_reference_model['deleted'] = route_reference_deleted_model
- route_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model['name'] = 'my-route-1'
-
- 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'
-
- # Construct a json representation of a DefaultRoutingTable model
- default_routing_table_model_json = {}
- default_routing_table_model_json['created_at'] = "2019-01-01T12:00:00Z"
- default_routing_table_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
- default_routing_table_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- default_routing_table_model_json['is_default'] = True
- default_routing_table_model_json['lifecycle_state'] = 'stable'
- default_routing_table_model_json['name'] = 'milled-easy-equine-machines'
- default_routing_table_model_json['resource_type'] = 'routing_table'
- default_routing_table_model_json['route_direct_link_ingress'] = True
- default_routing_table_model_json['route_transit_gateway_ingress'] = True
- default_routing_table_model_json['route_vpc_zone_ingress'] = True
- default_routing_table_model_json['routes'] = [route_reference_model]
- default_routing_table_model_json['subnets'] = [subnet_reference_model]
+ # Construct a json representation of a FlowLogCollectorCollectionFirst model
+ flow_log_collector_collection_first_model_json = {}
+ flow_log_collector_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20'
- # Construct a model instance of DefaultRoutingTable by calling from_dict on the json representation
- default_routing_table_model = DefaultRoutingTable.from_dict(default_routing_table_model_json)
- assert default_routing_table_model != False
+ # Construct a model instance of FlowLogCollectorCollectionFirst by calling from_dict on the json representation
+ flow_log_collector_collection_first_model = FlowLogCollectorCollectionFirst.from_dict(flow_log_collector_collection_first_model_json)
+ assert flow_log_collector_collection_first_model != False
- # Construct a model instance of DefaultRoutingTable by calling from_dict on the json representation
- default_routing_table_model_dict = DefaultRoutingTable.from_dict(default_routing_table_model_json).__dict__
- default_routing_table_model2 = DefaultRoutingTable(**default_routing_table_model_dict)
+ # Construct a model instance of FlowLogCollectorCollectionFirst by calling from_dict on the json representation
+ flow_log_collector_collection_first_model_dict = FlowLogCollectorCollectionFirst.from_dict(flow_log_collector_collection_first_model_json).__dict__
+ flow_log_collector_collection_first_model2 = FlowLogCollectorCollectionFirst(**flow_log_collector_collection_first_model_dict)
# Verify the model instances are equivalent
- assert default_routing_table_model == default_routing_table_model2
+ assert flow_log_collector_collection_first_model == flow_log_collector_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- default_routing_table_model_json2 = default_routing_table_model.to_dict()
- assert default_routing_table_model_json2 == default_routing_table_model_json
+ flow_log_collector_collection_first_model_json2 = flow_log_collector_collection_first_model.to_dict()
+ assert flow_log_collector_collection_first_model_json2 == flow_log_collector_collection_first_model_json
-class TestModel_DefaultSecurityGroup():
+class TestModel_FlowLogCollectorCollectionNext():
"""
- Test Class for DefaultSecurityGroup
+ Test Class for FlowLogCollectorCollectionNext
"""
- def test_default_security_group_serialization(self):
+ def test_flow_log_collector_collection_next_serialization(self):
"""
- Test serialization/deserialization for DefaultSecurityGroup
+ Test serialization/deserialization for FlowLogCollectorCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a FlowLogCollectorCollectionNext model
+ flow_log_collector_collection_next_model_json = {}
+ flow_log_collector_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- 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'
+ # Construct a model instance of FlowLogCollectorCollectionNext by calling from_dict on the json representation
+ flow_log_collector_collection_next_model = FlowLogCollectorCollectionNext.from_dict(flow_log_collector_collection_next_model_json)
+ assert flow_log_collector_collection_next_model != False
- security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
- security_group_rule_remote_model['address'] = '192.168.3.4'
+ # Construct a model instance of FlowLogCollectorCollectionNext by calling from_dict on the json representation
+ flow_log_collector_collection_next_model_dict = FlowLogCollectorCollectionNext.from_dict(flow_log_collector_collection_next_model_json).__dict__
+ flow_log_collector_collection_next_model2 = FlowLogCollectorCollectionNext(**flow_log_collector_collection_next_model_dict)
- security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll
- security_group_rule_model['direction'] = 'inbound'
- security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_model['ip_version'] = 'ipv4'
- security_group_rule_model['remote'] = security_group_rule_remote_model
- security_group_rule_model['protocol'] = 'all'
+ # Verify the model instances are equivalent
+ assert flow_log_collector_collection_next_model == flow_log_collector_collection_next_model2
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ flow_log_collector_collection_next_model_json2 = flow_log_collector_collection_next_model.to_dict()
+ assert flow_log_collector_collection_next_model_json2 == flow_log_collector_collection_next_model_json
- 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'
+class TestModel_FlowLogCollectorPatch():
+ """
+ Test Class for FlowLogCollectorPatch
+ """
- # Construct a json representation of a DefaultSecurityGroup model
- default_security_group_model_json = {}
- default_security_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
- default_security_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- default_security_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- default_security_group_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- default_security_group_model_json['name'] = 'observant-chip-emphatic-engraver'
- default_security_group_model_json['resource_group'] = resource_group_reference_model
- default_security_group_model_json['rules'] = [security_group_rule_model]
- default_security_group_model_json['vpc'] = vpc_reference_model
+ def test_flow_log_collector_patch_serialization(self):
+ """
+ Test serialization/deserialization for FlowLogCollectorPatch
+ """
- # Construct a model instance of DefaultSecurityGroup by calling from_dict on the json representation
- default_security_group_model = DefaultSecurityGroup.from_dict(default_security_group_model_json)
- assert default_security_group_model != False
+ # Construct a json representation of a FlowLogCollectorPatch model
+ flow_log_collector_patch_model_json = {}
+ flow_log_collector_patch_model_json['active'] = True
+ flow_log_collector_patch_model_json['name'] = 'my-flow-log-collector'
- # Construct a model instance of DefaultSecurityGroup by calling from_dict on the json representation
- default_security_group_model_dict = DefaultSecurityGroup.from_dict(default_security_group_model_json).__dict__
- default_security_group_model2 = DefaultSecurityGroup(**default_security_group_model_dict)
+ # Construct a model instance of FlowLogCollectorPatch by calling from_dict on the json representation
+ flow_log_collector_patch_model = FlowLogCollectorPatch.from_dict(flow_log_collector_patch_model_json)
+ assert flow_log_collector_patch_model != False
+
+ # Construct a model instance of FlowLogCollectorPatch by calling from_dict on the json representation
+ flow_log_collector_patch_model_dict = FlowLogCollectorPatch.from_dict(flow_log_collector_patch_model_json).__dict__
+ flow_log_collector_patch_model2 = FlowLogCollectorPatch(**flow_log_collector_patch_model_dict)
# Verify the model instances are equivalent
- assert default_security_group_model == default_security_group_model2
+ assert flow_log_collector_patch_model == flow_log_collector_patch_model2
# Convert model instance back to dict and verify no loss of data
- default_security_group_model_json2 = default_security_group_model.to_dict()
- assert default_security_group_model_json2 == default_security_group_model_json
+ flow_log_collector_patch_model_json2 = flow_log_collector_patch_model.to_dict()
+ assert flow_log_collector_patch_model_json2 == flow_log_collector_patch_model_json
-class TestModel_EncryptionKeyReference():
+class TestModel_IKEPolicy():
"""
- Test Class for EncryptionKeyReference
+ Test Class for IKEPolicy
"""
- def test_encryption_key_reference_serialization(self):
+ def test_ike_policy_serialization(self):
"""
- Test serialization/deserialization for EncryptionKeyReference
+ Test serialization/deserialization for IKEPolicy
"""
- # Construct a json representation of a EncryptionKeyReference model
- encryption_key_reference_model_json = {}
- encryption_key_reference_model_json['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of EncryptionKeyReference by calling from_dict on the json representation
- encryption_key_reference_model = EncryptionKeyReference.from_dict(encryption_key_reference_model_json)
- assert encryption_key_reference_model != False
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of EncryptionKeyReference by calling from_dict on the json representation
- encryption_key_reference_model_dict = EncryptionKeyReference.from_dict(encryption_key_reference_model_json).__dict__
- encryption_key_reference_model2 = EncryptionKeyReference(**encryption_key_reference_model_dict)
+ vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
+ vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
+ vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
+ vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
+
+ 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'
+
+ # Construct a json representation of a IKEPolicy model
+ ike_policy_model_json = {}
+ ike_policy_model_json['authentication_algorithm'] = 'md5'
+ ike_policy_model_json['connections'] = [vpn_gateway_connection_reference_model]
+ ike_policy_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ ike_policy_model_json['dh_group'] = 14
+ ike_policy_model_json['encryption_algorithm'] = 'aes128'
+ ike_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ ike_policy_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ ike_policy_model_json['ike_version'] = 1
+ ike_policy_model_json['key_lifetime'] = 28800
+ ike_policy_model_json['name'] = 'my-ike-policy'
+ ike_policy_model_json['negotiation_mode'] = 'main'
+ ike_policy_model_json['resource_group'] = resource_group_reference_model
+ ike_policy_model_json['resource_type'] = 'ike_policy'
+
+ # Construct a model instance of IKEPolicy by calling from_dict on the json representation
+ ike_policy_model = IKEPolicy.from_dict(ike_policy_model_json)
+ assert ike_policy_model != False
+
+ # Construct a model instance of IKEPolicy by calling from_dict on the json representation
+ ike_policy_model_dict = IKEPolicy.from_dict(ike_policy_model_json).__dict__
+ ike_policy_model2 = IKEPolicy(**ike_policy_model_dict)
# Verify the model instances are equivalent
- assert encryption_key_reference_model == encryption_key_reference_model2
+ assert ike_policy_model == ike_policy_model2
# Convert model instance back to dict and verify no loss of data
- encryption_key_reference_model_json2 = encryption_key_reference_model.to_dict()
- assert encryption_key_reference_model_json2 == encryption_key_reference_model_json
+ ike_policy_model_json2 = ike_policy_model.to_dict()
+ assert ike_policy_model_json2 == ike_policy_model_json
-class TestModel_EndpointGateway():
+class TestModel_IKEPolicyCollection():
"""
- Test Class for EndpointGateway
+ Test Class for IKEPolicyCollection
"""
- def test_endpoint_gateway_serialization(self):
+ def test_ike_policy_collection_serialization(self):
"""
- Test serialization/deserialization for EndpointGateway
+ Test serialization/deserialization for IKEPolicyCollection
"""
# 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'
+ ike_policy_collection_first_model = {} # IKEPolicyCollectionFirst
+ ike_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20'
- 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'
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
+ vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
+ vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
+ vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
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'
- endpoint_gateway_target_model = {} # EndpointGatewayTargetProviderCloudServiceReference
- endpoint_gateway_target_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
- endpoint_gateway_target_model['resource_type'] = 'provider_cloud_service'
-
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ ike_policy_model = {} # IKEPolicy
+ ike_policy_model['authentication_algorithm'] = 'md5'
+ ike_policy_model['connections'] = [vpn_gateway_connection_reference_model]
+ ike_policy_model['created_at'] = "2019-01-01T12:00:00Z"
+ ike_policy_model['dh_group'] = 14
+ ike_policy_model['encryption_algorithm'] = 'aes128'
+ ike_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ ike_policy_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ ike_policy_model['ike_version'] = 1
+ ike_policy_model['key_lifetime'] = 28800
+ ike_policy_model['name'] = 'my-ike-policy'
+ ike_policy_model['negotiation_mode'] = 'main'
+ ike_policy_model['resource_group'] = resource_group_reference_model
+ ike_policy_model['resource_type'] = 'ike_policy'
- 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'
+ ike_policy_collection_next_model = {} # IKEPolicyCollectionNext
+ ike_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
- # Construct a json representation of a EndpointGateway model
- endpoint_gateway_model_json = {}
- endpoint_gateway_model_json['created_at'] = "2019-01-01T12:00:00Z"
- endpoint_gateway_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_model_json['health_state'] = 'ok'
- endpoint_gateway_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_model_json['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_model_json['ips'] = [reserved_ip_reference_model]
- endpoint_gateway_model_json['lifecycle_state'] = 'stable'
- endpoint_gateway_model_json['name'] = 'my-endpoint-gateway'
- endpoint_gateway_model_json['resource_group'] = resource_group_reference_model
- endpoint_gateway_model_json['resource_type'] = 'endpoint_gateway'
- endpoint_gateway_model_json['service_endpoint'] = 'my-cloudant-instance.appdomain.cloud'
- endpoint_gateway_model_json['service_endpoints'] = ['my-cloudant-instance.appdomain.cloud']
- endpoint_gateway_model_json['target'] = endpoint_gateway_target_model
- endpoint_gateway_model_json['vpc'] = vpc_reference_model
+ # Construct a json representation of a IKEPolicyCollection model
+ ike_policy_collection_model_json = {}
+ ike_policy_collection_model_json['first'] = ike_policy_collection_first_model
+ ike_policy_collection_model_json['ike_policies'] = [ike_policy_model]
+ ike_policy_collection_model_json['limit'] = 20
+ ike_policy_collection_model_json['next'] = ike_policy_collection_next_model
+ ike_policy_collection_model_json['total_count'] = 132
- # Construct a model instance of EndpointGateway by calling from_dict on the json representation
- endpoint_gateway_model = EndpointGateway.from_dict(endpoint_gateway_model_json)
- assert endpoint_gateway_model != False
+ # Construct a model instance of IKEPolicyCollection by calling from_dict on the json representation
+ ike_policy_collection_model = IKEPolicyCollection.from_dict(ike_policy_collection_model_json)
+ assert ike_policy_collection_model != False
- # Construct a model instance of EndpointGateway by calling from_dict on the json representation
- endpoint_gateway_model_dict = EndpointGateway.from_dict(endpoint_gateway_model_json).__dict__
- endpoint_gateway_model2 = EndpointGateway(**endpoint_gateway_model_dict)
+ # Construct a model instance of IKEPolicyCollection by calling from_dict on the json representation
+ ike_policy_collection_model_dict = IKEPolicyCollection.from_dict(ike_policy_collection_model_json).__dict__
+ ike_policy_collection_model2 = IKEPolicyCollection(**ike_policy_collection_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_model == endpoint_gateway_model2
+ assert ike_policy_collection_model == ike_policy_collection_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_model_json2 = endpoint_gateway_model.to_dict()
- assert endpoint_gateway_model_json2 == endpoint_gateway_model_json
+ ike_policy_collection_model_json2 = ike_policy_collection_model.to_dict()
+ assert ike_policy_collection_model_json2 == ike_policy_collection_model_json
-class TestModel_EndpointGatewayCollection():
+class TestModel_IKEPolicyCollectionFirst():
"""
- Test Class for EndpointGatewayCollection
+ Test Class for IKEPolicyCollectionFirst
"""
- def test_endpoint_gateway_collection_serialization(self):
+ def test_ike_policy_collection_first_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayCollection
+ Test serialization/deserialization for IKEPolicyCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a IKEPolicyCollectionFirst model
+ ike_policy_collection_first_model_json = {}
+ ike_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20'
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of IKEPolicyCollectionFirst by calling from_dict on the json representation
+ ike_policy_collection_first_model = IKEPolicyCollectionFirst.from_dict(ike_policy_collection_first_model_json)
+ assert ike_policy_collection_first_model != False
- 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 model instance of IKEPolicyCollectionFirst by calling from_dict on the json representation
+ ike_policy_collection_first_model_dict = IKEPolicyCollectionFirst.from_dict(ike_policy_collection_first_model_json).__dict__
+ ike_policy_collection_first_model2 = IKEPolicyCollectionFirst(**ike_policy_collection_first_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert ike_policy_collection_first_model == ike_policy_collection_first_model2
- endpoint_gateway_target_model = {} # EndpointGatewayTargetProviderCloudServiceReference
- endpoint_gateway_target_model['crn'] = 'crn:v1:bluemix:public:cloudant:us-south:a/123456:3527280b-9327-4411-8020-591092e60353::'
- endpoint_gateway_target_model['resource_type'] = 'provider_cloud_service'
+ # Convert model instance back to dict and verify no loss of data
+ ike_policy_collection_first_model_json2 = ike_policy_collection_first_model.to_dict()
+ assert ike_policy_collection_first_model_json2 == ike_policy_collection_first_model_json
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_IKEPolicyCollectionNext():
+ """
+ Test Class for IKEPolicyCollectionNext
+ """
- 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'
+ def test_ike_policy_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for IKEPolicyCollectionNext
+ """
- endpoint_gateway_model = {} # EndpointGateway
- endpoint_gateway_model['created_at'] = "2019-01-01T12:00:00Z"
- endpoint_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_model['health_state'] = 'ok'
- endpoint_gateway_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
- endpoint_gateway_model['ips'] = [reserved_ip_reference_model]
- endpoint_gateway_model['lifecycle_state'] = 'stable'
- endpoint_gateway_model['name'] = 'my-endpoint-gateway'
- endpoint_gateway_model['resource_group'] = resource_group_reference_model
- endpoint_gateway_model['resource_type'] = 'endpoint_gateway'
- endpoint_gateway_model['service_endpoint'] = 'my-cloudant-instance.appdomain.cloud'
- endpoint_gateway_model['service_endpoints'] = ['my-cloudant-instance.appdomain.cloud']
- endpoint_gateway_model['target'] = endpoint_gateway_target_model
- endpoint_gateway_model['vpc'] = vpc_reference_model
+ # Construct a json representation of a IKEPolicyCollectionNext model
+ ike_policy_collection_next_model_json = {}
+ ike_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
- endpoint_gateway_collection_first_model = {} # EndpointGatewayCollectionFirst
- endpoint_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20'
+ # Construct a model instance of IKEPolicyCollectionNext by calling from_dict on the json representation
+ ike_policy_collection_next_model = IKEPolicyCollectionNext.from_dict(ike_policy_collection_next_model_json)
+ assert ike_policy_collection_next_model != False
- endpoint_gateway_collection_next_model = {} # EndpointGatewayCollectionNext
- endpoint_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20'
+ # Construct a model instance of IKEPolicyCollectionNext by calling from_dict on the json representation
+ ike_policy_collection_next_model_dict = IKEPolicyCollectionNext.from_dict(ike_policy_collection_next_model_json).__dict__
+ ike_policy_collection_next_model2 = IKEPolicyCollectionNext(**ike_policy_collection_next_model_dict)
- # Construct a json representation of a EndpointGatewayCollection model
- endpoint_gateway_collection_model_json = {}
- endpoint_gateway_collection_model_json['endpoint_gateways'] = [endpoint_gateway_model]
- endpoint_gateway_collection_model_json['first'] = endpoint_gateway_collection_first_model
- endpoint_gateway_collection_model_json['limit'] = 20
- endpoint_gateway_collection_model_json['next'] = endpoint_gateway_collection_next_model
- endpoint_gateway_collection_model_json['total_count'] = 132
+ # Verify the model instances are equivalent
+ assert ike_policy_collection_next_model == ike_policy_collection_next_model2
- # Construct a model instance of EndpointGatewayCollection by calling from_dict on the json representation
- endpoint_gateway_collection_model = EndpointGatewayCollection.from_dict(endpoint_gateway_collection_model_json)
- assert endpoint_gateway_collection_model != False
+ # Convert model instance back to dict and verify no loss of data
+ ike_policy_collection_next_model_json2 = ike_policy_collection_next_model.to_dict()
+ assert ike_policy_collection_next_model_json2 == ike_policy_collection_next_model_json
- # Construct a model instance of EndpointGatewayCollection by calling from_dict on the json representation
- endpoint_gateway_collection_model_dict = EndpointGatewayCollection.from_dict(endpoint_gateway_collection_model_json).__dict__
- endpoint_gateway_collection_model2 = EndpointGatewayCollection(**endpoint_gateway_collection_model_dict)
+class TestModel_IKEPolicyPatch():
+ """
+ Test Class for IKEPolicyPatch
+ """
+
+ def test_ike_policy_patch_serialization(self):
+ """
+ Test serialization/deserialization for IKEPolicyPatch
+ """
+
+ # Construct a json representation of a IKEPolicyPatch model
+ ike_policy_patch_model_json = {}
+ ike_policy_patch_model_json['authentication_algorithm'] = 'md5'
+ ike_policy_patch_model_json['dh_group'] = 14
+ ike_policy_patch_model_json['encryption_algorithm'] = 'aes128'
+ ike_policy_patch_model_json['ike_version'] = 1
+ ike_policy_patch_model_json['key_lifetime'] = 28800
+ ike_policy_patch_model_json['name'] = 'my-ike-policy'
+
+ # Construct a model instance of IKEPolicyPatch by calling from_dict on the json representation
+ ike_policy_patch_model = IKEPolicyPatch.from_dict(ike_policy_patch_model_json)
+ assert ike_policy_patch_model != False
+
+ # Construct a model instance of IKEPolicyPatch by calling from_dict on the json representation
+ ike_policy_patch_model_dict = IKEPolicyPatch.from_dict(ike_policy_patch_model_json).__dict__
+ ike_policy_patch_model2 = IKEPolicyPatch(**ike_policy_patch_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_collection_model == endpoint_gateway_collection_model2
+ assert ike_policy_patch_model == ike_policy_patch_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_collection_model_json2 = endpoint_gateway_collection_model.to_dict()
- assert endpoint_gateway_collection_model_json2 == endpoint_gateway_collection_model_json
+ ike_policy_patch_model_json2 = ike_policy_patch_model.to_dict()
+ assert ike_policy_patch_model_json2 == ike_policy_patch_model_json
-class TestModel_EndpointGatewayCollectionFirst():
+class TestModel_IKEPolicyReference():
"""
- Test Class for EndpointGatewayCollectionFirst
+ Test Class for IKEPolicyReference
"""
- def test_endpoint_gateway_collection_first_serialization(self):
+ def test_ike_policy_reference_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayCollectionFirst
+ Test serialization/deserialization for IKEPolicyReference
"""
- # Construct a json representation of a EndpointGatewayCollectionFirst model
- endpoint_gateway_collection_first_model_json = {}
- endpoint_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of EndpointGatewayCollectionFirst by calling from_dict on the json representation
- endpoint_gateway_collection_first_model = EndpointGatewayCollectionFirst.from_dict(endpoint_gateway_collection_first_model_json)
- assert endpoint_gateway_collection_first_model != False
+ ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted
+ ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of EndpointGatewayCollectionFirst by calling from_dict on the json representation
- endpoint_gateway_collection_first_model_dict = EndpointGatewayCollectionFirst.from_dict(endpoint_gateway_collection_first_model_json).__dict__
- endpoint_gateway_collection_first_model2 = EndpointGatewayCollectionFirst(**endpoint_gateway_collection_first_model_dict)
+ # Construct a json representation of a IKEPolicyReference model
+ ike_policy_reference_model_json = {}
+ ike_policy_reference_model_json['deleted'] = ike_policy_reference_deleted_model
+ ike_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ ike_policy_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ ike_policy_reference_model_json['name'] = 'my-ike-policy'
+ ike_policy_reference_model_json['resource_type'] = 'ike_policy'
+
+ # Construct a model instance of IKEPolicyReference by calling from_dict on the json representation
+ ike_policy_reference_model = IKEPolicyReference.from_dict(ike_policy_reference_model_json)
+ assert ike_policy_reference_model != False
+
+ # Construct a model instance of IKEPolicyReference by calling from_dict on the json representation
+ ike_policy_reference_model_dict = IKEPolicyReference.from_dict(ike_policy_reference_model_json).__dict__
+ ike_policy_reference_model2 = IKEPolicyReference(**ike_policy_reference_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_collection_first_model == endpoint_gateway_collection_first_model2
+ assert ike_policy_reference_model == ike_policy_reference_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_collection_first_model_json2 = endpoint_gateway_collection_first_model.to_dict()
- assert endpoint_gateway_collection_first_model_json2 == endpoint_gateway_collection_first_model_json
+ ike_policy_reference_model_json2 = ike_policy_reference_model.to_dict()
+ assert ike_policy_reference_model_json2 == ike_policy_reference_model_json
-class TestModel_EndpointGatewayCollectionNext():
+class TestModel_IKEPolicyReferenceDeleted():
"""
- Test Class for EndpointGatewayCollectionNext
+ Test Class for IKEPolicyReferenceDeleted
"""
- def test_endpoint_gateway_collection_next_serialization(self):
+ def test_ike_policy_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayCollectionNext
+ Test serialization/deserialization for IKEPolicyReferenceDeleted
"""
- # Construct a json representation of a EndpointGatewayCollectionNext model
- endpoint_gateway_collection_next_model_json = {}
- endpoint_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways?start=ffd653466e284937896724b2dd044c9c&limit=20'
+ # Construct a json representation of a IKEPolicyReferenceDeleted model
+ ike_policy_reference_deleted_model_json = {}
+ ike_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of EndpointGatewayCollectionNext by calling from_dict on the json representation
- endpoint_gateway_collection_next_model = EndpointGatewayCollectionNext.from_dict(endpoint_gateway_collection_next_model_json)
- assert endpoint_gateway_collection_next_model != False
+ # Construct a model instance of IKEPolicyReferenceDeleted by calling from_dict on the json representation
+ ike_policy_reference_deleted_model = IKEPolicyReferenceDeleted.from_dict(ike_policy_reference_deleted_model_json)
+ assert ike_policy_reference_deleted_model != False
- # Construct a model instance of EndpointGatewayCollectionNext by calling from_dict on the json representation
- endpoint_gateway_collection_next_model_dict = EndpointGatewayCollectionNext.from_dict(endpoint_gateway_collection_next_model_json).__dict__
- endpoint_gateway_collection_next_model2 = EndpointGatewayCollectionNext(**endpoint_gateway_collection_next_model_dict)
+ # Construct a model instance of IKEPolicyReferenceDeleted by calling from_dict on the json representation
+ ike_policy_reference_deleted_model_dict = IKEPolicyReferenceDeleted.from_dict(ike_policy_reference_deleted_model_json).__dict__
+ ike_policy_reference_deleted_model2 = IKEPolicyReferenceDeleted(**ike_policy_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_collection_next_model == endpoint_gateway_collection_next_model2
+ assert ike_policy_reference_deleted_model == ike_policy_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_collection_next_model_json2 = endpoint_gateway_collection_next_model.to_dict()
- assert endpoint_gateway_collection_next_model_json2 == endpoint_gateway_collection_next_model_json
+ ike_policy_reference_deleted_model_json2 = ike_policy_reference_deleted_model.to_dict()
+ assert ike_policy_reference_deleted_model_json2 == ike_policy_reference_deleted_model_json
-class TestModel_EndpointGatewayPatch():
+class TestModel_IP():
"""
- Test Class for EndpointGatewayPatch
+ Test Class for IP
"""
- def test_endpoint_gateway_patch_serialization(self):
+ def test_ip_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayPatch
+ Test serialization/deserialization for IP
"""
- # Construct a json representation of a EndpointGatewayPatch model
- endpoint_gateway_patch_model_json = {}
- endpoint_gateway_patch_model_json['name'] = 'my-endpoint-gateway'
+ # Construct a json representation of a IP model
+ ip_model_json = {}
+ ip_model_json['address'] = '192.168.3.4'
- # Construct a model instance of EndpointGatewayPatch by calling from_dict on the json representation
- endpoint_gateway_patch_model = EndpointGatewayPatch.from_dict(endpoint_gateway_patch_model_json)
- assert endpoint_gateway_patch_model != False
+ # Construct a model instance of IP by calling from_dict on the json representation
+ ip_model = IP.from_dict(ip_model_json)
+ assert ip_model != False
- # Construct a model instance of EndpointGatewayPatch by calling from_dict on the json representation
- endpoint_gateway_patch_model_dict = EndpointGatewayPatch.from_dict(endpoint_gateway_patch_model_json).__dict__
- endpoint_gateway_patch_model2 = EndpointGatewayPatch(**endpoint_gateway_patch_model_dict)
+ # Construct a model instance of IP by calling from_dict on the json representation
+ ip_model_dict = IP.from_dict(ip_model_json).__dict__
+ ip_model2 = IP(**ip_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_patch_model == endpoint_gateway_patch_model2
+ assert ip_model == ip_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_patch_model_json2 = endpoint_gateway_patch_model.to_dict()
- assert endpoint_gateway_patch_model_json2 == endpoint_gateway_patch_model_json
+ ip_model_json2 = ip_model.to_dict()
+ assert ip_model_json2 == ip_model_json
-class TestModel_EndpointGatewayReferenceDeleted():
+class TestModel_IPsecPolicy():
"""
- Test Class for EndpointGatewayReferenceDeleted
+ Test Class for IPsecPolicy
"""
- def test_endpoint_gateway_reference_deleted_serialization(self):
+ def test_i_psec_policy_serialization(self):
"""
- Test serialization/deserialization for EndpointGatewayReferenceDeleted
+ Test serialization/deserialization for IPsecPolicy
"""
- # Construct a json representation of a EndpointGatewayReferenceDeleted model
- endpoint_gateway_reference_deleted_model_json = {}
- endpoint_gateway_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of EndpointGatewayReferenceDeleted by calling from_dict on the json representation
- endpoint_gateway_reference_deleted_model = EndpointGatewayReferenceDeleted.from_dict(endpoint_gateway_reference_deleted_model_json)
- assert endpoint_gateway_reference_deleted_model != False
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of EndpointGatewayReferenceDeleted by calling from_dict on the json representation
- endpoint_gateway_reference_deleted_model_dict = EndpointGatewayReferenceDeleted.from_dict(endpoint_gateway_reference_deleted_model_json).__dict__
- endpoint_gateway_reference_deleted_model2 = EndpointGatewayReferenceDeleted(**endpoint_gateway_reference_deleted_model_dict)
+ vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
+ vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
+ vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
+ vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
+
+ 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'
+
+ # Construct a json representation of a IPsecPolicy model
+ i_psec_policy_model_json = {}
+ i_psec_policy_model_json['authentication_algorithm'] = 'md5'
+ i_psec_policy_model_json['connections'] = [vpn_gateway_connection_reference_model]
+ i_psec_policy_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ i_psec_policy_model_json['encapsulation_mode'] = 'tunnel'
+ i_psec_policy_model_json['encryption_algorithm'] = 'aes128'
+ i_psec_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ i_psec_policy_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ i_psec_policy_model_json['key_lifetime'] = 3600
+ i_psec_policy_model_json['name'] = 'my-ipsec-policy'
+ i_psec_policy_model_json['pfs'] = 'disabled'
+ i_psec_policy_model_json['resource_group'] = resource_group_reference_model
+ i_psec_policy_model_json['resource_type'] = 'ipsec_policy'
+ i_psec_policy_model_json['transform_protocol'] = 'esp'
+
+ # Construct a model instance of IPsecPolicy by calling from_dict on the json representation
+ i_psec_policy_model = IPsecPolicy.from_dict(i_psec_policy_model_json)
+ assert i_psec_policy_model != False
+
+ # Construct a model instance of IPsecPolicy by calling from_dict on the json representation
+ i_psec_policy_model_dict = IPsecPolicy.from_dict(i_psec_policy_model_json).__dict__
+ i_psec_policy_model2 = IPsecPolicy(**i_psec_policy_model_dict)
# Verify the model instances are equivalent
- assert endpoint_gateway_reference_deleted_model == endpoint_gateway_reference_deleted_model2
+ assert i_psec_policy_model == i_psec_policy_model2
# Convert model instance back to dict and verify no loss of data
- endpoint_gateway_reference_deleted_model_json2 = endpoint_gateway_reference_deleted_model.to_dict()
- assert endpoint_gateway_reference_deleted_model_json2 == endpoint_gateway_reference_deleted_model_json
+ i_psec_policy_model_json2 = i_psec_policy_model.to_dict()
+ assert i_psec_policy_model_json2 == i_psec_policy_model_json
-class TestModel_FloatingIP():
+class TestModel_IPsecPolicyCollection():
"""
- Test Class for FloatingIP
+ Test Class for IPsecPolicyCollection
"""
- def test_floating_ip_serialization(self):
+ def test_i_psec_policy_collection_serialization(self):
"""
- Test serialization/deserialization for FloatingIP
+ Test serialization/deserialization for IPsecPolicyCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
+ i_psec_policy_collection_first_model = {} # IPsecPolicyCollectionFirst
+ i_psec_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20'
+
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
+ vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
+ vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
+ vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
+
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'
- network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
- network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference
- floating_ip_target_model['deleted'] = network_interface_reference_deleted_model
- floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_model['name'] = 'my-network-interface'
- floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4'
- floating_ip_target_model['resource_type'] = 'network_interface'
-
- 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'
+ i_psec_policy_model = {} # IPsecPolicy
+ i_psec_policy_model['authentication_algorithm'] = 'md5'
+ i_psec_policy_model['connections'] = [vpn_gateway_connection_reference_model]
+ i_psec_policy_model['created_at'] = "2019-01-01T12:00:00Z"
+ i_psec_policy_model['encapsulation_mode'] = 'tunnel'
+ i_psec_policy_model['encryption_algorithm'] = 'aes128'
+ i_psec_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ i_psec_policy_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ i_psec_policy_model['key_lifetime'] = 3600
+ i_psec_policy_model['name'] = 'my-ipsec-policy'
+ i_psec_policy_model['pfs'] = 'disabled'
+ i_psec_policy_model['resource_group'] = resource_group_reference_model
+ i_psec_policy_model['resource_type'] = 'ipsec_policy'
+ i_psec_policy_model['transform_protocol'] = 'esp'
- # Construct a json representation of a FloatingIP model
- floating_ip_model_json = {}
- floating_ip_model_json['address'] = '203.0.113.1'
- floating_ip_model_json['created_at'] = "2019-01-01T12:00:00Z"
- floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_model_json['name'] = 'my-floating-ip'
- floating_ip_model_json['resource_group'] = resource_group_reference_model
- floating_ip_model_json['status'] = 'available'
- floating_ip_model_json['target'] = floating_ip_target_model
- floating_ip_model_json['zone'] = zone_reference_model
+ i_psec_policy_collection_next_model = {} # IPsecPolicyCollectionNext
+ i_psec_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
- # Construct a model instance of FloatingIP by calling from_dict on the json representation
- floating_ip_model = FloatingIP.from_dict(floating_ip_model_json)
- assert floating_ip_model != False
+ # Construct a json representation of a IPsecPolicyCollection model
+ i_psec_policy_collection_model_json = {}
+ i_psec_policy_collection_model_json['first'] = i_psec_policy_collection_first_model
+ i_psec_policy_collection_model_json['ipsec_policies'] = [i_psec_policy_model]
+ i_psec_policy_collection_model_json['limit'] = 20
+ i_psec_policy_collection_model_json['next'] = i_psec_policy_collection_next_model
+ i_psec_policy_collection_model_json['total_count'] = 132
- # Construct a model instance of FloatingIP by calling from_dict on the json representation
- floating_ip_model_dict = FloatingIP.from_dict(floating_ip_model_json).__dict__
- floating_ip_model2 = FloatingIP(**floating_ip_model_dict)
+ # Construct a model instance of IPsecPolicyCollection by calling from_dict on the json representation
+ i_psec_policy_collection_model = IPsecPolicyCollection.from_dict(i_psec_policy_collection_model_json)
+ assert i_psec_policy_collection_model != False
+
+ # Construct a model instance of IPsecPolicyCollection by calling from_dict on the json representation
+ i_psec_policy_collection_model_dict = IPsecPolicyCollection.from_dict(i_psec_policy_collection_model_json).__dict__
+ i_psec_policy_collection_model2 = IPsecPolicyCollection(**i_psec_policy_collection_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_model == floating_ip_model2
+ assert i_psec_policy_collection_model == i_psec_policy_collection_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_model_json2 = floating_ip_model.to_dict()
- assert floating_ip_model_json2 == floating_ip_model_json
+ i_psec_policy_collection_model_json2 = i_psec_policy_collection_model.to_dict()
+ assert i_psec_policy_collection_model_json2 == i_psec_policy_collection_model_json
-class TestModel_FloatingIPCollection():
+class TestModel_IPsecPolicyCollectionFirst():
"""
- Test Class for FloatingIPCollection
+ Test Class for IPsecPolicyCollectionFirst
"""
- def test_floating_ip_collection_serialization(self):
+ def test_i_psec_policy_collection_first_serialization(self):
"""
- Test serialization/deserialization for FloatingIPCollection
+ Test serialization/deserialization for IPsecPolicyCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- floating_ip_collection_first_model = {} # FloatingIPCollectionFirst
- floating_ip_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20'
+ # Construct a json representation of a IPsecPolicyCollectionFirst model
+ i_psec_policy_collection_first_model_json = {}
+ i_psec_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20'
- 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'
+ # Construct a model instance of IPsecPolicyCollectionFirst by calling from_dict on the json representation
+ i_psec_policy_collection_first_model = IPsecPolicyCollectionFirst.from_dict(i_psec_policy_collection_first_model_json)
+ assert i_psec_policy_collection_first_model != False
- network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
- network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of IPsecPolicyCollectionFirst by calling from_dict on the json representation
+ i_psec_policy_collection_first_model_dict = IPsecPolicyCollectionFirst.from_dict(i_psec_policy_collection_first_model_json).__dict__
+ i_psec_policy_collection_first_model2 = IPsecPolicyCollectionFirst(**i_psec_policy_collection_first_model_dict)
- floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference
- floating_ip_target_model['deleted'] = network_interface_reference_deleted_model
- floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_model['name'] = 'my-network-interface'
- floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4'
- floating_ip_target_model['resource_type'] = 'network_interface'
+ # Verify the model instances are equivalent
+ assert i_psec_policy_collection_first_model == i_psec_policy_collection_first_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ i_psec_policy_collection_first_model_json2 = i_psec_policy_collection_first_model.to_dict()
+ assert i_psec_policy_collection_first_model_json2 == i_psec_policy_collection_first_model_json
- floating_ip_model = {} # FloatingIP
- floating_ip_model['address'] = '203.0.113.1'
- floating_ip_model['created_at'] = "2019-01-01T12:00:00Z"
- floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_model['name'] = 'my-floating-ip'
- floating_ip_model['resource_group'] = resource_group_reference_model
- floating_ip_model['status'] = 'available'
- floating_ip_model['target'] = floating_ip_target_model
- floating_ip_model['zone'] = zone_reference_model
+class TestModel_IPsecPolicyCollectionNext():
+ """
+ Test Class for IPsecPolicyCollectionNext
+ """
- floating_ip_collection_next_model = {} # FloatingIPCollectionNext
- floating_ip_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ def test_i_psec_policy_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for IPsecPolicyCollectionNext
+ """
- # Construct a json representation of a FloatingIPCollection model
- floating_ip_collection_model_json = {}
- floating_ip_collection_model_json['first'] = floating_ip_collection_first_model
- floating_ip_collection_model_json['floating_ips'] = [floating_ip_model]
- floating_ip_collection_model_json['limit'] = 20
- floating_ip_collection_model_json['next'] = floating_ip_collection_next_model
- floating_ip_collection_model_json['total_count'] = 132
+ # Construct a json representation of a IPsecPolicyCollectionNext model
+ i_psec_policy_collection_next_model_json = {}
+ i_psec_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
- # Construct a model instance of FloatingIPCollection by calling from_dict on the json representation
- floating_ip_collection_model = FloatingIPCollection.from_dict(floating_ip_collection_model_json)
- assert floating_ip_collection_model != False
+ # Construct a model instance of IPsecPolicyCollectionNext by calling from_dict on the json representation
+ i_psec_policy_collection_next_model = IPsecPolicyCollectionNext.from_dict(i_psec_policy_collection_next_model_json)
+ assert i_psec_policy_collection_next_model != False
- # Construct a model instance of FloatingIPCollection by calling from_dict on the json representation
- floating_ip_collection_model_dict = FloatingIPCollection.from_dict(floating_ip_collection_model_json).__dict__
- floating_ip_collection_model2 = FloatingIPCollection(**floating_ip_collection_model_dict)
+ # Construct a model instance of IPsecPolicyCollectionNext by calling from_dict on the json representation
+ i_psec_policy_collection_next_model_dict = IPsecPolicyCollectionNext.from_dict(i_psec_policy_collection_next_model_json).__dict__
+ i_psec_policy_collection_next_model2 = IPsecPolicyCollectionNext(**i_psec_policy_collection_next_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_collection_model == floating_ip_collection_model2
+ assert i_psec_policy_collection_next_model == i_psec_policy_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_collection_model_json2 = floating_ip_collection_model.to_dict()
- assert floating_ip_collection_model_json2 == floating_ip_collection_model_json
+ i_psec_policy_collection_next_model_json2 = i_psec_policy_collection_next_model.to_dict()
+ assert i_psec_policy_collection_next_model_json2 == i_psec_policy_collection_next_model_json
-class TestModel_FloatingIPCollectionFirst():
+class TestModel_IPsecPolicyPatch():
"""
- Test Class for FloatingIPCollectionFirst
+ Test Class for IPsecPolicyPatch
"""
- def test_floating_ip_collection_first_serialization(self):
+ def test_i_psec_policy_patch_serialization(self):
"""
- Test serialization/deserialization for FloatingIPCollectionFirst
+ Test serialization/deserialization for IPsecPolicyPatch
"""
- # Construct a json representation of a FloatingIPCollectionFirst model
- floating_ip_collection_first_model_json = {}
- floating_ip_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?limit=20'
+ # Construct a json representation of a IPsecPolicyPatch model
+ i_psec_policy_patch_model_json = {}
+ i_psec_policy_patch_model_json['authentication_algorithm'] = 'md5'
+ i_psec_policy_patch_model_json['encryption_algorithm'] = 'aes128'
+ i_psec_policy_patch_model_json['key_lifetime'] = 3600
+ i_psec_policy_patch_model_json['name'] = 'my-ipsec-policy'
+ i_psec_policy_patch_model_json['pfs'] = 'disabled'
- # Construct a model instance of FloatingIPCollectionFirst by calling from_dict on the json representation
- floating_ip_collection_first_model = FloatingIPCollectionFirst.from_dict(floating_ip_collection_first_model_json)
- assert floating_ip_collection_first_model != False
+ # Construct a model instance of IPsecPolicyPatch by calling from_dict on the json representation
+ i_psec_policy_patch_model = IPsecPolicyPatch.from_dict(i_psec_policy_patch_model_json)
+ assert i_psec_policy_patch_model != False
- # Construct a model instance of FloatingIPCollectionFirst by calling from_dict on the json representation
- floating_ip_collection_first_model_dict = FloatingIPCollectionFirst.from_dict(floating_ip_collection_first_model_json).__dict__
- floating_ip_collection_first_model2 = FloatingIPCollectionFirst(**floating_ip_collection_first_model_dict)
+ # Construct a model instance of IPsecPolicyPatch by calling from_dict on the json representation
+ i_psec_policy_patch_model_dict = IPsecPolicyPatch.from_dict(i_psec_policy_patch_model_json).__dict__
+ i_psec_policy_patch_model2 = IPsecPolicyPatch(**i_psec_policy_patch_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_collection_first_model == floating_ip_collection_first_model2
+ assert i_psec_policy_patch_model == i_psec_policy_patch_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_collection_first_model_json2 = floating_ip_collection_first_model.to_dict()
- assert floating_ip_collection_first_model_json2 == floating_ip_collection_first_model_json
+ i_psec_policy_patch_model_json2 = i_psec_policy_patch_model.to_dict()
+ assert i_psec_policy_patch_model_json2 == i_psec_policy_patch_model_json
-class TestModel_FloatingIPCollectionNext():
+class TestModel_IPsecPolicyReference():
"""
- Test Class for FloatingIPCollectionNext
+ Test Class for IPsecPolicyReference
"""
- def test_floating_ip_collection_next_serialization(self):
+ def test_i_psec_policy_reference_serialization(self):
"""
- Test serialization/deserialization for FloatingIPCollectionNext
+ Test serialization/deserialization for IPsecPolicyReference
"""
- # Construct a json representation of a FloatingIPCollectionNext model
- floating_ip_collection_next_model_json = {}
- floating_ip_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of FloatingIPCollectionNext by calling from_dict on the json representation
- floating_ip_collection_next_model = FloatingIPCollectionNext.from_dict(floating_ip_collection_next_model_json)
- assert floating_ip_collection_next_model != False
+ i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted
+ i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of FloatingIPCollectionNext by calling from_dict on the json representation
- floating_ip_collection_next_model_dict = FloatingIPCollectionNext.from_dict(floating_ip_collection_next_model_json).__dict__
- floating_ip_collection_next_model2 = FloatingIPCollectionNext(**floating_ip_collection_next_model_dict)
+ # Construct a json representation of a IPsecPolicyReference model
+ i_psec_policy_reference_model_json = {}
+ i_psec_policy_reference_model_json['deleted'] = i_psec_policy_reference_deleted_model
+ i_psec_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ i_psec_policy_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ i_psec_policy_reference_model_json['name'] = 'my-ipsec-policy'
+ i_psec_policy_reference_model_json['resource_type'] = 'ipsec_policy'
+
+ # Construct a model instance of IPsecPolicyReference by calling from_dict on the json representation
+ i_psec_policy_reference_model = IPsecPolicyReference.from_dict(i_psec_policy_reference_model_json)
+ assert i_psec_policy_reference_model != False
+
+ # Construct a model instance of IPsecPolicyReference by calling from_dict on the json representation
+ i_psec_policy_reference_model_dict = IPsecPolicyReference.from_dict(i_psec_policy_reference_model_json).__dict__
+ i_psec_policy_reference_model2 = IPsecPolicyReference(**i_psec_policy_reference_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_collection_next_model == floating_ip_collection_next_model2
+ assert i_psec_policy_reference_model == i_psec_policy_reference_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_collection_next_model_json2 = floating_ip_collection_next_model.to_dict()
- assert floating_ip_collection_next_model_json2 == floating_ip_collection_next_model_json
+ i_psec_policy_reference_model_json2 = i_psec_policy_reference_model.to_dict()
+ assert i_psec_policy_reference_model_json2 == i_psec_policy_reference_model_json
-class TestModel_FloatingIPPatch():
+class TestModel_IPsecPolicyReferenceDeleted():
"""
- Test Class for FloatingIPPatch
+ Test Class for IPsecPolicyReferenceDeleted
"""
- def test_floating_ip_patch_serialization(self):
+ def test_i_psec_policy_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for FloatingIPPatch
+ Test serialization/deserialization for IPsecPolicyReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- floating_ip_patch_target_network_interface_identity_model = {} # FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById
- floating_ip_patch_target_network_interface_identity_model['id'] = '69e55145-cc7d-4d8e-9e1f-cc3fb60b1793'
-
- # Construct a json representation of a FloatingIPPatch model
- floating_ip_patch_model_json = {}
- floating_ip_patch_model_json['name'] = 'my-floating-ip'
- floating_ip_patch_model_json['target'] = floating_ip_patch_target_network_interface_identity_model
+ # Construct a json representation of a IPsecPolicyReferenceDeleted model
+ i_psec_policy_reference_deleted_model_json = {}
+ i_psec_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of FloatingIPPatch by calling from_dict on the json representation
- floating_ip_patch_model = FloatingIPPatch.from_dict(floating_ip_patch_model_json)
- assert floating_ip_patch_model != False
+ # Construct a model instance of IPsecPolicyReferenceDeleted by calling from_dict on the json representation
+ i_psec_policy_reference_deleted_model = IPsecPolicyReferenceDeleted.from_dict(i_psec_policy_reference_deleted_model_json)
+ assert i_psec_policy_reference_deleted_model != False
- # Construct a model instance of FloatingIPPatch by calling from_dict on the json representation
- floating_ip_patch_model_dict = FloatingIPPatch.from_dict(floating_ip_patch_model_json).__dict__
- floating_ip_patch_model2 = FloatingIPPatch(**floating_ip_patch_model_dict)
+ # Construct a model instance of IPsecPolicyReferenceDeleted by calling from_dict on the json representation
+ i_psec_policy_reference_deleted_model_dict = IPsecPolicyReferenceDeleted.from_dict(i_psec_policy_reference_deleted_model_json).__dict__
+ i_psec_policy_reference_deleted_model2 = IPsecPolicyReferenceDeleted(**i_psec_policy_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_patch_model == floating_ip_patch_model2
+ assert i_psec_policy_reference_deleted_model == i_psec_policy_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_patch_model_json2 = floating_ip_patch_model.to_dict()
- assert floating_ip_patch_model_json2 == floating_ip_patch_model_json
+ i_psec_policy_reference_deleted_model_json2 = i_psec_policy_reference_deleted_model.to_dict()
+ assert i_psec_policy_reference_deleted_model_json2 == i_psec_policy_reference_deleted_model_json
-class TestModel_FloatingIPReference():
+class TestModel_Image():
"""
- Test Class for FloatingIPReference
+ Test Class for Image
"""
- def test_floating_ip_reference_serialization(self):
+ def test_image_serialization(self):
"""
- Test serialization/deserialization for FloatingIPReference
+ Test serialization/deserialization for Image
"""
# Construct dict forms of any model objects needed in order to build this model.
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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'
- # Construct a json representation of a FloatingIPReference model
- floating_ip_reference_model_json = {}
- floating_ip_reference_model_json['address'] = '203.0.113.1'
- floating_ip_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model_json['deleted'] = floating_ip_reference_deleted_model
- floating_ip_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model_json['name'] = 'my-floating-ip'
+ image_file_checksums_model = {} # ImageFileChecksums
+ image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
- # Construct a model instance of FloatingIPReference by calling from_dict on the json representation
- floating_ip_reference_model = FloatingIPReference.from_dict(floating_ip_reference_model_json)
- assert floating_ip_reference_model != False
+ image_file_model = {} # ImageFile
+ image_file_model['checksums'] = image_file_checksums_model
+ image_file_model['size'] = 1
- # Construct a model instance of FloatingIPReference by calling from_dict on the json representation
- floating_ip_reference_model_dict = FloatingIPReference.from_dict(floating_ip_reference_model_json).__dict__
- floating_ip_reference_model2 = FloatingIPReference(**floating_ip_reference_model_dict)
+ operating_system_model = {} # OperatingSystem
+ operating_system_model['architecture'] = 'amd64'
+ operating_system_model['dedicated_host_only'] = False
+ operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
+ operating_system_model['family'] = 'Ubuntu Server'
+ operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ operating_system_model['name'] = 'ubuntu-16-amd64'
+ operating_system_model['vendor'] = 'Canonical'
+ operating_system_model['version'] = '16.04 LTS'
- # Verify the model instances are equivalent
- assert floating_ip_reference_model == floating_ip_reference_model2
+ 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'
- # Convert model instance back to dict and verify no loss of data
- floating_ip_reference_model_json2 = floating_ip_reference_model.to_dict()
- assert floating_ip_reference_model_json2 == floating_ip_reference_model_json
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_FloatingIPReferenceDeleted():
- """
- Test Class for FloatingIPReferenceDeleted
- """
+ volume_reference_model = {} # VolumeReference
+ volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['deleted'] = volume_reference_deleted_model
+ volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['name'] = 'my-volume'
- def test_floating_ip_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for FloatingIPReferenceDeleted
- """
+ image_status_reason_model = {} # ImageStatusReason
+ image_status_reason_model['code'] = 'encryption_key_deleted'
+ image_status_reason_model['message'] = 'testString'
+ image_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
- # Construct a json representation of a FloatingIPReferenceDeleted model
- floating_ip_reference_deleted_model_json = {}
- floating_ip_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a Image model
+ image_model_json = {}
+ image_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_model_json['encryption'] = 'user_managed'
+ image_model_json['encryption_key'] = encryption_key_reference_model
+ image_model_json['file'] = image_file_model
+ image_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ 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['operating_system'] = operating_system_model
+ image_model_json['resource_group'] = resource_group_reference_model
+ image_model_json['source_volume'] = volume_reference_model
+ image_model_json['status'] = 'available'
+ image_model_json['status_reasons'] = [image_status_reason_model]
+ image_model_json['visibility'] = 'private'
- # Construct a model instance of FloatingIPReferenceDeleted by calling from_dict on the json representation
- floating_ip_reference_deleted_model = FloatingIPReferenceDeleted.from_dict(floating_ip_reference_deleted_model_json)
- assert floating_ip_reference_deleted_model != False
+ # Construct a model instance of Image by calling from_dict on the json representation
+ image_model = Image.from_dict(image_model_json)
+ assert image_model != False
- # Construct a model instance of FloatingIPReferenceDeleted by calling from_dict on the json representation
- floating_ip_reference_deleted_model_dict = FloatingIPReferenceDeleted.from_dict(floating_ip_reference_deleted_model_json).__dict__
- floating_ip_reference_deleted_model2 = FloatingIPReferenceDeleted(**floating_ip_reference_deleted_model_dict)
+ # Construct a model instance of Image by calling from_dict on the json representation
+ image_model_dict = Image.from_dict(image_model_json).__dict__
+ image_model2 = Image(**image_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_reference_deleted_model == floating_ip_reference_deleted_model2
+ assert image_model == image_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_reference_deleted_model_json2 = floating_ip_reference_deleted_model.to_dict()
- assert floating_ip_reference_deleted_model_json2 == floating_ip_reference_deleted_model_json
+ image_model_json2 = image_model.to_dict()
+ assert image_model_json2 == image_model_json
-class TestModel_FloatingIPUnpaginatedCollection():
+class TestModel_ImageCollection():
"""
- Test Class for FloatingIPUnpaginatedCollection
+ Test Class for ImageCollection
"""
- def test_floating_ip_unpaginated_collection_serialization(self):
+ def test_image_collection_serialization(self):
"""
- Test serialization/deserialization for FloatingIPUnpaginatedCollection
+ Test serialization/deserialization for ImageCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
+ image_collection_first_model = {} # ImageCollectionFirst
+ image_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=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'
+
+ image_file_checksums_model = {} # ImageFileChecksums
+ image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
+
+ image_file_model = {} # ImageFile
+ image_file_model['checksums'] = image_file_checksums_model
+ image_file_model['size'] = 1
+
+ operating_system_model = {} # OperatingSystem
+ operating_system_model['architecture'] = 'amd64'
+ operating_system_model['dedicated_host_only'] = False
+ operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
+ operating_system_model['family'] = 'Ubuntu Server'
+ operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ operating_system_model['name'] = 'ubuntu-16-amd64'
+ operating_system_model['vendor'] = 'Canonical'
+ operating_system_model['version'] = '16.04 LTS'
+
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'
- network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
- network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- floating_ip_target_model = {} # FloatingIPTargetNetworkInterfaceReference
- floating_ip_target_model['deleted'] = network_interface_reference_deleted_model
- floating_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- floating_ip_target_model['name'] = 'my-network-interface'
- floating_ip_target_model['primary_ipv4_address'] = '192.168.3.4'
- floating_ip_target_model['resource_type'] = 'network_interface'
+ volume_reference_model = {} # VolumeReference
+ volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['deleted'] = volume_reference_deleted_model
+ volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['name'] = 'my-volume'
- 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'
+ image_status_reason_model = {} # ImageStatusReason
+ image_status_reason_model['code'] = 'encryption_key_deleted'
+ image_status_reason_model['message'] = 'testString'
+ image_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
- floating_ip_model = {} # FloatingIP
- floating_ip_model['address'] = '203.0.113.1'
- floating_ip_model['created_at'] = "2019-01-01T12:00:00Z"
- floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_model['name'] = 'my-floating-ip'
- floating_ip_model['resource_group'] = resource_group_reference_model
- floating_ip_model['status'] = 'available'
- floating_ip_model['target'] = floating_ip_target_model
- floating_ip_model['zone'] = zone_reference_model
+ image_model = {} # Image
+ image_model['created_at'] = "2019-01-01T12:00:00Z"
+ image_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_model['encryption'] = 'user_managed'
+ image_model['encryption_key'] = encryption_key_reference_model
+ image_model['file'] = image_file_model
+ image_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_model['minimum_provisioned_size'] = 38
+ image_model['name'] = 'my-image'
+ image_model['operating_system'] = operating_system_model
+ image_model['resource_group'] = resource_group_reference_model
+ image_model['source_volume'] = volume_reference_model
+ image_model['status'] = 'available'
+ image_model['status_reasons'] = [image_status_reason_model]
+ image_model['visibility'] = 'private'
- # Construct a json representation of a FloatingIPUnpaginatedCollection model
- floating_ip_unpaginated_collection_model_json = {}
- floating_ip_unpaginated_collection_model_json['floating_ips'] = [floating_ip_model]
+ image_collection_next_model = {} # ImageCollectionNext
+ image_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of FloatingIPUnpaginatedCollection by calling from_dict on the json representation
- floating_ip_unpaginated_collection_model = FloatingIPUnpaginatedCollection.from_dict(floating_ip_unpaginated_collection_model_json)
- assert floating_ip_unpaginated_collection_model != False
+ # Construct a json representation of a ImageCollection model
+ image_collection_model_json = {}
+ image_collection_model_json['first'] = image_collection_first_model
+ image_collection_model_json['images'] = [image_model]
+ image_collection_model_json['limit'] = 20
+ image_collection_model_json['next'] = image_collection_next_model
- # Construct a model instance of FloatingIPUnpaginatedCollection by calling from_dict on the json representation
- floating_ip_unpaginated_collection_model_dict = FloatingIPUnpaginatedCollection.from_dict(floating_ip_unpaginated_collection_model_json).__dict__
- floating_ip_unpaginated_collection_model2 = FloatingIPUnpaginatedCollection(**floating_ip_unpaginated_collection_model_dict)
+ # Construct a model instance of ImageCollection by calling from_dict on the json representation
+ image_collection_model = ImageCollection.from_dict(image_collection_model_json)
+ assert image_collection_model != False
+
+ # Construct a model instance of ImageCollection by calling from_dict on the json representation
+ image_collection_model_dict = ImageCollection.from_dict(image_collection_model_json).__dict__
+ image_collection_model2 = ImageCollection(**image_collection_model_dict)
# Verify the model instances are equivalent
- assert floating_ip_unpaginated_collection_model == floating_ip_unpaginated_collection_model2
+ assert image_collection_model == image_collection_model2
# Convert model instance back to dict and verify no loss of data
- floating_ip_unpaginated_collection_model_json2 = floating_ip_unpaginated_collection_model.to_dict()
- assert floating_ip_unpaginated_collection_model_json2 == floating_ip_unpaginated_collection_model_json
+ image_collection_model_json2 = image_collection_model.to_dict()
+ assert image_collection_model_json2 == image_collection_model_json
-class TestModel_FlowLogCollector():
+class TestModel_ImageCollectionFirst():
"""
- Test Class for FlowLogCollector
+ Test Class for ImageCollectionFirst
"""
- def test_flow_log_collector_serialization(self):
+ def test_image_collection_first_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollector
+ Test serialization/deserialization for ImageCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ # Construct a json representation of a ImageCollectionFirst model
+ image_collection_first_model_json = {}
+ image_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20'
- cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference
- cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
+ # Construct a model instance of ImageCollectionFirst by calling from_dict on the json representation
+ image_collection_first_model = ImageCollectionFirst.from_dict(image_collection_first_model_json)
+ assert image_collection_first_model != False
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of ImageCollectionFirst by calling from_dict on the json representation
+ image_collection_first_model_dict = ImageCollectionFirst.from_dict(image_collection_first_model_json).__dict__
+ image_collection_first_model2 = ImageCollectionFirst(**image_collection_first_model_dict)
- flow_log_collector_target_model = {} # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext
- 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['resource_type'] = 'network_interface'
+ # Verify the model instances are equivalent
+ assert image_collection_first_model == image_collection_first_model2
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ image_collection_first_model_json2 = image_collection_first_model.to_dict()
+ assert image_collection_first_model_json2 == image_collection_first_model_json
- 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'
+class TestModel_ImageCollectionNext():
+ """
+ Test Class for ImageCollectionNext
+ """
- # Construct a json representation of a FlowLogCollector model
- flow_log_collector_model_json = {}
- flow_log_collector_model_json['active'] = True
- flow_log_collector_model_json['auto_delete'] = True
- flow_log_collector_model_json['created_at'] = "2019-01-01T12:00:00Z"
- flow_log_collector_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689'
- flow_log_collector_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689'
- flow_log_collector_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- flow_log_collector_model_json['lifecycle_state'] = 'stable'
- flow_log_collector_model_json['name'] = 'my-flow-log-collector'
- flow_log_collector_model_json['resource_group'] = resource_group_reference_model
- flow_log_collector_model_json['storage_bucket'] = cloud_object_storage_bucket_reference_model
- flow_log_collector_model_json['target'] = flow_log_collector_target_model
- flow_log_collector_model_json['vpc'] = vpc_reference_model
+ def test_image_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for ImageCollectionNext
+ """
- # Construct a model instance of FlowLogCollector by calling from_dict on the json representation
- flow_log_collector_model = FlowLogCollector.from_dict(flow_log_collector_model_json)
- assert flow_log_collector_model != False
+ # Construct a json representation of a ImageCollectionNext model
+ image_collection_next_model_json = {}
+ image_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of FlowLogCollector by calling from_dict on the json representation
- flow_log_collector_model_dict = FlowLogCollector.from_dict(flow_log_collector_model_json).__dict__
- flow_log_collector_model2 = FlowLogCollector(**flow_log_collector_model_dict)
+ # Construct a model instance of ImageCollectionNext by calling from_dict on the json representation
+ image_collection_next_model = ImageCollectionNext.from_dict(image_collection_next_model_json)
+ assert image_collection_next_model != False
+
+ # Construct a model instance of ImageCollectionNext by calling from_dict on the json representation
+ image_collection_next_model_dict = ImageCollectionNext.from_dict(image_collection_next_model_json).__dict__
+ image_collection_next_model2 = ImageCollectionNext(**image_collection_next_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_model == flow_log_collector_model2
+ assert image_collection_next_model == image_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_model_json2 = flow_log_collector_model.to_dict()
- assert flow_log_collector_model_json2 == flow_log_collector_model_json
+ image_collection_next_model_json2 = image_collection_next_model.to_dict()
+ assert image_collection_next_model_json2 == image_collection_next_model_json
-class TestModel_FlowLogCollectorCollection():
+class TestModel_ImageFile():
"""
- Test Class for FlowLogCollectorCollection
+ Test Class for ImageFile
"""
- def test_flow_log_collector_collection_serialization(self):
+ def test_image_file_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorCollection
+ Test serialization/deserialization for ImageFile
"""
# Construct dict forms of any model objects needed in order to build this model.
- flow_log_collector_collection_first_model = {} # FlowLogCollectorCollectionFirst
- flow_log_collector_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20'
-
- 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'
+ image_file_checksums_model = {} # ImageFileChecksums
+ image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
- cloud_object_storage_bucket_reference_model = {} # CloudObjectStorageBucketReference
- cloud_object_storage_bucket_reference_model['name'] = 'bucket-27200-lwx4cfvcue'
+ # Construct a json representation of a ImageFile model
+ image_file_model_json = {}
+ image_file_model_json['checksums'] = image_file_checksums_model
+ image_file_model_json['size'] = 1
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of ImageFile by calling from_dict on the json representation
+ image_file_model = ImageFile.from_dict(image_file_model_json)
+ assert image_file_model != False
- flow_log_collector_target_model = {} # FlowLogCollectorTargetNetworkInterfaceReferenceTargetContext
- 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['resource_type'] = 'network_interface'
+ # Construct a model instance of ImageFile by calling from_dict on the json representation
+ image_file_model_dict = ImageFile.from_dict(image_file_model_json).__dict__
+ image_file_model2 = ImageFile(**image_file_model_dict)
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert image_file_model == image_file_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ image_file_model_json2 = image_file_model.to_dict()
+ assert image_file_model_json2 == image_file_model_json
- flow_log_collector_model = {} # FlowLogCollector
- flow_log_collector_model['active'] = True
- flow_log_collector_model['auto_delete'] = True
- flow_log_collector_model['created_at'] = "2019-01-01T12:00:00Z"
- flow_log_collector_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::flow-log-collector:39300233-9995-4806-89a5-3c1b6eb88689'
- flow_log_collector_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors/39300233-9995-4806-89a5-3c1b6eb88689'
- flow_log_collector_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- flow_log_collector_model['lifecycle_state'] = 'stable'
- flow_log_collector_model['name'] = 'my-flow-log-collector'
- flow_log_collector_model['resource_group'] = resource_group_reference_model
- flow_log_collector_model['storage_bucket'] = cloud_object_storage_bucket_reference_model
- flow_log_collector_model['target'] = flow_log_collector_target_model
- flow_log_collector_model['vpc'] = vpc_reference_model
+class TestModel_ImageFileChecksums():
+ """
+ Test Class for ImageFileChecksums
+ """
- flow_log_collector_collection_next_model = {} # FlowLogCollectorCollectionNext
- flow_log_collector_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ def test_image_file_checksums_serialization(self):
+ """
+ Test serialization/deserialization for ImageFileChecksums
+ """
- # Construct a json representation of a FlowLogCollectorCollection model
- flow_log_collector_collection_model_json = {}
- flow_log_collector_collection_model_json['first'] = flow_log_collector_collection_first_model
- flow_log_collector_collection_model_json['flow_log_collectors'] = [flow_log_collector_model]
- flow_log_collector_collection_model_json['limit'] = 20
- flow_log_collector_collection_model_json['next'] = flow_log_collector_collection_next_model
- flow_log_collector_collection_model_json['total_count'] = 132
+ # Construct a json representation of a ImageFileChecksums model
+ image_file_checksums_model_json = {}
+ image_file_checksums_model_json['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
- # Construct a model instance of FlowLogCollectorCollection by calling from_dict on the json representation
- flow_log_collector_collection_model = FlowLogCollectorCollection.from_dict(flow_log_collector_collection_model_json)
- assert flow_log_collector_collection_model != False
+ # Construct a model instance of ImageFileChecksums by calling from_dict on the json representation
+ image_file_checksums_model = ImageFileChecksums.from_dict(image_file_checksums_model_json)
+ assert image_file_checksums_model != False
- # Construct a model instance of FlowLogCollectorCollection by calling from_dict on the json representation
- flow_log_collector_collection_model_dict = FlowLogCollectorCollection.from_dict(flow_log_collector_collection_model_json).__dict__
- flow_log_collector_collection_model2 = FlowLogCollectorCollection(**flow_log_collector_collection_model_dict)
+ # Construct a model instance of ImageFileChecksums by calling from_dict on the json representation
+ image_file_checksums_model_dict = ImageFileChecksums.from_dict(image_file_checksums_model_json).__dict__
+ image_file_checksums_model2 = ImageFileChecksums(**image_file_checksums_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_collection_model == flow_log_collector_collection_model2
+ assert image_file_checksums_model == image_file_checksums_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_collection_model_json2 = flow_log_collector_collection_model.to_dict()
- assert flow_log_collector_collection_model_json2 == flow_log_collector_collection_model_json
+ image_file_checksums_model_json2 = image_file_checksums_model.to_dict()
+ assert image_file_checksums_model_json2 == image_file_checksums_model_json
-class TestModel_FlowLogCollectorCollectionFirst():
+class TestModel_ImageFilePrototype():
"""
- Test Class for FlowLogCollectorCollectionFirst
+ Test Class for ImageFilePrototype
"""
- def test_flow_log_collector_collection_first_serialization(self):
+ def test_image_file_prototype_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorCollectionFirst
+ Test serialization/deserialization for ImageFilePrototype
"""
- # Construct a json representation of a FlowLogCollectorCollectionFirst model
- flow_log_collector_collection_first_model_json = {}
- flow_log_collector_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?limit=20'
+ # Construct a json representation of a ImageFilePrototype model
+ image_file_prototype_model_json = {}
+ image_file_prototype_model_json['href'] = 'cos://us-south/custom-image-vpc-bucket/customImage-0.vhd'
- # Construct a model instance of FlowLogCollectorCollectionFirst by calling from_dict on the json representation
- flow_log_collector_collection_first_model = FlowLogCollectorCollectionFirst.from_dict(flow_log_collector_collection_first_model_json)
- assert flow_log_collector_collection_first_model != False
+ # Construct a model instance of ImageFilePrototype by calling from_dict on the json representation
+ image_file_prototype_model = ImageFilePrototype.from_dict(image_file_prototype_model_json)
+ assert image_file_prototype_model != False
- # Construct a model instance of FlowLogCollectorCollectionFirst by calling from_dict on the json representation
- flow_log_collector_collection_first_model_dict = FlowLogCollectorCollectionFirst.from_dict(flow_log_collector_collection_first_model_json).__dict__
- flow_log_collector_collection_first_model2 = FlowLogCollectorCollectionFirst(**flow_log_collector_collection_first_model_dict)
+ # Construct a model instance of ImageFilePrototype by calling from_dict on the json representation
+ image_file_prototype_model_dict = ImageFilePrototype.from_dict(image_file_prototype_model_json).__dict__
+ image_file_prototype_model2 = ImageFilePrototype(**image_file_prototype_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_collection_first_model == flow_log_collector_collection_first_model2
+ assert image_file_prototype_model == image_file_prototype_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_collection_first_model_json2 = flow_log_collector_collection_first_model.to_dict()
- assert flow_log_collector_collection_first_model_json2 == flow_log_collector_collection_first_model_json
+ image_file_prototype_model_json2 = image_file_prototype_model.to_dict()
+ assert image_file_prototype_model_json2 == image_file_prototype_model_json
-class TestModel_FlowLogCollectorCollectionNext():
+class TestModel_ImagePatch():
"""
- Test Class for FlowLogCollectorCollectionNext
+ Test Class for ImagePatch
"""
- def test_flow_log_collector_collection_next_serialization(self):
+ def test_image_patch_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorCollectionNext
+ Test serialization/deserialization for ImagePatch
"""
- # Construct a json representation of a FlowLogCollectorCollectionNext model
- flow_log_collector_collection_next_model_json = {}
- flow_log_collector_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/flow_log_collectors?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a ImagePatch model
+ image_patch_model_json = {}
+ image_patch_model_json['name'] = 'my-image'
- # Construct a model instance of FlowLogCollectorCollectionNext by calling from_dict on the json representation
- flow_log_collector_collection_next_model = FlowLogCollectorCollectionNext.from_dict(flow_log_collector_collection_next_model_json)
- assert flow_log_collector_collection_next_model != False
+ # Construct a model instance of ImagePatch by calling from_dict on the json representation
+ image_patch_model = ImagePatch.from_dict(image_patch_model_json)
+ assert image_patch_model != False
- # Construct a model instance of FlowLogCollectorCollectionNext by calling from_dict on the json representation
- flow_log_collector_collection_next_model_dict = FlowLogCollectorCollectionNext.from_dict(flow_log_collector_collection_next_model_json).__dict__
- flow_log_collector_collection_next_model2 = FlowLogCollectorCollectionNext(**flow_log_collector_collection_next_model_dict)
+ # Construct a model instance of ImagePatch by calling from_dict on the json representation
+ image_patch_model_dict = ImagePatch.from_dict(image_patch_model_json).__dict__
+ image_patch_model2 = ImagePatch(**image_patch_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_collection_next_model == flow_log_collector_collection_next_model2
+ assert image_patch_model == image_patch_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_collection_next_model_json2 = flow_log_collector_collection_next_model.to_dict()
- assert flow_log_collector_collection_next_model_json2 == flow_log_collector_collection_next_model_json
+ image_patch_model_json2 = image_patch_model.to_dict()
+ assert image_patch_model_json2 == image_patch_model_json
-class TestModel_FlowLogCollectorPatch():
+class TestModel_ImageReference():
"""
- Test Class for FlowLogCollectorPatch
+ Test Class for ImageReference
"""
- def test_flow_log_collector_patch_serialization(self):
+ def test_image_reference_serialization(self):
"""
- Test serialization/deserialization for FlowLogCollectorPatch
+ Test serialization/deserialization for ImageReference
"""
- # Construct a json representation of a FlowLogCollectorPatch model
- flow_log_collector_patch_model_json = {}
- flow_log_collector_patch_model_json['active'] = True
- flow_log_collector_patch_model_json['name'] = 'my-flow-log-collector'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of FlowLogCollectorPatch by calling from_dict on the json representation
- flow_log_collector_patch_model = FlowLogCollectorPatch.from_dict(flow_log_collector_patch_model_json)
- assert flow_log_collector_patch_model != False
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of FlowLogCollectorPatch by calling from_dict on the json representation
- flow_log_collector_patch_model_dict = FlowLogCollectorPatch.from_dict(flow_log_collector_patch_model_json).__dict__
- flow_log_collector_patch_model2 = FlowLogCollectorPatch(**flow_log_collector_patch_model_dict)
+ # Construct a json representation of a ImageReference model
+ image_reference_model_json = {}
+ image_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model_json['deleted'] = image_reference_deleted_model
+ image_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model_json['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model_json['name'] = 'my-image'
+
+ # Construct a model instance of ImageReference by calling from_dict on the json representation
+ image_reference_model = ImageReference.from_dict(image_reference_model_json)
+ assert image_reference_model != False
+
+ # Construct a model instance of ImageReference by calling from_dict on the json representation
+ image_reference_model_dict = ImageReference.from_dict(image_reference_model_json).__dict__
+ image_reference_model2 = ImageReference(**image_reference_model_dict)
# Verify the model instances are equivalent
- assert flow_log_collector_patch_model == flow_log_collector_patch_model2
+ assert image_reference_model == image_reference_model2
# Convert model instance back to dict and verify no loss of data
- flow_log_collector_patch_model_json2 = flow_log_collector_patch_model.to_dict()
- assert flow_log_collector_patch_model_json2 == flow_log_collector_patch_model_json
+ image_reference_model_json2 = image_reference_model.to_dict()
+ assert image_reference_model_json2 == image_reference_model_json
-class TestModel_IKEPolicy():
+class TestModel_ImageReferenceDeleted():
"""
- Test Class for IKEPolicy
+ Test Class for ImageReferenceDeleted
"""
- def test_ike_policy_serialization(self):
+ def test_image_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for IKEPolicy
+ Test serialization/deserialization for ImageReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a ImageReferenceDeleted model
+ image_reference_deleted_model_json = {}
+ image_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
- vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of ImageReferenceDeleted by calling from_dict on the json representation
+ image_reference_deleted_model = ImageReferenceDeleted.from_dict(image_reference_deleted_model_json)
+ assert image_reference_deleted_model != False
- vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
- vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
- vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
- vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
+ # Construct a model instance of ImageReferenceDeleted by calling from_dict on the json representation
+ image_reference_deleted_model_dict = ImageReferenceDeleted.from_dict(image_reference_deleted_model_json).__dict__
+ image_reference_deleted_model2 = ImageReferenceDeleted(**image_reference_deleted_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert image_reference_deleted_model == image_reference_deleted_model2
- # Construct a json representation of a IKEPolicy model
- ike_policy_model_json = {}
- ike_policy_model_json['authentication_algorithm'] = 'md5'
- ike_policy_model_json['connections'] = [vpn_gateway_connection_reference_model]
- ike_policy_model_json['created_at'] = "2019-01-01T12:00:00Z"
- ike_policy_model_json['dh_group'] = 14
- ike_policy_model_json['encryption_algorithm'] = 'aes128'
- ike_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- ike_policy_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- ike_policy_model_json['ike_version'] = 1
- ike_policy_model_json['key_lifetime'] = 28800
- ike_policy_model_json['name'] = 'my-ike-policy'
- ike_policy_model_json['negotiation_mode'] = 'main'
- ike_policy_model_json['resource_group'] = resource_group_reference_model
- ike_policy_model_json['resource_type'] = 'ike_policy'
+ # Convert model instance back to dict and verify no loss of data
+ image_reference_deleted_model_json2 = image_reference_deleted_model.to_dict()
+ assert image_reference_deleted_model_json2 == image_reference_deleted_model_json
- # Construct a model instance of IKEPolicy by calling from_dict on the json representation
- ike_policy_model = IKEPolicy.from_dict(ike_policy_model_json)
- assert ike_policy_model != False
+class TestModel_ImageStatusReason():
+ """
+ Test Class for ImageStatusReason
+ """
- # Construct a model instance of IKEPolicy by calling from_dict on the json representation
- ike_policy_model_dict = IKEPolicy.from_dict(ike_policy_model_json).__dict__
- ike_policy_model2 = IKEPolicy(**ike_policy_model_dict)
+ def test_image_status_reason_serialization(self):
+ """
+ Test serialization/deserialization for ImageStatusReason
+ """
+
+ # Construct a json representation of a ImageStatusReason model
+ image_status_reason_model_json = {}
+ image_status_reason_model_json['code'] = 'encryption_key_deleted'
+ image_status_reason_model_json['message'] = 'testString'
+ image_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
+
+ # Construct a model instance of ImageStatusReason by calling from_dict on the json representation
+ image_status_reason_model = ImageStatusReason.from_dict(image_status_reason_model_json)
+ assert image_status_reason_model != False
+
+ # Construct a model instance of ImageStatusReason by calling from_dict on the json representation
+ image_status_reason_model_dict = ImageStatusReason.from_dict(image_status_reason_model_json).__dict__
+ image_status_reason_model2 = ImageStatusReason(**image_status_reason_model_dict)
# Verify the model instances are equivalent
- assert ike_policy_model == ike_policy_model2
+ assert image_status_reason_model == image_status_reason_model2
# Convert model instance back to dict and verify no loss of data
- ike_policy_model_json2 = ike_policy_model.to_dict()
- assert ike_policy_model_json2 == ike_policy_model_json
+ image_status_reason_model_json2 = image_status_reason_model.to_dict()
+ assert image_status_reason_model_json2 == image_status_reason_model_json
-class TestModel_IKEPolicyCollection():
+class TestModel_Instance():
"""
- Test Class for IKEPolicyCollection
+ Test Class for Instance
"""
- def test_ike_policy_collection_serialization(self):
+ def test_instance_serialization(self):
"""
- Test serialization/deserialization for IKEPolicyCollection
+ Test serialization/deserialization for Instance
"""
# Construct dict forms of any model objects needed in order to build this model.
- ike_policy_collection_first_model = {} # IKEPolicyCollectionFirst
- ike_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20'
+ volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted
+ volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
- vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = 'a8a15363-a6f7-4f01-af60-715e85b28141'
- vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
- vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
- vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
- vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ volume_reference_model = {} # VolumeReference
+ volume_reference_model['crn'] = 'crn:[...]'
+ volume_reference_model['deleted'] = volume_reference_deleted_model
+ volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916'
+ volume_reference_model['id'] = '49c5d61b-41e7-4c01-9b7a-1a97366c6916'
+ volume_reference_model['name'] = 'my-boot-volume'
+
+ volume_attachment_reference_instance_context_model = {} # VolumeAttachmentReferenceInstanceContext
+ volume_attachment_reference_instance_context_model['deleted'] = volume_attachment_reference_instance_context_deleted_model
+ volume_attachment_reference_instance_context_model['device'] = volume_attachment_device_model
+ volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/7389-a8a15363-a6f7-4f01-af60-715e85b28141'
+ volume_attachment_reference_instance_context_model['id'] = 'a8a15363-a6f7-4f01-af60-715e85b28141'
+ volume_attachment_reference_instance_context_model['name'] = 'my-boot-volume-attachment'
+ volume_attachment_reference_instance_context_model['volume'] = volume_reference_model
+
+ dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
+ dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ dedicated_host_reference_model = {} # DedicatedHostReference
+ dedicated_host_reference_model['crn'] = 'crn:[...]'
+ dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model
+ dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221'
+ dedicated_host_reference_model['id'] = '0787-8c2a09be-ee18-4af2-8ef4-6a6060732221'
+ dedicated_host_reference_model['name'] = 'test-new'
+ dedicated_host_reference_model['resource_type'] = 'dedicated_host'
+
+ instance_disk_model = {} # InstanceDisk
+ instance_disk_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_model['interface_type'] = 'nvme'
+ instance_disk_model['name'] = 'my-instance-disk'
+ instance_disk_model['resource_type'] = 'instance_disk'
+ instance_disk_model['size'] = 100
+
+ instance_gpu_model = {} # InstanceGPU
+ instance_gpu_model['count'] = 1
+ instance_gpu_model['manufacturer'] = 'nvidia'
+ instance_gpu_model['memory'] = 1
+ instance_gpu_model['model'] = 'Tesla V100'
+
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ image_reference_model = {} # ImageReference
+ image_reference_model['crn'] = 'crn:[...]'
+ image_reference_model['deleted'] = image_reference_deleted_model
+ image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366'
+ image_reference_model['id'] = '9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366'
+ image_reference_model['name'] = 'my-image'
+
+ network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted
+ network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ 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/7389-bea6a632-5e13-42a4-b4b8-31dc877abfe4'
+ subnet_reference_model['id'] = 'bea6a632-5e13-42a4-b4b8-31dc877abfe4'
+ subnet_reference_model['name'] = 'my-subnet'
+
+ network_interface_instance_context_reference_model = {} # NetworkInterfaceInstanceContextReference
+ 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/e402fa1b-96f6-4aa2-a8d7-703aac843651/network_interfaces/7ca88dfb-8962-469d-b1de-1dd56f4c3275'
+ network_interface_instance_context_reference_model['id'] = '7ca88dfb-8962-469d-b1de-1dd56f4c3275'
+ network_interface_instance_context_reference_model['name'] = 'my-network-interface'
+ network_interface_instance_context_reference_model['primary_ipv4_address'] = '10.0.0.32'
+ network_interface_instance_context_reference_model['resource_type'] = 'network_interface'
+ network_interface_instance_context_reference_model['subnet'] = subnet_reference_model
+
+ dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
+ dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_placement_target_model = {} # InstancePlacementTargetDedicatedHostGroupReference
+ instance_placement_target_model['crn'] = 'crn:[...]'
+ instance_placement_target_model['deleted'] = dedicated_host_group_reference_deleted_model
+ instance_placement_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221'
+ instance_placement_target_model['id'] = '0787-8c2a09be-ee18-4af2-8ef4-6a6060732221'
+ instance_placement_target_model['name'] = 'test-new'
+ instance_placement_target_model['resource_type'] = 'dedicated_host'
+
+ instance_profile_reference_model = {} # InstanceProfileReference
+ instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-2x8'
+ instance_profile_reference_model['name'] = 'bx2-2x8'
resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21'
+ resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21'
+ resource_group_reference_model['name'] = 'Default'
- ike_policy_model = {} # IKEPolicy
- ike_policy_model['authentication_algorithm'] = 'md5'
- ike_policy_model['connections'] = [vpn_gateway_connection_reference_model]
- ike_policy_model['created_at'] = "2019-01-01T12:00:00Z"
- ike_policy_model['dh_group'] = 14
- ike_policy_model['encryption_algorithm'] = 'aes128'
- ike_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- ike_policy_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- ike_policy_model['ike_version'] = 1
- ike_policy_model['key_lifetime'] = 28800
- ike_policy_model['name'] = 'my-ike-policy'
- ike_policy_model['negotiation_mode'] = 'main'
- ike_policy_model['resource_group'] = resource_group_reference_model
- ike_policy_model['resource_type'] = 'ike_policy'
+ instance_status_reason_model = {} # InstanceStatusReason
+ instance_status_reason_model['code'] = 'cannot_start_storage'
+ instance_status_reason_model['message'] = 'The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted'
+ instance_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
- ike_policy_collection_next_model = {} # IKEPolicyCollectionNext
- ike_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
+ instance_vcpu_model = {} # InstanceVCPU
+ instance_vcpu_model['architecture'] = 'amd64'
+ instance_vcpu_model['count'] = 2
- # Construct a json representation of a IKEPolicyCollection model
- ike_policy_collection_model_json = {}
- ike_policy_collection_model_json['first'] = ike_policy_collection_first_model
- ike_policy_collection_model_json['ike_policies'] = [ike_policy_model]
- ike_policy_collection_model_json['limit'] = 20
- ike_policy_collection_model_json['next'] = ike_policy_collection_next_model
- ike_policy_collection_model_json['total_count'] = 132
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of IKEPolicyCollection by calling from_dict on the json representation
- ike_policy_collection_model = IKEPolicyCollection.from_dict(ike_policy_collection_model_json)
- assert ike_policy_collection_model != False
+ 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/f0aae929-7047-46d1-92e1-9102b07a7f6f'
+ vpc_reference_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f'
+ vpc_reference_model['name'] = 'my-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 Instance model
+ instance_model_json = {}
+ instance_model_json['bandwidth'] = 1000
+ instance_model_json['boot_volume_attachment'] = volume_attachment_reference_instance_context_model
+ instance_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ instance_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model_json['dedicated_host'] = dedicated_host_reference_model
+ instance_model_json['disks'] = [instance_disk_model]
+ instance_model_json['gpu'] = instance_gpu_model
+ instance_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model_json['image'] = image_reference_model
+ instance_model_json['memory'] = 8
+ instance_model_json['name'] = 'my-instance'
+ instance_model_json['network_interfaces'] = [network_interface_instance_context_reference_model]
+ instance_model_json['placement_target'] = instance_placement_target_model
+ instance_model_json['primary_network_interface'] = network_interface_instance_context_reference_model
+ instance_model_json['profile'] = instance_profile_reference_model
+ instance_model_json['resource_group'] = resource_group_reference_model
+ instance_model_json['startable'] = True
+ instance_model_json['status'] = 'deleting'
+ instance_model_json['status_reasons'] = [instance_status_reason_model]
+ instance_model_json['total_network_bandwidth'] = 500
+ instance_model_json['total_volume_bandwidth'] = 500
+ instance_model_json['vcpu'] = instance_vcpu_model
+ instance_model_json['volume_attachments'] = [volume_attachment_reference_instance_context_model]
+ instance_model_json['vpc'] = vpc_reference_model
+ instance_model_json['zone'] = zone_reference_model
+
+ # Construct a model instance of Instance by calling from_dict on the json representation
+ instance_model = Instance.from_dict(instance_model_json)
+ assert instance_model != False
- # Construct a model instance of IKEPolicyCollection by calling from_dict on the json representation
- ike_policy_collection_model_dict = IKEPolicyCollection.from_dict(ike_policy_collection_model_json).__dict__
- ike_policy_collection_model2 = IKEPolicyCollection(**ike_policy_collection_model_dict)
+ # Construct a model instance of Instance by calling from_dict on the json representation
+ instance_model_dict = Instance.from_dict(instance_model_json).__dict__
+ instance_model2 = Instance(**instance_model_dict)
# Verify the model instances are equivalent
- assert ike_policy_collection_model == ike_policy_collection_model2
+ assert instance_model == instance_model2
# Convert model instance back to dict and verify no loss of data
- ike_policy_collection_model_json2 = ike_policy_collection_model.to_dict()
- assert ike_policy_collection_model_json2 == ike_policy_collection_model_json
+ instance_model_json2 = instance_model.to_dict()
+ assert instance_model_json2 == instance_model_json
-class TestModel_IKEPolicyCollectionFirst():
+class TestModel_InstanceAction():
"""
- Test Class for IKEPolicyCollectionFirst
+ Test Class for InstanceAction
"""
- def test_ike_policy_collection_first_serialization(self):
+ def test_instance_action_serialization(self):
"""
- Test serialization/deserialization for IKEPolicyCollectionFirst
+ Test serialization/deserialization for InstanceAction
"""
- # Construct a json representation of a IKEPolicyCollectionFirst model
- ike_policy_collection_first_model_json = {}
- ike_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?limit=20'
+ # Construct a json representation of a InstanceAction model
+ instance_action_model_json = {}
+ instance_action_model_json['completed_at'] = "2019-01-01T12:00:00Z"
+ instance_action_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ instance_action_model_json['force'] = True
+ instance_action_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed'
+ instance_action_model_json['id'] = '109a1b6e-1242-4de1-be44-38705e9474ed'
+ instance_action_model_json['started_at'] = "2019-01-01T12:00:00Z"
+ instance_action_model_json['status'] = 'completed'
+ instance_action_model_json['type'] = 'reboot'
- # Construct a model instance of IKEPolicyCollectionFirst by calling from_dict on the json representation
- ike_policy_collection_first_model = IKEPolicyCollectionFirst.from_dict(ike_policy_collection_first_model_json)
- assert ike_policy_collection_first_model != False
+ # Construct a model instance of InstanceAction by calling from_dict on the json representation
+ instance_action_model = InstanceAction.from_dict(instance_action_model_json)
+ assert instance_action_model != False
- # Construct a model instance of IKEPolicyCollectionFirst by calling from_dict on the json representation
- ike_policy_collection_first_model_dict = IKEPolicyCollectionFirst.from_dict(ike_policy_collection_first_model_json).__dict__
- ike_policy_collection_first_model2 = IKEPolicyCollectionFirst(**ike_policy_collection_first_model_dict)
+ # Construct a model instance of InstanceAction by calling from_dict on the json representation
+ instance_action_model_dict = InstanceAction.from_dict(instance_action_model_json).__dict__
+ instance_action_model2 = InstanceAction(**instance_action_model_dict)
# Verify the model instances are equivalent
- assert ike_policy_collection_first_model == ike_policy_collection_first_model2
+ assert instance_action_model == instance_action_model2
# Convert model instance back to dict and verify no loss of data
- ike_policy_collection_first_model_json2 = ike_policy_collection_first_model.to_dict()
- assert ike_policy_collection_first_model_json2 == ike_policy_collection_first_model_json
+ instance_action_model_json2 = instance_action_model.to_dict()
+ assert instance_action_model_json2 == instance_action_model_json
-class TestModel_IKEPolicyCollectionNext():
+class TestModel_InstanceCollection():
"""
- Test Class for IKEPolicyCollectionNext
+ Test Class for InstanceCollection
"""
- def test_ike_policy_collection_next_serialization(self):
+ def test_instance_collection_serialization(self):
"""
- Test serialization/deserialization for IKEPolicyCollectionNext
+ Test serialization/deserialization for InstanceCollection
"""
- # Construct a json representation of a IKEPolicyCollectionNext model
- ike_policy_collection_next_model_json = {}
- ike_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of IKEPolicyCollectionNext by calling from_dict on the json representation
- ike_policy_collection_next_model = IKEPolicyCollectionNext.from_dict(ike_policy_collection_next_model_json)
- assert ike_policy_collection_next_model != False
+ instance_collection_first_model = {} # InstanceCollectionFirst
+ instance_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20'
- # Construct a model instance of IKEPolicyCollectionNext by calling from_dict on the json representation
- ike_policy_collection_next_model_dict = IKEPolicyCollectionNext.from_dict(ike_policy_collection_next_model_json).__dict__
- ike_policy_collection_next_model2 = IKEPolicyCollectionNext(**ike_policy_collection_next_model_dict)
+ volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted
+ volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert ike_policy_collection_next_model == ike_policy_collection_next_model2
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- # Convert model instance back to dict and verify no loss of data
- ike_policy_collection_next_model_json2 = ike_policy_collection_next_model.to_dict()
- assert ike_policy_collection_next_model_json2 == ike_policy_collection_next_model_json
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_IKEPolicyPatch():
- """
- Test Class for IKEPolicyPatch
- """
+ volume_reference_model = {} # VolumeReference
+ volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['deleted'] = volume_reference_deleted_model
+ volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['name'] = 'my-volume'
- def test_ike_policy_patch_serialization(self):
- """
- Test serialization/deserialization for IKEPolicyPatch
- """
+ volume_attachment_reference_instance_context_model = {} # VolumeAttachmentReferenceInstanceContext
+ volume_attachment_reference_instance_context_model['deleted'] = volume_attachment_reference_instance_context_deleted_model
+ volume_attachment_reference_instance_context_model['device'] = volume_attachment_device_model
+ volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_instance_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_instance_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_reference_instance_context_model['volume'] = volume_reference_model
- # Construct a json representation of a IKEPolicyPatch model
- ike_policy_patch_model_json = {}
- ike_policy_patch_model_json['authentication_algorithm'] = 'md5'
- ike_policy_patch_model_json['dh_group'] = 14
- ike_policy_patch_model_json['encryption_algorithm'] = 'aes128'
- ike_policy_patch_model_json['ike_version'] = 1
- ike_policy_patch_model_json['key_lifetime'] = 28800
- ike_policy_patch_model_json['name'] = 'my-ike-policy'
+ dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
+ dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of IKEPolicyPatch by calling from_dict on the json representation
- ike_policy_patch_model = IKEPolicyPatch.from_dict(ike_policy_patch_model_json)
- assert ike_policy_patch_model != False
+ dedicated_host_reference_model = {} # DedicatedHostReference
+ dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model
+ dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ dedicated_host_reference_model['name'] = 'my-host'
+ dedicated_host_reference_model['resource_type'] = 'dedicated_host'
- # Construct a model instance of IKEPolicyPatch by calling from_dict on the json representation
- ike_policy_patch_model_dict = IKEPolicyPatch.from_dict(ike_policy_patch_model_json).__dict__
- ike_policy_patch_model2 = IKEPolicyPatch(**ike_policy_patch_model_dict)
+ instance_disk_model = {} # InstanceDisk
+ instance_disk_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_model['interface_type'] = 'nvme'
+ instance_disk_model['name'] = 'my-instance-disk'
+ instance_disk_model['resource_type'] = 'instance_disk'
+ instance_disk_model['size'] = 100
- # Verify the model instances are equivalent
- assert ike_policy_patch_model == ike_policy_patch_model2
+ instance_gpu_model = {} # InstanceGPU
+ instance_gpu_model['count'] = 1
+ instance_gpu_model['manufacturer'] = 'nvidia'
+ instance_gpu_model['memory'] = 1
+ instance_gpu_model['model'] = 'Tesla V100'
- # Convert model instance back to dict and verify no loss of data
- ike_policy_patch_model_json2 = ike_policy_patch_model.to_dict()
- assert ike_policy_patch_model_json2 == ike_policy_patch_model_json
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_IKEPolicyReference():
- """
- Test Class for IKEPolicyReference
- """
+ image_reference_model = {} # ImageReference
+ image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['deleted'] = image_reference_deleted_model
+ image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['name'] = 'my-image'
- def test_ike_policy_reference_serialization(self):
- """
- Test serialization/deserialization for IKEPolicyReference
- """
+ network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted
+ network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct dict forms of any model objects needed in order to build this model.
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted
- ike_policy_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'
- # Construct a json representation of a IKEPolicyReference model
- ike_policy_reference_model_json = {}
- ike_policy_reference_model_json['deleted'] = ike_policy_reference_deleted_model
- ike_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- ike_policy_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- ike_policy_reference_model_json['name'] = 'my-ike-policy'
- ike_policy_reference_model_json['resource_type'] = 'ike_policy'
+ network_interface_instance_context_reference_model = {} # NetworkInterfaceInstanceContextReference
+ 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['primary_ipv4_address'] = '192.168.3.4'
+ network_interface_instance_context_reference_model['resource_type'] = 'network_interface'
+ network_interface_instance_context_reference_model['subnet'] = subnet_reference_model
- # Construct a model instance of IKEPolicyReference by calling from_dict on the json representation
- ike_policy_reference_model = IKEPolicyReference.from_dict(ike_policy_reference_model_json)
- assert ike_policy_reference_model != False
+ dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
+ dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of IKEPolicyReference by calling from_dict on the json representation
- ike_policy_reference_model_dict = IKEPolicyReference.from_dict(ike_policy_reference_model_json).__dict__
- ike_policy_reference_model2 = IKEPolicyReference(**ike_policy_reference_model_dict)
+ instance_placement_target_model = {} # InstancePlacementTargetDedicatedHostGroupReference
+ instance_placement_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ instance_placement_target_model['deleted'] = dedicated_host_group_reference_deleted_model
+ instance_placement_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ instance_placement_target_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+ instance_placement_target_model['name'] = 'my-host-group'
+ instance_placement_target_model['resource_type'] = 'dedicated_host_group'
- # Verify the model instances are equivalent
- assert ike_policy_reference_model == ike_policy_reference_model2
+ instance_profile_reference_model = {} # InstanceProfileReference
+ instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
+ instance_profile_reference_model['name'] = 'bc1-4x16'
- # Convert model instance back to dict and verify no loss of data
- ike_policy_reference_model_json2 = ike_policy_reference_model.to_dict()
- assert ike_policy_reference_model_json2 == ike_policy_reference_model_json
+ 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'
-class TestModel_IKEPolicyReferenceDeleted():
- """
- Test Class for IKEPolicyReferenceDeleted
- """
+ instance_status_reason_model = {} # InstanceStatusReason
+ instance_status_reason_model['code'] = 'cannot_start_storage'
+ instance_status_reason_model['message'] = 'The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted'
+ instance_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
- def test_ike_policy_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for IKEPolicyReferenceDeleted
- """
+ instance_vcpu_model = {} # InstanceVCPU
+ instance_vcpu_model['architecture'] = 'amd64'
+ instance_vcpu_model['count'] = 4
- # Construct a json representation of a IKEPolicyReferenceDeleted model
- ike_policy_reference_deleted_model_json = {}
- ike_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of IKEPolicyReferenceDeleted by calling from_dict on the json representation
- ike_policy_reference_deleted_model = IKEPolicyReferenceDeleted.from_dict(ike_policy_reference_deleted_model_json)
- assert ike_policy_reference_deleted_model != False
+ 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'
- # Construct a model instance of IKEPolicyReferenceDeleted by calling from_dict on the json representation
- ike_policy_reference_deleted_model_dict = IKEPolicyReferenceDeleted.from_dict(ike_policy_reference_deleted_model_json).__dict__
- ike_policy_reference_deleted_model2 = IKEPolicyReferenceDeleted(**ike_policy_reference_deleted_model_dict)
+ zone_reference_model = {} # ZoneReference
+ zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model['name'] = 'us-south-1'
+
+ instance_model = {} # Instance
+ instance_model['bandwidth'] = 1000
+ instance_model['boot_volume_attachment'] = volume_attachment_reference_instance_context_model
+ instance_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model['dedicated_host'] = dedicated_host_reference_model
+ instance_model['disks'] = [instance_disk_model]
+ instance_model['gpu'] = instance_gpu_model
+ instance_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_model['image'] = image_reference_model
+ instance_model['memory'] = 8
+ instance_model['name'] = 'my-instance'
+ instance_model['network_interfaces'] = [network_interface_instance_context_reference_model]
+ instance_model['placement_target'] = instance_placement_target_model
+ instance_model['primary_network_interface'] = network_interface_instance_context_reference_model
+ instance_model['profile'] = instance_profile_reference_model
+ instance_model['resource_group'] = resource_group_reference_model
+ instance_model['startable'] = True
+ instance_model['status'] = 'deleting'
+ instance_model['status_reasons'] = [instance_status_reason_model]
+ instance_model['total_network_bandwidth'] = 500
+ instance_model['total_volume_bandwidth'] = 500
+ instance_model['vcpu'] = instance_vcpu_model
+ instance_model['volume_attachments'] = [volume_attachment_reference_instance_context_model]
+ instance_model['vpc'] = vpc_reference_model
+ instance_model['zone'] = zone_reference_model
+
+ instance_collection_next_model = {} # InstanceCollectionNext
+ instance_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a json representation of a InstanceCollection model
+ instance_collection_model_json = {}
+ instance_collection_model_json['first'] = instance_collection_first_model
+ instance_collection_model_json['instances'] = [instance_model]
+ instance_collection_model_json['limit'] = 20
+ instance_collection_model_json['next'] = instance_collection_next_model
+ instance_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of InstanceCollection by calling from_dict on the json representation
+ instance_collection_model = InstanceCollection.from_dict(instance_collection_model_json)
+ assert instance_collection_model != False
+
+ # Construct a model instance of InstanceCollection by calling from_dict on the json representation
+ instance_collection_model_dict = InstanceCollection.from_dict(instance_collection_model_json).__dict__
+ instance_collection_model2 = InstanceCollection(**instance_collection_model_dict)
# Verify the model instances are equivalent
- assert ike_policy_reference_deleted_model == ike_policy_reference_deleted_model2
+ assert instance_collection_model == instance_collection_model2
# Convert model instance back to dict and verify no loss of data
- ike_policy_reference_deleted_model_json2 = ike_policy_reference_deleted_model.to_dict()
- assert ike_policy_reference_deleted_model_json2 == ike_policy_reference_deleted_model_json
+ instance_collection_model_json2 = instance_collection_model.to_dict()
+ assert instance_collection_model_json2 == instance_collection_model_json
-class TestModel_IP():
+class TestModel_InstanceCollectionFirst():
"""
- Test Class for IP
+ Test Class for InstanceCollectionFirst
"""
- def test_ip_serialization(self):
+ def test_instance_collection_first_serialization(self):
"""
- Test serialization/deserialization for IP
+ Test serialization/deserialization for InstanceCollectionFirst
"""
- # Construct a json representation of a IP model
- ip_model_json = {}
- ip_model_json['address'] = '192.168.3.4'
+ # Construct a json representation of a InstanceCollectionFirst model
+ instance_collection_first_model_json = {}
+ instance_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20'
- # Construct a model instance of IP by calling from_dict on the json representation
- ip_model = IP.from_dict(ip_model_json)
- assert ip_model != False
+ # Construct a model instance of InstanceCollectionFirst by calling from_dict on the json representation
+ instance_collection_first_model = InstanceCollectionFirst.from_dict(instance_collection_first_model_json)
+ assert instance_collection_first_model != False
- # Construct a model instance of IP by calling from_dict on the json representation
- ip_model_dict = IP.from_dict(ip_model_json).__dict__
- ip_model2 = IP(**ip_model_dict)
+ # Construct a model instance of InstanceCollectionFirst by calling from_dict on the json representation
+ instance_collection_first_model_dict = InstanceCollectionFirst.from_dict(instance_collection_first_model_json).__dict__
+ instance_collection_first_model2 = InstanceCollectionFirst(**instance_collection_first_model_dict)
# Verify the model instances are equivalent
- assert ip_model == ip_model2
+ assert instance_collection_first_model == instance_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- ip_model_json2 = ip_model.to_dict()
- assert ip_model_json2 == ip_model_json
+ instance_collection_first_model_json2 = instance_collection_first_model.to_dict()
+ assert instance_collection_first_model_json2 == instance_collection_first_model_json
-class TestModel_IPsecPolicy():
+class TestModel_InstanceCollectionNext():
"""
- Test Class for IPsecPolicy
+ Test Class for InstanceCollectionNext
"""
- def test_i_psec_policy_serialization(self):
+ def test_instance_collection_next_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicy
+ Test serialization/deserialization for InstanceCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
- vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
- vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
- vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
- vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
-
- 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'
-
- # Construct a json representation of a IPsecPolicy model
- i_psec_policy_model_json = {}
- i_psec_policy_model_json['authentication_algorithm'] = 'md5'
- i_psec_policy_model_json['connections'] = [vpn_gateway_connection_reference_model]
- i_psec_policy_model_json['created_at'] = "2019-01-01T12:00:00Z"
- i_psec_policy_model_json['encapsulation_mode'] = 'tunnel'
- i_psec_policy_model_json['encryption_algorithm'] = 'aes128'
- i_psec_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- i_psec_policy_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- i_psec_policy_model_json['key_lifetime'] = 3600
- i_psec_policy_model_json['name'] = 'my-ipsec-policy'
- i_psec_policy_model_json['pfs'] = 'disabled'
- i_psec_policy_model_json['resource_group'] = resource_group_reference_model
- i_psec_policy_model_json['resource_type'] = 'ipsec_policy'
- i_psec_policy_model_json['transform_protocol'] = 'esp'
+ # Construct a json representation of a InstanceCollectionNext model
+ instance_collection_next_model_json = {}
+ instance_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of IPsecPolicy by calling from_dict on the json representation
- i_psec_policy_model = IPsecPolicy.from_dict(i_psec_policy_model_json)
- assert i_psec_policy_model != False
+ # Construct a model instance of InstanceCollectionNext by calling from_dict on the json representation
+ instance_collection_next_model = InstanceCollectionNext.from_dict(instance_collection_next_model_json)
+ assert instance_collection_next_model != False
- # Construct a model instance of IPsecPolicy by calling from_dict on the json representation
- i_psec_policy_model_dict = IPsecPolicy.from_dict(i_psec_policy_model_json).__dict__
- i_psec_policy_model2 = IPsecPolicy(**i_psec_policy_model_dict)
+ # Construct a model instance of InstanceCollectionNext by calling from_dict on the json representation
+ instance_collection_next_model_dict = InstanceCollectionNext.from_dict(instance_collection_next_model_json).__dict__
+ instance_collection_next_model2 = InstanceCollectionNext(**instance_collection_next_model_dict)
# Verify the model instances are equivalent
- assert i_psec_policy_model == i_psec_policy_model2
+ assert instance_collection_next_model == instance_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- i_psec_policy_model_json2 = i_psec_policy_model.to_dict()
- assert i_psec_policy_model_json2 == i_psec_policy_model_json
+ instance_collection_next_model_json2 = instance_collection_next_model.to_dict()
+ assert instance_collection_next_model_json2 == instance_collection_next_model_json
-class TestModel_IPsecPolicyCollection():
+class TestModel_InstanceConsoleAccessToken():
"""
- Test Class for IPsecPolicyCollection
+ Test Class for InstanceConsoleAccessToken
"""
- def test_i_psec_policy_collection_serialization(self):
+ def test_instance_console_access_token_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyCollection
+ Test serialization/deserialization for InstanceConsoleAccessToken
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a InstanceConsoleAccessToken model
+ instance_console_access_token_model_json = {}
+ instance_console_access_token_model_json['access_token'] = 'VGhpcyBJcyBhIHRva2Vu'
+ instance_console_access_token_model_json['console_type'] = 'serial'
+ instance_console_access_token_model_json['created_at'] = "2020-07-27T21:50:14Z"
+ instance_console_access_token_model_json['expires_at'] = "2020-07-27T21:51:14Z"
+ instance_console_access_token_model_json['force'] = False
+ instance_console_access_token_model_json['href'] = 'wss://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu'
- i_psec_policy_collection_first_model = {} # IPsecPolicyCollectionFirst
- i_psec_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20'
+ # Construct a model instance of InstanceConsoleAccessToken by calling from_dict on the json representation
+ instance_console_access_token_model = InstanceConsoleAccessToken.from_dict(instance_console_access_token_model_json)
+ assert instance_console_access_token_model != False
- vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
- vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of InstanceConsoleAccessToken by calling from_dict on the json representation
+ instance_console_access_token_model_dict = InstanceConsoleAccessToken.from_dict(instance_console_access_token_model_json).__dict__
+ instance_console_access_token_model2 = InstanceConsoleAccessToken(**instance_console_access_token_model_dict)
- vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
- vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
- vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
- vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
+ # Verify the model instances are equivalent
+ assert instance_console_access_token_model == instance_console_access_token_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ instance_console_access_token_model_json2 = instance_console_access_token_model.to_dict()
+ assert instance_console_access_token_model_json2 == instance_console_access_token_model_json
- i_psec_policy_model = {} # IPsecPolicy
- i_psec_policy_model['authentication_algorithm'] = 'md5'
- i_psec_policy_model['connections'] = [vpn_gateway_connection_reference_model]
- i_psec_policy_model['created_at'] = "2019-01-01T12:00:00Z"
- i_psec_policy_model['encapsulation_mode'] = 'tunnel'
- i_psec_policy_model['encryption_algorithm'] = 'aes128'
- i_psec_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- i_psec_policy_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- i_psec_policy_model['key_lifetime'] = 3600
- i_psec_policy_model['name'] = 'my-ipsec-policy'
- i_psec_policy_model['pfs'] = 'disabled'
- i_psec_policy_model['resource_group'] = resource_group_reference_model
- i_psec_policy_model['resource_type'] = 'ipsec_policy'
- i_psec_policy_model['transform_protocol'] = 'esp'
+class TestModel_InstanceDisk():
+ """
+ Test Class for InstanceDisk
+ """
- i_psec_policy_collection_next_model = {} # IPsecPolicyCollectionNext
- i_psec_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
+ def test_instance_disk_serialization(self):
+ """
+ Test serialization/deserialization for InstanceDisk
+ """
- # Construct a json representation of a IPsecPolicyCollection model
- i_psec_policy_collection_model_json = {}
- i_psec_policy_collection_model_json['first'] = i_psec_policy_collection_first_model
- i_psec_policy_collection_model_json['ipsec_policies'] = [i_psec_policy_model]
- i_psec_policy_collection_model_json['limit'] = 20
- i_psec_policy_collection_model_json['next'] = i_psec_policy_collection_next_model
- i_psec_policy_collection_model_json['total_count'] = 132
+ # Construct a json representation of a InstanceDisk model
+ instance_disk_model_json = {}
+ instance_disk_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ instance_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_model_json['interface_type'] = 'nvme'
+ instance_disk_model_json['name'] = 'my-instance-disk'
+ instance_disk_model_json['resource_type'] = 'instance_disk'
+ instance_disk_model_json['size'] = 100
- # Construct a model instance of IPsecPolicyCollection by calling from_dict on the json representation
- i_psec_policy_collection_model = IPsecPolicyCollection.from_dict(i_psec_policy_collection_model_json)
- assert i_psec_policy_collection_model != False
+ # Construct a model instance of InstanceDisk by calling from_dict on the json representation
+ instance_disk_model = InstanceDisk.from_dict(instance_disk_model_json)
+ assert instance_disk_model != False
- # Construct a model instance of IPsecPolicyCollection by calling from_dict on the json representation
- i_psec_policy_collection_model_dict = IPsecPolicyCollection.from_dict(i_psec_policy_collection_model_json).__dict__
- i_psec_policy_collection_model2 = IPsecPolicyCollection(**i_psec_policy_collection_model_dict)
+ # Construct a model instance of InstanceDisk by calling from_dict on the json representation
+ instance_disk_model_dict = InstanceDisk.from_dict(instance_disk_model_json).__dict__
+ instance_disk_model2 = InstanceDisk(**instance_disk_model_dict)
# Verify the model instances are equivalent
- assert i_psec_policy_collection_model == i_psec_policy_collection_model2
+ assert instance_disk_model == instance_disk_model2
# Convert model instance back to dict and verify no loss of data
- i_psec_policy_collection_model_json2 = i_psec_policy_collection_model.to_dict()
- assert i_psec_policy_collection_model_json2 == i_psec_policy_collection_model_json
+ instance_disk_model_json2 = instance_disk_model.to_dict()
+ assert instance_disk_model_json2 == instance_disk_model_json
-class TestModel_IPsecPolicyCollectionFirst():
+class TestModel_InstanceDiskCollection():
"""
- Test Class for IPsecPolicyCollectionFirst
+ Test Class for InstanceDiskCollection
"""
- def test_i_psec_policy_collection_first_serialization(self):
+ def test_instance_disk_collection_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyCollectionFirst
+ Test serialization/deserialization for InstanceDiskCollection
"""
- # Construct a json representation of a IPsecPolicyCollectionFirst model
- i_psec_policy_collection_first_model_json = {}
- i_psec_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ instance_disk_model = {} # InstanceDisk
+ instance_disk_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_model['interface_type'] = 'nvme'
+ instance_disk_model['name'] = 'my-instance-disk'
+ instance_disk_model['resource_type'] = 'instance_disk'
+ instance_disk_model['size'] = 100
+
+ # Construct a json representation of a InstanceDiskCollection model
+ instance_disk_collection_model_json = {}
+ instance_disk_collection_model_json['disks'] = [instance_disk_model]
- # Construct a model instance of IPsecPolicyCollectionFirst by calling from_dict on the json representation
- i_psec_policy_collection_first_model = IPsecPolicyCollectionFirst.from_dict(i_psec_policy_collection_first_model_json)
- assert i_psec_policy_collection_first_model != False
+ # Construct a model instance of InstanceDiskCollection by calling from_dict on the json representation
+ instance_disk_collection_model = InstanceDiskCollection.from_dict(instance_disk_collection_model_json)
+ assert instance_disk_collection_model != False
- # Construct a model instance of IPsecPolicyCollectionFirst by calling from_dict on the json representation
- i_psec_policy_collection_first_model_dict = IPsecPolicyCollectionFirst.from_dict(i_psec_policy_collection_first_model_json).__dict__
- i_psec_policy_collection_first_model2 = IPsecPolicyCollectionFirst(**i_psec_policy_collection_first_model_dict)
+ # Construct a model instance of InstanceDiskCollection by calling from_dict on the json representation
+ instance_disk_collection_model_dict = InstanceDiskCollection.from_dict(instance_disk_collection_model_json).__dict__
+ instance_disk_collection_model2 = InstanceDiskCollection(**instance_disk_collection_model_dict)
# Verify the model instances are equivalent
- assert i_psec_policy_collection_first_model == i_psec_policy_collection_first_model2
+ assert instance_disk_collection_model == instance_disk_collection_model2
# Convert model instance back to dict and verify no loss of data
- i_psec_policy_collection_first_model_json2 = i_psec_policy_collection_first_model.to_dict()
- assert i_psec_policy_collection_first_model_json2 == i_psec_policy_collection_first_model_json
+ instance_disk_collection_model_json2 = instance_disk_collection_model.to_dict()
+ assert instance_disk_collection_model_json2 == instance_disk_collection_model_json
-class TestModel_IPsecPolicyCollectionNext():
+class TestModel_InstanceDiskPatch():
"""
- Test Class for IPsecPolicyCollectionNext
+ Test Class for InstanceDiskPatch
"""
- def test_i_psec_policy_collection_next_serialization(self):
+ def test_instance_disk_patch_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyCollectionNext
+ Test serialization/deserialization for InstanceDiskPatch
"""
- # Construct a json representation of a IPsecPolicyCollectionNext model
- i_psec_policy_collection_next_model_json = {}
- i_psec_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
+ # Construct a json representation of a InstanceDiskPatch model
+ instance_disk_patch_model_json = {}
+ instance_disk_patch_model_json['name'] = 'my-instance-disk-updated'
- # Construct a model instance of IPsecPolicyCollectionNext by calling from_dict on the json representation
- i_psec_policy_collection_next_model = IPsecPolicyCollectionNext.from_dict(i_psec_policy_collection_next_model_json)
- assert i_psec_policy_collection_next_model != False
+ # Construct a model instance of InstanceDiskPatch by calling from_dict on the json representation
+ instance_disk_patch_model = InstanceDiskPatch.from_dict(instance_disk_patch_model_json)
+ assert instance_disk_patch_model != False
- # Construct a model instance of IPsecPolicyCollectionNext by calling from_dict on the json representation
- i_psec_policy_collection_next_model_dict = IPsecPolicyCollectionNext.from_dict(i_psec_policy_collection_next_model_json).__dict__
- i_psec_policy_collection_next_model2 = IPsecPolicyCollectionNext(**i_psec_policy_collection_next_model_dict)
+ # Construct a model instance of InstanceDiskPatch by calling from_dict on the json representation
+ instance_disk_patch_model_dict = InstanceDiskPatch.from_dict(instance_disk_patch_model_json).__dict__
+ instance_disk_patch_model2 = InstanceDiskPatch(**instance_disk_patch_model_dict)
# Verify the model instances are equivalent
- assert i_psec_policy_collection_next_model == i_psec_policy_collection_next_model2
+ assert instance_disk_patch_model == instance_disk_patch_model2
# Convert model instance back to dict and verify no loss of data
- i_psec_policy_collection_next_model_json2 = i_psec_policy_collection_next_model.to_dict()
- assert i_psec_policy_collection_next_model_json2 == i_psec_policy_collection_next_model_json
+ instance_disk_patch_model_json2 = instance_disk_patch_model.to_dict()
+ assert instance_disk_patch_model_json2 == instance_disk_patch_model_json
-class TestModel_IPsecPolicyPatch():
+class TestModel_InstanceDiskReference():
"""
- Test Class for IPsecPolicyPatch
+ Test Class for InstanceDiskReference
"""
- def test_i_psec_policy_patch_serialization(self):
+ def test_instance_disk_reference_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyPatch
+ Test serialization/deserialization for InstanceDiskReference
"""
- # Construct a json representation of a IPsecPolicyPatch model
- i_psec_policy_patch_model_json = {}
- i_psec_policy_patch_model_json['authentication_algorithm'] = 'md5'
- i_psec_policy_patch_model_json['encryption_algorithm'] = 'aes128'
- i_psec_policy_patch_model_json['key_lifetime'] = 3600
- i_psec_policy_patch_model_json['name'] = 'my-ipsec-policy'
- i_psec_policy_patch_model_json['pfs'] = 'disabled'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of IPsecPolicyPatch by calling from_dict on the json representation
- i_psec_policy_patch_model = IPsecPolicyPatch.from_dict(i_psec_policy_patch_model_json)
- assert i_psec_policy_patch_model != False
+ instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
+ instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of IPsecPolicyPatch by calling from_dict on the json representation
- i_psec_policy_patch_model_dict = IPsecPolicyPatch.from_dict(i_psec_policy_patch_model_json).__dict__
- i_psec_policy_patch_model2 = IPsecPolicyPatch(**i_psec_policy_patch_model_dict)
+ # Construct a json representation of a InstanceDiskReference model
+ instance_disk_reference_model_json = {}
+ instance_disk_reference_model_json['deleted'] = instance_disk_reference_deleted_model
+ instance_disk_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ instance_disk_reference_model_json['name'] = 'my-instance-disk'
+ instance_disk_reference_model_json['resource_type'] = 'instance_disk'
+
+ # Construct a model instance of InstanceDiskReference by calling from_dict on the json representation
+ instance_disk_reference_model = InstanceDiskReference.from_dict(instance_disk_reference_model_json)
+ assert instance_disk_reference_model != False
+
+ # Construct a model instance of InstanceDiskReference by calling from_dict on the json representation
+ instance_disk_reference_model_dict = InstanceDiskReference.from_dict(instance_disk_reference_model_json).__dict__
+ instance_disk_reference_model2 = InstanceDiskReference(**instance_disk_reference_model_dict)
# Verify the model instances are equivalent
- assert i_psec_policy_patch_model == i_psec_policy_patch_model2
+ assert instance_disk_reference_model == instance_disk_reference_model2
# Convert model instance back to dict and verify no loss of data
- i_psec_policy_patch_model_json2 = i_psec_policy_patch_model.to_dict()
- assert i_psec_policy_patch_model_json2 == i_psec_policy_patch_model_json
+ instance_disk_reference_model_json2 = instance_disk_reference_model.to_dict()
+ assert instance_disk_reference_model_json2 == instance_disk_reference_model_json
-class TestModel_IPsecPolicyReference():
+class TestModel_InstanceDiskReferenceDeleted():
"""
- Test Class for IPsecPolicyReference
+ Test Class for InstanceDiskReferenceDeleted
"""
- def test_i_psec_policy_reference_serialization(self):
+ def test_instance_disk_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyReference
+ Test serialization/deserialization for InstanceDiskReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted
- i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a IPsecPolicyReference model
- i_psec_policy_reference_model_json = {}
- i_psec_policy_reference_model_json['deleted'] = i_psec_policy_reference_deleted_model
- i_psec_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- i_psec_policy_reference_model_json['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- i_psec_policy_reference_model_json['name'] = 'my-ipsec-policy'
- i_psec_policy_reference_model_json['resource_type'] = 'ipsec_policy'
+ # Construct a json representation of a InstanceDiskReferenceDeleted model
+ instance_disk_reference_deleted_model_json = {}
+ instance_disk_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of IPsecPolicyReference by calling from_dict on the json representation
- i_psec_policy_reference_model = IPsecPolicyReference.from_dict(i_psec_policy_reference_model_json)
- assert i_psec_policy_reference_model != False
+ # Construct a model instance of InstanceDiskReferenceDeleted by calling from_dict on the json representation
+ instance_disk_reference_deleted_model = InstanceDiskReferenceDeleted.from_dict(instance_disk_reference_deleted_model_json)
+ assert instance_disk_reference_deleted_model != False
- # Construct a model instance of IPsecPolicyReference by calling from_dict on the json representation
- i_psec_policy_reference_model_dict = IPsecPolicyReference.from_dict(i_psec_policy_reference_model_json).__dict__
- i_psec_policy_reference_model2 = IPsecPolicyReference(**i_psec_policy_reference_model_dict)
+ # Construct a model instance of InstanceDiskReferenceDeleted by calling from_dict on the json representation
+ instance_disk_reference_deleted_model_dict = InstanceDiskReferenceDeleted.from_dict(instance_disk_reference_deleted_model_json).__dict__
+ instance_disk_reference_deleted_model2 = InstanceDiskReferenceDeleted(**instance_disk_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert i_psec_policy_reference_model == i_psec_policy_reference_model2
+ assert instance_disk_reference_deleted_model == instance_disk_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- i_psec_policy_reference_model_json2 = i_psec_policy_reference_model.to_dict()
- assert i_psec_policy_reference_model_json2 == i_psec_policy_reference_model_json
+ instance_disk_reference_deleted_model_json2 = instance_disk_reference_deleted_model.to_dict()
+ assert instance_disk_reference_deleted_model_json2 == instance_disk_reference_deleted_model_json
-class TestModel_IPsecPolicyReferenceDeleted():
+class TestModel_InstanceGPU():
"""
- Test Class for IPsecPolicyReferenceDeleted
+ Test Class for InstanceGPU
"""
- def test_i_psec_policy_reference_deleted_serialization(self):
+ def test_instance_gpu_serialization(self):
"""
- Test serialization/deserialization for IPsecPolicyReferenceDeleted
+ Test serialization/deserialization for InstanceGPU
"""
- # Construct a json representation of a IPsecPolicyReferenceDeleted model
- i_psec_policy_reference_deleted_model_json = {}
- i_psec_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a InstanceGPU model
+ instance_gpu_model_json = {}
+ instance_gpu_model_json['count'] = 1
+ instance_gpu_model_json['manufacturer'] = 'nvidia'
+ instance_gpu_model_json['memory'] = 1
+ instance_gpu_model_json['model'] = 'Tesla V100'
- # Construct a model instance of IPsecPolicyReferenceDeleted by calling from_dict on the json representation
- i_psec_policy_reference_deleted_model = IPsecPolicyReferenceDeleted.from_dict(i_psec_policy_reference_deleted_model_json)
- assert i_psec_policy_reference_deleted_model != False
+ # Construct a model instance of InstanceGPU by calling from_dict on the json representation
+ instance_gpu_model = InstanceGPU.from_dict(instance_gpu_model_json)
+ assert instance_gpu_model != False
- # Construct a model instance of IPsecPolicyReferenceDeleted by calling from_dict on the json representation
- i_psec_policy_reference_deleted_model_dict = IPsecPolicyReferenceDeleted.from_dict(i_psec_policy_reference_deleted_model_json).__dict__
- i_psec_policy_reference_deleted_model2 = IPsecPolicyReferenceDeleted(**i_psec_policy_reference_deleted_model_dict)
+ # Construct a model instance of InstanceGPU by calling from_dict on the json representation
+ instance_gpu_model_dict = InstanceGPU.from_dict(instance_gpu_model_json).__dict__
+ instance_gpu_model2 = InstanceGPU(**instance_gpu_model_dict)
# Verify the model instances are equivalent
- assert i_psec_policy_reference_deleted_model == i_psec_policy_reference_deleted_model2
+ assert instance_gpu_model == instance_gpu_model2
# Convert model instance back to dict and verify no loss of data
- i_psec_policy_reference_deleted_model_json2 = i_psec_policy_reference_deleted_model.to_dict()
- assert i_psec_policy_reference_deleted_model_json2 == i_psec_policy_reference_deleted_model_json
+ instance_gpu_model_json2 = instance_gpu_model.to_dict()
+ assert instance_gpu_model_json2 == instance_gpu_model_json
-class TestModel_Image():
+class TestModel_InstanceGroup():
"""
- Test Class for Image
+ Test Class for InstanceGroup
"""
- def test_image_serialization(self):
+ def test_instance_group_serialization(self):
"""
- Test serialization/deserialization for Image
+ Test serialization/deserialization for InstanceGroup
"""
# 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'
+ instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
+ instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- image_file_checksums_model = {} # ImageFileChecksums
- image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
+ instance_template_reference_model = {} # InstanceTemplateReference
+ instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_reference_model['deleted'] = instance_template_reference_deleted_model
+ instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_reference_model['name'] = 'my-instance-template'
- image_file_model = {} # ImageFile
- image_file_model['checksums'] = image_file_checksums_model
- image_file_model['size'] = 1
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- operating_system_model = {} # OperatingSystem
- operating_system_model['architecture'] = 'amd64'
- operating_system_model['dedicated_host_only'] = False
- operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
- operating_system_model['family'] = 'Ubuntu Server'
- operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- operating_system_model['name'] = 'ubuntu-16-amd64'
- operating_system_model['vendor'] = 'Canonical'
- operating_system_model['version'] = '16.04 LTS'
+ load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
+ load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+
+ instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
+ instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_group_manager_reference_model = {} # InstanceGroupManagerReference
+ instance_group_manager_reference_model['deleted'] = instance_group_manager_reference_deleted_model
+ instance_group_manager_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ instance_group_manager_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_reference_model['name'] = 'my-instance-group-manager'
resource_group_reference_model = {} # ResourceGroupReference
resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
resource_group_reference_model['name'] = 'my-resource-group'
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- volume_reference_model = {} # VolumeReference
- volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['deleted'] = volume_reference_deleted_model
- volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['name'] = 'my-volume'
+ 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'
- image_status_reason_model = {} # ImageStatusReason
- image_status_reason_model['code'] = 'encryption_key_deleted'
- image_status_reason_model['message'] = 'testString'
- image_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a Image model
- image_model_json = {}
- image_model_json['created_at'] = "2019-01-01T12:00:00Z"
- image_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_model_json['encryption'] = 'user_managed'
- image_model_json['encryption_key'] = encryption_key_reference_model
- image_model_json['file'] = image_file_model
- image_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- 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['operating_system'] = operating_system_model
- image_model_json['resource_group'] = resource_group_reference_model
- image_model_json['source_volume'] = volume_reference_model
- image_model_json['status'] = 'available'
- image_model_json['status_reasons'] = [image_status_reason_model]
- image_model_json['visibility'] = 'private'
+ 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'
- # Construct a model instance of Image by calling from_dict on the json representation
- image_model = Image.from_dict(image_model_json)
- assert image_model != False
+ # Construct a json representation of a InstanceGroup model
+ instance_group_model_json = {}
+ instance_group_model_json['application_port'] = 22
+ instance_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ instance_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_model_json['instance_template'] = instance_template_reference_model
+ instance_group_model_json['load_balancer_pool'] = load_balancer_pool_reference_model
+ instance_group_model_json['managers'] = [instance_group_manager_reference_model]
+ instance_group_model_json['membership_count'] = 10
+ instance_group_model_json['name'] = 'my-instance-group'
+ instance_group_model_json['resource_group'] = resource_group_reference_model
+ instance_group_model_json['status'] = 'deleting'
+ instance_group_model_json['subnets'] = [subnet_reference_model]
+ instance_group_model_json['updated_at'] = "2019-01-01T12:00:00Z"
+ instance_group_model_json['vpc'] = vpc_reference_model
- # Construct a model instance of Image by calling from_dict on the json representation
- image_model_dict = Image.from_dict(image_model_json).__dict__
- image_model2 = Image(**image_model_dict)
+ # Construct a model instance of InstanceGroup by calling from_dict on the json representation
+ instance_group_model = InstanceGroup.from_dict(instance_group_model_json)
+ assert instance_group_model != False
+
+ # Construct a model instance of InstanceGroup by calling from_dict on the json representation
+ instance_group_model_dict = InstanceGroup.from_dict(instance_group_model_json).__dict__
+ instance_group_model2 = InstanceGroup(**instance_group_model_dict)
# Verify the model instances are equivalent
- assert image_model == image_model2
+ assert instance_group_model == instance_group_model2
# Convert model instance back to dict and verify no loss of data
- image_model_json2 = image_model.to_dict()
- assert image_model_json2 == image_model_json
+ instance_group_model_json2 = instance_group_model.to_dict()
+ assert instance_group_model_json2 == instance_group_model_json
-class TestModel_ImageCollection():
+class TestModel_InstanceGroupCollection():
"""
- Test Class for ImageCollection
+ Test Class for InstanceGroupCollection
"""
- def test_image_collection_serialization(self):
+ def test_instance_group_collection_serialization(self):
"""
- Test serialization/deserialization for ImageCollection
+ Test serialization/deserialization for InstanceGroupCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- image_collection_first_model = {} # ImageCollectionFirst
- image_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20'
+ instance_group_collection_first_model = {} # InstanceGroupCollectionFirst
+ instance_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?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'
+ instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
+ instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- image_file_checksums_model = {} # ImageFileChecksums
- image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
+ instance_template_reference_model = {} # InstanceTemplateReference
+ instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_reference_model['deleted'] = instance_template_reference_deleted_model
+ instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_reference_model['name'] = 'my-instance-template'
- image_file_model = {} # ImageFile
- image_file_model['checksums'] = image_file_checksums_model
- image_file_model['size'] = 1
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- operating_system_model = {} # OperatingSystem
- operating_system_model['architecture'] = 'amd64'
- operating_system_model['dedicated_host_only'] = False
- operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
- operating_system_model['family'] = 'Ubuntu Server'
- operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- operating_system_model['name'] = 'ubuntu-16-amd64'
- operating_system_model['vendor'] = 'Canonical'
- operating_system_model['version'] = '16.04 LTS'
+ load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
+ load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+
+ instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
+ instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_group_manager_reference_model = {} # InstanceGroupManagerReference
+ instance_group_manager_reference_model['deleted'] = instance_group_manager_reference_deleted_model
+ instance_group_manager_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ instance_group_manager_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_reference_model['name'] = 'my-instance-group-manager'
resource_group_reference_model = {} # ResourceGroupReference
resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
resource_group_reference_model['name'] = 'my-resource-group'
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_reference_model = {} # VolumeReference
- volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['deleted'] = volume_reference_deleted_model
- volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['name'] = 'my-volume'
-
- image_status_reason_model = {} # ImageStatusReason
- image_status_reason_model['code'] = 'encryption_key_deleted'
- image_status_reason_model['message'] = 'testString'
- image_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
-
- image_model = {} # Image
- image_model['created_at'] = "2019-01-01T12:00:00Z"
- image_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_model['encryption'] = 'user_managed'
- image_model['encryption_key'] = encryption_key_reference_model
- image_model['file'] = image_file_model
- image_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_model['minimum_provisioned_size'] = 38
- image_model['name'] = 'my-image'
- image_model['operating_system'] = operating_system_model
- image_model['resource_group'] = resource_group_reference_model
- image_model['source_volume'] = volume_reference_model
- image_model['status'] = 'available'
- image_model['status_reasons'] = [image_status_reason_model]
- image_model['visibility'] = 'private'
-
- image_collection_next_model = {} # ImageCollectionNext
- image_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- # Construct a json representation of a ImageCollection model
- image_collection_model_json = {}
- image_collection_model_json['first'] = image_collection_first_model
- image_collection_model_json['images'] = [image_model]
- image_collection_model_json['limit'] = 20
- image_collection_model_json['next'] = image_collection_next_model
-
- # Construct a model instance of ImageCollection by calling from_dict on the json representation
- image_collection_model = ImageCollection.from_dict(image_collection_model_json)
- assert image_collection_model != False
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of ImageCollection by calling from_dict on the json representation
- image_collection_model_dict = ImageCollection.from_dict(image_collection_model_json).__dict__
- image_collection_model2 = ImageCollection(**image_collection_model_dict)
+ 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'
- # Verify the model instances are equivalent
- assert image_collection_model == image_collection_model2
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- image_collection_model_json2 = image_collection_model.to_dict()
- assert image_collection_model_json2 == image_collection_model_json
+ 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'
-class TestModel_ImageCollectionFirst():
- """
- Test Class for ImageCollectionFirst
- """
+ instance_group_model = {} # InstanceGroup
+ instance_group_model['application_port'] = 22
+ instance_group_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_model['instance_template'] = instance_template_reference_model
+ instance_group_model['load_balancer_pool'] = load_balancer_pool_reference_model
+ instance_group_model['managers'] = [instance_group_manager_reference_model]
+ instance_group_model['membership_count'] = 10
+ instance_group_model['name'] = 'my-instance-group'
+ instance_group_model['resource_group'] = resource_group_reference_model
+ instance_group_model['status'] = 'deleting'
+ instance_group_model['subnets'] = [subnet_reference_model]
+ instance_group_model['updated_at'] = "2019-01-01T12:00:00Z"
+ instance_group_model['vpc'] = vpc_reference_model
- def test_image_collection_first_serialization(self):
- """
- Test serialization/deserialization for ImageCollectionFirst
- """
+ instance_group_collection_next_model = {} # InstanceGroupCollectionNext
+ instance_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a json representation of a ImageCollectionFirst model
- image_collection_first_model_json = {}
- image_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?limit=20'
+ # Construct a json representation of a InstanceGroupCollection model
+ instance_group_collection_model_json = {}
+ instance_group_collection_model_json['first'] = instance_group_collection_first_model
+ instance_group_collection_model_json['instance_groups'] = [instance_group_model]
+ instance_group_collection_model_json['limit'] = 20
+ instance_group_collection_model_json['next'] = instance_group_collection_next_model
+ instance_group_collection_model_json['total_count'] = 132
- # Construct a model instance of ImageCollectionFirst by calling from_dict on the json representation
- image_collection_first_model = ImageCollectionFirst.from_dict(image_collection_first_model_json)
- assert image_collection_first_model != False
+ # Construct a model instance of InstanceGroupCollection by calling from_dict on the json representation
+ instance_group_collection_model = InstanceGroupCollection.from_dict(instance_group_collection_model_json)
+ assert instance_group_collection_model != False
- # Construct a model instance of ImageCollectionFirst by calling from_dict on the json representation
- image_collection_first_model_dict = ImageCollectionFirst.from_dict(image_collection_first_model_json).__dict__
- image_collection_first_model2 = ImageCollectionFirst(**image_collection_first_model_dict)
+ # Construct a model instance of InstanceGroupCollection by calling from_dict on the json representation
+ instance_group_collection_model_dict = InstanceGroupCollection.from_dict(instance_group_collection_model_json).__dict__
+ instance_group_collection_model2 = InstanceGroupCollection(**instance_group_collection_model_dict)
# Verify the model instances are equivalent
- assert image_collection_first_model == image_collection_first_model2
+ assert instance_group_collection_model == instance_group_collection_model2
# Convert model instance back to dict and verify no loss of data
- image_collection_first_model_json2 = image_collection_first_model.to_dict()
- assert image_collection_first_model_json2 == image_collection_first_model_json
+ instance_group_collection_model_json2 = instance_group_collection_model.to_dict()
+ assert instance_group_collection_model_json2 == instance_group_collection_model_json
-class TestModel_ImageCollectionNext():
+class TestModel_InstanceGroupCollectionFirst():
"""
- Test Class for ImageCollectionNext
+ Test Class for InstanceGroupCollectionFirst
"""
- def test_image_collection_next_serialization(self):
+ def test_instance_group_collection_first_serialization(self):
"""
- Test serialization/deserialization for ImageCollectionNext
+ Test serialization/deserialization for InstanceGroupCollectionFirst
"""
- # Construct a json representation of a ImageCollectionNext model
- image_collection_next_model_json = {}
- image_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a InstanceGroupCollectionFirst model
+ instance_group_collection_first_model_json = {}
+ instance_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20'
- # Construct a model instance of ImageCollectionNext by calling from_dict on the json representation
- image_collection_next_model = ImageCollectionNext.from_dict(image_collection_next_model_json)
- assert image_collection_next_model != False
+ # Construct a model instance of InstanceGroupCollectionFirst by calling from_dict on the json representation
+ instance_group_collection_first_model = InstanceGroupCollectionFirst.from_dict(instance_group_collection_first_model_json)
+ assert instance_group_collection_first_model != False
- # Construct a model instance of ImageCollectionNext by calling from_dict on the json representation
- image_collection_next_model_dict = ImageCollectionNext.from_dict(image_collection_next_model_json).__dict__
- image_collection_next_model2 = ImageCollectionNext(**image_collection_next_model_dict)
+ # Construct a model instance of InstanceGroupCollectionFirst by calling from_dict on the json representation
+ instance_group_collection_first_model_dict = InstanceGroupCollectionFirst.from_dict(instance_group_collection_first_model_json).__dict__
+ instance_group_collection_first_model2 = InstanceGroupCollectionFirst(**instance_group_collection_first_model_dict)
# Verify the model instances are equivalent
- assert image_collection_next_model == image_collection_next_model2
+ assert instance_group_collection_first_model == instance_group_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- image_collection_next_model_json2 = image_collection_next_model.to_dict()
- assert image_collection_next_model_json2 == image_collection_next_model_json
+ instance_group_collection_first_model_json2 = instance_group_collection_first_model.to_dict()
+ assert instance_group_collection_first_model_json2 == instance_group_collection_first_model_json
-class TestModel_ImageFile():
+class TestModel_InstanceGroupCollectionNext():
"""
- Test Class for ImageFile
+ Test Class for InstanceGroupCollectionNext
"""
- def test_image_file_serialization(self):
+ def test_instance_group_collection_next_serialization(self):
"""
- Test serialization/deserialization for ImageFile
+ Test serialization/deserialization for InstanceGroupCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- image_file_checksums_model = {} # ImageFileChecksums
- image_file_checksums_model['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
-
- # Construct a json representation of a ImageFile model
- image_file_model_json = {}
- image_file_model_json['checksums'] = image_file_checksums_model
- image_file_model_json['size'] = 1
+ # Construct a json representation of a InstanceGroupCollectionNext model
+ instance_group_collection_next_model_json = {}
+ instance_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of ImageFile by calling from_dict on the json representation
- image_file_model = ImageFile.from_dict(image_file_model_json)
- assert image_file_model != False
+ # Construct a model instance of InstanceGroupCollectionNext by calling from_dict on the json representation
+ instance_group_collection_next_model = InstanceGroupCollectionNext.from_dict(instance_group_collection_next_model_json)
+ assert instance_group_collection_next_model != False
- # Construct a model instance of ImageFile by calling from_dict on the json representation
- image_file_model_dict = ImageFile.from_dict(image_file_model_json).__dict__
- image_file_model2 = ImageFile(**image_file_model_dict)
+ # Construct a model instance of InstanceGroupCollectionNext by calling from_dict on the json representation
+ instance_group_collection_next_model_dict = InstanceGroupCollectionNext.from_dict(instance_group_collection_next_model_json).__dict__
+ instance_group_collection_next_model2 = InstanceGroupCollectionNext(**instance_group_collection_next_model_dict)
# Verify the model instances are equivalent
- assert image_file_model == image_file_model2
+ assert instance_group_collection_next_model == instance_group_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- image_file_model_json2 = image_file_model.to_dict()
- assert image_file_model_json2 == image_file_model_json
+ instance_group_collection_next_model_json2 = instance_group_collection_next_model.to_dict()
+ assert instance_group_collection_next_model_json2 == instance_group_collection_next_model_json
-class TestModel_ImageFileChecksums():
+class TestModel_InstanceGroupManagerActionGroupPatch():
"""
- Test Class for ImageFileChecksums
+ Test Class for InstanceGroupManagerActionGroupPatch
"""
- def test_image_file_checksums_serialization(self):
+ def test_instance_group_manager_action_group_patch_serialization(self):
"""
- Test serialization/deserialization for ImageFileChecksums
+ Test serialization/deserialization for InstanceGroupManagerActionGroupPatch
"""
- # Construct a json representation of a ImageFileChecksums model
- image_file_checksums_model_json = {}
- image_file_checksums_model_json['sha256'] = 'e992a84f113d3a35d2145ca3e7aca4fc95fe6daf470a08d8af3422ee59c92e15'
+ # Construct a json representation of a InstanceGroupManagerActionGroupPatch model
+ instance_group_manager_action_group_patch_model_json = {}
+ instance_group_manager_action_group_patch_model_json['membership_count'] = 10
- # Construct a model instance of ImageFileChecksums by calling from_dict on the json representation
- image_file_checksums_model = ImageFileChecksums.from_dict(image_file_checksums_model_json)
- assert image_file_checksums_model != False
+ # Construct a model instance of InstanceGroupManagerActionGroupPatch by calling from_dict on the json representation
+ instance_group_manager_action_group_patch_model = InstanceGroupManagerActionGroupPatch.from_dict(instance_group_manager_action_group_patch_model_json)
+ assert instance_group_manager_action_group_patch_model != False
- # Construct a model instance of ImageFileChecksums by calling from_dict on the json representation
- image_file_checksums_model_dict = ImageFileChecksums.from_dict(image_file_checksums_model_json).__dict__
- image_file_checksums_model2 = ImageFileChecksums(**image_file_checksums_model_dict)
+ # Construct a model instance of InstanceGroupManagerActionGroupPatch by calling from_dict on the json representation
+ instance_group_manager_action_group_patch_model_dict = InstanceGroupManagerActionGroupPatch.from_dict(instance_group_manager_action_group_patch_model_json).__dict__
+ instance_group_manager_action_group_patch_model2 = InstanceGroupManagerActionGroupPatch(**instance_group_manager_action_group_patch_model_dict)
# Verify the model instances are equivalent
- assert image_file_checksums_model == image_file_checksums_model2
+ assert instance_group_manager_action_group_patch_model == instance_group_manager_action_group_patch_model2
# Convert model instance back to dict and verify no loss of data
- image_file_checksums_model_json2 = image_file_checksums_model.to_dict()
- assert image_file_checksums_model_json2 == image_file_checksums_model_json
+ instance_group_manager_action_group_patch_model_json2 = instance_group_manager_action_group_patch_model.to_dict()
+ assert instance_group_manager_action_group_patch_model_json2 == instance_group_manager_action_group_patch_model_json
-class TestModel_ImageFilePrototype():
+class TestModel_InstanceGroupManagerActionManagerPatch():
"""
- Test Class for ImageFilePrototype
+ Test Class for InstanceGroupManagerActionManagerPatch
"""
- def test_image_file_prototype_serialization(self):
+ def test_instance_group_manager_action_manager_patch_serialization(self):
"""
- Test serialization/deserialization for ImageFilePrototype
+ Test serialization/deserialization for InstanceGroupManagerActionManagerPatch
"""
- # Construct a json representation of a ImageFilePrototype model
- image_file_prototype_model_json = {}
- image_file_prototype_model_json['href'] = 'cos://us-south/custom-image-vpc-bucket/customImage-0.vhd'
+ # Construct a json representation of a InstanceGroupManagerActionManagerPatch model
+ instance_group_manager_action_manager_patch_model_json = {}
+ instance_group_manager_action_manager_patch_model_json['max_membership_count'] = 10
+ instance_group_manager_action_manager_patch_model_json['min_membership_count'] = 10
- # Construct a model instance of ImageFilePrototype by calling from_dict on the json representation
- image_file_prototype_model = ImageFilePrototype.from_dict(image_file_prototype_model_json)
- assert image_file_prototype_model != False
+ # Construct a model instance of InstanceGroupManagerActionManagerPatch by calling from_dict on the json representation
+ instance_group_manager_action_manager_patch_model = InstanceGroupManagerActionManagerPatch.from_dict(instance_group_manager_action_manager_patch_model_json)
+ assert instance_group_manager_action_manager_patch_model != False
- # Construct a model instance of ImageFilePrototype by calling from_dict on the json representation
- image_file_prototype_model_dict = ImageFilePrototype.from_dict(image_file_prototype_model_json).__dict__
- image_file_prototype_model2 = ImageFilePrototype(**image_file_prototype_model_dict)
+ # Construct a model instance of InstanceGroupManagerActionManagerPatch by calling from_dict on the json representation
+ instance_group_manager_action_manager_patch_model_dict = InstanceGroupManagerActionManagerPatch.from_dict(instance_group_manager_action_manager_patch_model_json).__dict__
+ instance_group_manager_action_manager_patch_model2 = InstanceGroupManagerActionManagerPatch(**instance_group_manager_action_manager_patch_model_dict)
# Verify the model instances are equivalent
- assert image_file_prototype_model == image_file_prototype_model2
+ assert instance_group_manager_action_manager_patch_model == instance_group_manager_action_manager_patch_model2
# Convert model instance back to dict and verify no loss of data
- image_file_prototype_model_json2 = image_file_prototype_model.to_dict()
- assert image_file_prototype_model_json2 == image_file_prototype_model_json
+ instance_group_manager_action_manager_patch_model_json2 = instance_group_manager_action_manager_patch_model.to_dict()
+ assert instance_group_manager_action_manager_patch_model_json2 == instance_group_manager_action_manager_patch_model_json
-class TestModel_ImagePatch():
+class TestModel_InstanceGroupManagerActionPatch():
"""
- Test Class for ImagePatch
+ Test Class for InstanceGroupManagerActionPatch
"""
- def test_image_patch_serialization(self):
+ def test_instance_group_manager_action_patch_serialization(self):
"""
- Test serialization/deserialization for ImagePatch
+ Test serialization/deserialization for InstanceGroupManagerActionPatch
"""
- # Construct a json representation of a ImagePatch model
- image_patch_model_json = {}
- image_patch_model_json['name'] = 'my-image'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ImagePatch by calling from_dict on the json representation
- image_patch_model = ImagePatch.from_dict(image_patch_model_json)
- assert image_patch_model != False
+ instance_group_manager_action_group_patch_model = {} # InstanceGroupManagerActionGroupPatch
+ instance_group_manager_action_group_patch_model['membership_count'] = 10
- # Construct a model instance of ImagePatch by calling from_dict on the json representation
- image_patch_model_dict = ImagePatch.from_dict(image_patch_model_json).__dict__
- image_patch_model2 = ImagePatch(**image_patch_model_dict)
+ instance_group_manager_action_manager_patch_model = {} # InstanceGroupManagerActionManagerPatch
+ instance_group_manager_action_manager_patch_model['max_membership_count'] = 10
+ instance_group_manager_action_manager_patch_model['min_membership_count'] = 10
+
+ # Construct a json representation of a InstanceGroupManagerActionPatch model
+ instance_group_manager_action_patch_model_json = {}
+ instance_group_manager_action_patch_model_json['cron_spec'] = '*/5 1,2,3 * * *'
+ instance_group_manager_action_patch_model_json['group'] = instance_group_manager_action_group_patch_model
+ instance_group_manager_action_patch_model_json['manager'] = instance_group_manager_action_manager_patch_model
+ instance_group_manager_action_patch_model_json['name'] = 'my-instance-group-manager-action'
+ instance_group_manager_action_patch_model_json['run_at'] = "2019-01-01T12:00:00Z"
+
+ # Construct a model instance of InstanceGroupManagerActionPatch by calling from_dict on the json representation
+ instance_group_manager_action_patch_model = InstanceGroupManagerActionPatch.from_dict(instance_group_manager_action_patch_model_json)
+ assert instance_group_manager_action_patch_model != False
+
+ # Construct a model instance of InstanceGroupManagerActionPatch by calling from_dict on the json representation
+ instance_group_manager_action_patch_model_dict = InstanceGroupManagerActionPatch.from_dict(instance_group_manager_action_patch_model_json).__dict__
+ instance_group_manager_action_patch_model2 = InstanceGroupManagerActionPatch(**instance_group_manager_action_patch_model_dict)
# Verify the model instances are equivalent
- assert image_patch_model == image_patch_model2
+ assert instance_group_manager_action_patch_model == instance_group_manager_action_patch_model2
# Convert model instance back to dict and verify no loss of data
- image_patch_model_json2 = image_patch_model.to_dict()
- assert image_patch_model_json2 == image_patch_model_json
+ instance_group_manager_action_patch_model_json2 = instance_group_manager_action_patch_model.to_dict()
+ assert instance_group_manager_action_patch_model_json2 == instance_group_manager_action_patch_model_json
-class TestModel_ImageReference():
+class TestModel_InstanceGroupManagerActionReference():
"""
- Test Class for ImageReference
+ Test Class for InstanceGroupManagerActionReference
"""
- def test_image_reference_serialization(self):
+ def test_instance_group_manager_action_reference_serialization(self):
"""
- Test serialization/deserialization for ImageReference
+ Test serialization/deserialization for InstanceGroupManagerActionReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_group_manager_action_reference_deleted_model = {} # InstanceGroupManagerActionReferenceDeleted
+ instance_group_manager_action_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a ImageReference model
- image_reference_model_json = {}
- image_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model_json['deleted'] = image_reference_deleted_model
- image_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model_json['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model_json['name'] = 'my-image'
+ # Construct a json representation of a InstanceGroupManagerActionReference model
+ instance_group_manager_action_reference_model_json = {}
+ instance_group_manager_action_reference_model_json['deleted'] = instance_group_manager_action_reference_deleted_model
+ instance_group_manager_action_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_action_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_action_reference_model_json['name'] = 'my-instance-group-manager-action'
+ instance_group_manager_action_reference_model_json['resource_type'] = 'instance_group_manager_action'
- # Construct a model instance of ImageReference by calling from_dict on the json representation
- image_reference_model = ImageReference.from_dict(image_reference_model_json)
- assert image_reference_model != False
+ # Construct a model instance of InstanceGroupManagerActionReference by calling from_dict on the json representation
+ instance_group_manager_action_reference_model = InstanceGroupManagerActionReference.from_dict(instance_group_manager_action_reference_model_json)
+ assert instance_group_manager_action_reference_model != False
- # Construct a model instance of ImageReference by calling from_dict on the json representation
- image_reference_model_dict = ImageReference.from_dict(image_reference_model_json).__dict__
- image_reference_model2 = ImageReference(**image_reference_model_dict)
+ # Construct a model instance of InstanceGroupManagerActionReference by calling from_dict on the json representation
+ instance_group_manager_action_reference_model_dict = InstanceGroupManagerActionReference.from_dict(instance_group_manager_action_reference_model_json).__dict__
+ instance_group_manager_action_reference_model2 = InstanceGroupManagerActionReference(**instance_group_manager_action_reference_model_dict)
# Verify the model instances are equivalent
- assert image_reference_model == image_reference_model2
+ assert instance_group_manager_action_reference_model == instance_group_manager_action_reference_model2
# Convert model instance back to dict and verify no loss of data
- image_reference_model_json2 = image_reference_model.to_dict()
- assert image_reference_model_json2 == image_reference_model_json
+ instance_group_manager_action_reference_model_json2 = instance_group_manager_action_reference_model.to_dict()
+ assert instance_group_manager_action_reference_model_json2 == instance_group_manager_action_reference_model_json
-class TestModel_ImageReferenceDeleted():
+class TestModel_InstanceGroupManagerActionReferenceDeleted():
"""
- Test Class for ImageReferenceDeleted
+ Test Class for InstanceGroupManagerActionReferenceDeleted
"""
- def test_image_reference_deleted_serialization(self):
+ def test_instance_group_manager_action_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for ImageReferenceDeleted
+ Test serialization/deserialization for InstanceGroupManagerActionReferenceDeleted
"""
- # Construct a json representation of a ImageReferenceDeleted model
- image_reference_deleted_model_json = {}
- image_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a InstanceGroupManagerActionReferenceDeleted model
+ instance_group_manager_action_reference_deleted_model_json = {}
+ instance_group_manager_action_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of ImageReferenceDeleted by calling from_dict on the json representation
- image_reference_deleted_model = ImageReferenceDeleted.from_dict(image_reference_deleted_model_json)
- assert image_reference_deleted_model != False
+ # Construct a model instance of InstanceGroupManagerActionReferenceDeleted by calling from_dict on the json representation
+ instance_group_manager_action_reference_deleted_model = InstanceGroupManagerActionReferenceDeleted.from_dict(instance_group_manager_action_reference_deleted_model_json)
+ assert instance_group_manager_action_reference_deleted_model != False
- # Construct a model instance of ImageReferenceDeleted by calling from_dict on the json representation
- image_reference_deleted_model_dict = ImageReferenceDeleted.from_dict(image_reference_deleted_model_json).__dict__
- image_reference_deleted_model2 = ImageReferenceDeleted(**image_reference_deleted_model_dict)
+ # Construct a model instance of InstanceGroupManagerActionReferenceDeleted by calling from_dict on the json representation
+ instance_group_manager_action_reference_deleted_model_dict = InstanceGroupManagerActionReferenceDeleted.from_dict(instance_group_manager_action_reference_deleted_model_json).__dict__
+ instance_group_manager_action_reference_deleted_model2 = InstanceGroupManagerActionReferenceDeleted(**instance_group_manager_action_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert image_reference_deleted_model == image_reference_deleted_model2
+ assert instance_group_manager_action_reference_deleted_model == instance_group_manager_action_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- image_reference_deleted_model_json2 = image_reference_deleted_model.to_dict()
- assert image_reference_deleted_model_json2 == image_reference_deleted_model_json
+ instance_group_manager_action_reference_deleted_model_json2 = instance_group_manager_action_reference_deleted_model.to_dict()
+ assert instance_group_manager_action_reference_deleted_model_json2 == instance_group_manager_action_reference_deleted_model_json
-class TestModel_ImageStatusReason():
+class TestModel_InstanceGroupManagerActionsCollection():
"""
- Test Class for ImageStatusReason
+ Test Class for InstanceGroupManagerActionsCollection
"""
- def test_image_status_reason_serialization(self):
+ def test_instance_group_manager_actions_collection_serialization(self):
"""
- Test serialization/deserialization for ImageStatusReason
+ Test serialization/deserialization for InstanceGroupManagerActionsCollection
"""
- # Construct a json representation of a ImageStatusReason model
- image_status_reason_model_json = {}
- image_status_reason_model_json['code'] = 'encryption_key_deleted'
- image_status_reason_model_json['message'] = 'testString'
- image_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ImageStatusReason by calling from_dict on the json representation
- image_status_reason_model = ImageStatusReason.from_dict(image_status_reason_model_json)
- assert image_status_reason_model != False
+ instance_group_manager_scheduled_action_group_model = {} # InstanceGroupManagerScheduledActionGroup
+ instance_group_manager_scheduled_action_group_model['membership_count'] = 10
- # Construct a model instance of ImageStatusReason by calling from_dict on the json representation
- image_status_reason_model_dict = ImageStatusReason.from_dict(image_status_reason_model_json).__dict__
- image_status_reason_model2 = ImageStatusReason(**image_status_reason_model_dict)
+ instance_group_manager_action_model = {} # InstanceGroupManagerActionScheduledActionGroupTarget
+ instance_group_manager_action_model['auto_delete'] = True
+ instance_group_manager_action_model['auto_delete_timeout'] = 24
+ instance_group_manager_action_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_group_manager_action_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_action_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_action_model['name'] = 'my-instance-group-manager-action'
+ instance_group_manager_action_model['resource_type'] = 'instance_group_manager_action'
+ instance_group_manager_action_model['status'] = 'active'
+ instance_group_manager_action_model['updated_at'] = "2019-01-01T12:00:00Z"
+ instance_group_manager_action_model['action_type'] = 'scheduled'
+ instance_group_manager_action_model['cron_spec'] = '*/5 1,2,3 * * *'
+ instance_group_manager_action_model['last_applied_at'] = "2019-01-01T12:00:00Z"
+ instance_group_manager_action_model['next_run_at'] = "2019-01-01T12:00:00Z"
+ instance_group_manager_action_model['group'] = instance_group_manager_scheduled_action_group_model
+
+ instance_group_manager_actions_collection_first_model = {} # InstanceGroupManagerActionsCollectionFirst
+ instance_group_manager_actions_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20'
+
+ instance_group_manager_actions_collection_next_model = {} # InstanceGroupManagerActionsCollectionNext
+ instance_group_manager_actions_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ # Construct a json representation of a InstanceGroupManagerActionsCollection model
+ instance_group_manager_actions_collection_model_json = {}
+ instance_group_manager_actions_collection_model_json['actions'] = [instance_group_manager_action_model]
+ instance_group_manager_actions_collection_model_json['first'] = instance_group_manager_actions_collection_first_model
+ instance_group_manager_actions_collection_model_json['limit'] = 20
+ instance_group_manager_actions_collection_model_json['next'] = instance_group_manager_actions_collection_next_model
+ instance_group_manager_actions_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of InstanceGroupManagerActionsCollection by calling from_dict on the json representation
+ instance_group_manager_actions_collection_model = InstanceGroupManagerActionsCollection.from_dict(instance_group_manager_actions_collection_model_json)
+ assert instance_group_manager_actions_collection_model != False
+
+ # Construct a model instance of InstanceGroupManagerActionsCollection by calling from_dict on the json representation
+ instance_group_manager_actions_collection_model_dict = InstanceGroupManagerActionsCollection.from_dict(instance_group_manager_actions_collection_model_json).__dict__
+ instance_group_manager_actions_collection_model2 = InstanceGroupManagerActionsCollection(**instance_group_manager_actions_collection_model_dict)
# Verify the model instances are equivalent
- assert image_status_reason_model == image_status_reason_model2
+ assert instance_group_manager_actions_collection_model == instance_group_manager_actions_collection_model2
# Convert model instance back to dict and verify no loss of data
- image_status_reason_model_json2 = image_status_reason_model.to_dict()
- assert image_status_reason_model_json2 == image_status_reason_model_json
+ instance_group_manager_actions_collection_model_json2 = instance_group_manager_actions_collection_model.to_dict()
+ assert instance_group_manager_actions_collection_model_json2 == instance_group_manager_actions_collection_model_json
-class TestModel_Instance():
+class TestModel_InstanceGroupManagerActionsCollectionFirst():
"""
- Test Class for Instance
+ Test Class for InstanceGroupManagerActionsCollectionFirst
"""
- def test_instance_serialization(self):
+ def test_instance_group_manager_actions_collection_first_serialization(self):
"""
- Test serialization/deserialization for Instance
+ Test serialization/deserialization for InstanceGroupManagerActionsCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted
- volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = 'a8a15363-a6f7-4f01-af60-715e85b28141'
-
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_reference_model = {} # VolumeReference
- volume_reference_model['crn'] = 'crn:[...]'
- volume_reference_model['deleted'] = volume_reference_deleted_model
- volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/49c5d61b-41e7-4c01-9b7a-1a97366c6916'
- volume_reference_model['id'] = '49c5d61b-41e7-4c01-9b7a-1a97366c6916'
- volume_reference_model['name'] = 'my-boot-volume'
-
- volume_attachment_reference_instance_context_model = {} # VolumeAttachmentReferenceInstanceContext
- volume_attachment_reference_instance_context_model['deleted'] = volume_attachment_reference_instance_context_deleted_model
- volume_attachment_reference_instance_context_model['device'] = volume_attachment_device_model
- volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/eb1b7391-2ca2-4ab5-84a8-b92157a633b0/volume_attachments/7389-a8a15363-a6f7-4f01-af60-715e85b28141'
- volume_attachment_reference_instance_context_model['id'] = 'a8a15363-a6f7-4f01-af60-715e85b28141'
- volume_attachment_reference_instance_context_model['name'] = 'my-boot-volume-attachment'
- volume_attachment_reference_instance_context_model['volume'] = volume_reference_model
+ # Construct a json representation of a InstanceGroupManagerActionsCollectionFirst model
+ instance_group_manager_actions_collection_first_model_json = {}
+ instance_group_manager_actions_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20'
- dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
- dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of InstanceGroupManagerActionsCollectionFirst by calling from_dict on the json representation
+ instance_group_manager_actions_collection_first_model = InstanceGroupManagerActionsCollectionFirst.from_dict(instance_group_manager_actions_collection_first_model_json)
+ assert instance_group_manager_actions_collection_first_model != False
- dedicated_host_reference_model = {} # DedicatedHostReference
- dedicated_host_reference_model['crn'] = 'crn:[...]'
- dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model
- dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221'
- dedicated_host_reference_model['id'] = '0787-8c2a09be-ee18-4af2-8ef4-6a6060732221'
- dedicated_host_reference_model['name'] = 'test-new'
- dedicated_host_reference_model['resource_type'] = 'dedicated_host'
+ # Construct a model instance of InstanceGroupManagerActionsCollectionFirst by calling from_dict on the json representation
+ instance_group_manager_actions_collection_first_model_dict = InstanceGroupManagerActionsCollectionFirst.from_dict(instance_group_manager_actions_collection_first_model_json).__dict__
+ instance_group_manager_actions_collection_first_model2 = InstanceGroupManagerActionsCollectionFirst(**instance_group_manager_actions_collection_first_model_dict)
- instance_disk_model = {} # InstanceDisk
- instance_disk_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_model['interface_type'] = 'nvme'
- instance_disk_model['name'] = 'my-instance-disk'
- instance_disk_model['resource_type'] = 'instance_disk'
- instance_disk_model['size'] = 100
+ # Verify the model instances are equivalent
+ assert instance_group_manager_actions_collection_first_model == instance_group_manager_actions_collection_first_model2
- instance_gpu_model = {} # InstanceGPU
- instance_gpu_model['count'] = 1
- instance_gpu_model['manufacturer'] = 'nvidia'
- instance_gpu_model['memory'] = 1
- instance_gpu_model['model'] = 'Tesla V100'
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_manager_actions_collection_first_model_json2 = instance_group_manager_actions_collection_first_model.to_dict()
+ assert instance_group_manager_actions_collection_first_model_json2 == instance_group_manager_actions_collection_first_model_json
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_InstanceGroupManagerActionsCollectionNext():
+ """
+ Test Class for InstanceGroupManagerActionsCollectionNext
+ """
- image_reference_model = {} # ImageReference
- image_reference_model['crn'] = 'crn:[...]'
- image_reference_model['deleted'] = image_reference_deleted_model
- image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366'
- image_reference_model['id'] = '9aaf3bcb-dcd7-4de7-bb60-24e39ff9d366'
- image_reference_model['name'] = 'my-image'
+ def test_instance_group_manager_actions_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupManagerActionsCollectionNext
+ """
- network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted
- network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a InstanceGroupManagerActionsCollectionNext model
+ instance_group_manager_actions_collection_next_model_json = {}
+ instance_group_manager_actions_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of InstanceGroupManagerActionsCollectionNext by calling from_dict on the json representation
+ instance_group_manager_actions_collection_next_model = InstanceGroupManagerActionsCollectionNext.from_dict(instance_group_manager_actions_collection_next_model_json)
+ assert instance_group_manager_actions_collection_next_model != False
- 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/7389-bea6a632-5e13-42a4-b4b8-31dc877abfe4'
- subnet_reference_model['id'] = 'bea6a632-5e13-42a4-b4b8-31dc877abfe4'
- subnet_reference_model['name'] = 'my-subnet'
+ # Construct a model instance of InstanceGroupManagerActionsCollectionNext by calling from_dict on the json representation
+ instance_group_manager_actions_collection_next_model_dict = InstanceGroupManagerActionsCollectionNext.from_dict(instance_group_manager_actions_collection_next_model_json).__dict__
+ instance_group_manager_actions_collection_next_model2 = InstanceGroupManagerActionsCollectionNext(**instance_group_manager_actions_collection_next_model_dict)
- network_interface_instance_context_reference_model = {} # NetworkInterfaceInstanceContextReference
- 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/e402fa1b-96f6-4aa2-a8d7-703aac843651/network_interfaces/7ca88dfb-8962-469d-b1de-1dd56f4c3275'
- network_interface_instance_context_reference_model['id'] = '7ca88dfb-8962-469d-b1de-1dd56f4c3275'
- network_interface_instance_context_reference_model['name'] = 'my-network-interface'
- network_interface_instance_context_reference_model['primary_ipv4_address'] = '10.0.0.32'
- network_interface_instance_context_reference_model['resource_type'] = 'network_interface'
- network_interface_instance_context_reference_model['subnet'] = subnet_reference_model
+ # Verify the model instances are equivalent
+ assert instance_group_manager_actions_collection_next_model == instance_group_manager_actions_collection_next_model2
- dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
- dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_manager_actions_collection_next_model_json2 = instance_group_manager_actions_collection_next_model.to_dict()
+ assert instance_group_manager_actions_collection_next_model_json2 == instance_group_manager_actions_collection_next_model_json
- instance_placement_target_model = {} # InstancePlacementTargetDedicatedHostGroupReference
- instance_placement_target_model['crn'] = 'crn:[...]'
- instance_placement_target_model['deleted'] = dedicated_host_group_reference_deleted_model
- instance_placement_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/0787-8c2a09be-ee18-4af2-8ef4-6a6060732221'
- instance_placement_target_model['id'] = '0787-8c2a09be-ee18-4af2-8ef4-6a6060732221'
- instance_placement_target_model['name'] = 'test-new'
- instance_placement_target_model['resource_type'] = 'dedicated_host'
+class TestModel_InstanceGroupManagerCollection():
+ """
+ Test Class for InstanceGroupManagerCollection
+ """
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bx2-2x8'
- instance_profile_reference_model['name'] = 'bx2-2x8'
+ def test_instance_group_manager_collection_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupManagerCollection
+ """
- 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'
+ # Construct dict forms of any model objects needed in order to build this model.
- instance_status_reason_model = {} # InstanceStatusReason
- instance_status_reason_model['code'] = 'cannot_start_storage'
- instance_status_reason_model['message'] = 'The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted'
- instance_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
+ instance_group_manager_collection_first_model = {} # InstanceGroupManagerCollectionFirst
+ instance_group_manager_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20'
- instance_vcpu_model = {} # InstanceVCPU
- instance_vcpu_model['architecture'] = 'amd64'
- instance_vcpu_model['count'] = 2
+ instance_group_manager_policy_reference_deleted_model = {} # InstanceGroupManagerPolicyReferenceDeleted
+ instance_group_manager_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_group_manager_policy_reference_model = {} # InstanceGroupManagerPolicyReference
+ instance_group_manager_policy_reference_model['deleted'] = instance_group_manager_policy_reference_deleted_model
+ instance_group_manager_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_policy_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_policy_reference_model['name'] = 'my-instance-group-manager-policy'
- 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/f0aae929-7047-46d1-92e1-9102b07a7f6f'
- vpc_reference_model['id'] = 'f0aae929-7047-46d1-92e1-9102b07a7f6f'
- vpc_reference_model['name'] = 'my-vpc'
+ instance_group_manager_model = {} # InstanceGroupManagerAutoScale
+ instance_group_manager_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_group_manager_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ instance_group_manager_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_model['management_enabled'] = True
+ instance_group_manager_model['name'] = 'my-instance-group-manager'
+ instance_group_manager_model['updated_at'] = "2019-01-01T12:00:00Z"
+ instance_group_manager_model['aggregation_window'] = 120
+ instance_group_manager_model['cooldown'] = 210
+ instance_group_manager_model['manager_type'] = 'autoscale'
+ instance_group_manager_model['max_membership_count'] = 10
+ instance_group_manager_model['min_membership_count'] = 10
+ instance_group_manager_model['policies'] = [instance_group_manager_policy_reference_model]
- zone_reference_model = {} # ZoneReference
- zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model['name'] = 'us-south-1'
+ instance_group_manager_collection_next_model = {} # InstanceGroupManagerCollectionNext
+ instance_group_manager_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a json representation of a Instance model
- instance_model_json = {}
- instance_model_json['bandwidth'] = 1000
- instance_model_json['boot_volume_attachment'] = volume_attachment_reference_instance_context_model
- instance_model_json['created_at'] = "2019-01-01T12:00:00Z"
- instance_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_model_json['dedicated_host'] = dedicated_host_reference_model
- instance_model_json['disks'] = [instance_disk_model]
- instance_model_json['gpu'] = instance_gpu_model
- instance_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_model_json['image'] = image_reference_model
- instance_model_json['memory'] = 8
- instance_model_json['name'] = 'my-instance'
- instance_model_json['network_interfaces'] = [network_interface_instance_context_reference_model]
- instance_model_json['placement_target'] = instance_placement_target_model
- instance_model_json['primary_network_interface'] = network_interface_instance_context_reference_model
- instance_model_json['profile'] = instance_profile_reference_model
- instance_model_json['resource_group'] = resource_group_reference_model
- instance_model_json['startable'] = True
- instance_model_json['status'] = 'deleting'
- instance_model_json['status_reasons'] = [instance_status_reason_model]
- instance_model_json['total_network_bandwidth'] = 500
- instance_model_json['total_volume_bandwidth'] = 500
- instance_model_json['vcpu'] = instance_vcpu_model
- instance_model_json['volume_attachments'] = [volume_attachment_reference_instance_context_model]
- instance_model_json['vpc'] = vpc_reference_model
- instance_model_json['zone'] = zone_reference_model
+ # Construct a json representation of a InstanceGroupManagerCollection model
+ instance_group_manager_collection_model_json = {}
+ instance_group_manager_collection_model_json['first'] = instance_group_manager_collection_first_model
+ instance_group_manager_collection_model_json['limit'] = 20
+ instance_group_manager_collection_model_json['managers'] = [instance_group_manager_model]
+ instance_group_manager_collection_model_json['next'] = instance_group_manager_collection_next_model
+ instance_group_manager_collection_model_json['total_count'] = 132
- # Construct a model instance of Instance by calling from_dict on the json representation
- instance_model = Instance.from_dict(instance_model_json)
- assert instance_model != False
+ # Construct a model instance of InstanceGroupManagerCollection by calling from_dict on the json representation
+ instance_group_manager_collection_model = InstanceGroupManagerCollection.from_dict(instance_group_manager_collection_model_json)
+ assert instance_group_manager_collection_model != False
- # Construct a model instance of Instance by calling from_dict on the json representation
- instance_model_dict = Instance.from_dict(instance_model_json).__dict__
- instance_model2 = Instance(**instance_model_dict)
+ # Construct a model instance of InstanceGroupManagerCollection by calling from_dict on the json representation
+ instance_group_manager_collection_model_dict = InstanceGroupManagerCollection.from_dict(instance_group_manager_collection_model_json).__dict__
+ instance_group_manager_collection_model2 = InstanceGroupManagerCollection(**instance_group_manager_collection_model_dict)
# Verify the model instances are equivalent
- assert instance_model == instance_model2
+ assert instance_group_manager_collection_model == instance_group_manager_collection_model2
# Convert model instance back to dict and verify no loss of data
- instance_model_json2 = instance_model.to_dict()
- assert instance_model_json2 == instance_model_json
+ instance_group_manager_collection_model_json2 = instance_group_manager_collection_model.to_dict()
+ assert instance_group_manager_collection_model_json2 == instance_group_manager_collection_model_json
-class TestModel_InstanceAction():
+class TestModel_InstanceGroupManagerCollectionFirst():
"""
- Test Class for InstanceAction
+ Test Class for InstanceGroupManagerCollectionFirst
"""
- def test_instance_action_serialization(self):
+ def test_instance_group_manager_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceAction
+ Test serialization/deserialization for InstanceGroupManagerCollectionFirst
"""
- # Construct a json representation of a InstanceAction model
- instance_action_model_json = {}
- instance_action_model_json['completed_at'] = "2019-01-01T12:00:00Z"
- instance_action_model_json['created_at'] = "2019-01-01T12:00:00Z"
- instance_action_model_json['force'] = True
- instance_action_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/actions/109a1b6e-1242-4de1-be44-38705e9474ed'
- instance_action_model_json['id'] = '109a1b6e-1242-4de1-be44-38705e9474ed'
- instance_action_model_json['started_at'] = "2019-01-01T12:00:00Z"
- instance_action_model_json['status'] = 'completed'
- instance_action_model_json['type'] = 'reboot'
+ # Construct a json representation of a InstanceGroupManagerCollectionFirst model
+ instance_group_manager_collection_first_model_json = {}
+ instance_group_manager_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20'
- # Construct a model instance of InstanceAction by calling from_dict on the json representation
- instance_action_model = InstanceAction.from_dict(instance_action_model_json)
- assert instance_action_model != False
+ # Construct a model instance of InstanceGroupManagerCollectionFirst by calling from_dict on the json representation
+ instance_group_manager_collection_first_model = InstanceGroupManagerCollectionFirst.from_dict(instance_group_manager_collection_first_model_json)
+ assert instance_group_manager_collection_first_model != False
- # Construct a model instance of InstanceAction by calling from_dict on the json representation
- instance_action_model_dict = InstanceAction.from_dict(instance_action_model_json).__dict__
- instance_action_model2 = InstanceAction(**instance_action_model_dict)
+ # Construct a model instance of InstanceGroupManagerCollectionFirst by calling from_dict on the json representation
+ instance_group_manager_collection_first_model_dict = InstanceGroupManagerCollectionFirst.from_dict(instance_group_manager_collection_first_model_json).__dict__
+ instance_group_manager_collection_first_model2 = InstanceGroupManagerCollectionFirst(**instance_group_manager_collection_first_model_dict)
# Verify the model instances are equivalent
- assert instance_action_model == instance_action_model2
+ assert instance_group_manager_collection_first_model == instance_group_manager_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- instance_action_model_json2 = instance_action_model.to_dict()
- assert instance_action_model_json2 == instance_action_model_json
+ instance_group_manager_collection_first_model_json2 = instance_group_manager_collection_first_model.to_dict()
+ assert instance_group_manager_collection_first_model_json2 == instance_group_manager_collection_first_model_json
-class TestModel_InstanceCollection():
+class TestModel_InstanceGroupManagerCollectionNext():
"""
- Test Class for InstanceCollection
+ Test Class for InstanceGroupManagerCollectionNext
"""
- def test_instance_collection_serialization(self):
+ def test_instance_group_manager_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceCollection
+ Test serialization/deserialization for InstanceGroupManagerCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_collection_first_model = {} # InstanceCollectionFirst
- instance_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20'
-
- volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted
- volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ # Construct a json representation of a InstanceGroupManagerCollectionNext model
+ instance_group_manager_collection_next_model_json = {}
+ instance_group_manager_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of InstanceGroupManagerCollectionNext by calling from_dict on the json representation
+ instance_group_manager_collection_next_model = InstanceGroupManagerCollectionNext.from_dict(instance_group_manager_collection_next_model_json)
+ assert instance_group_manager_collection_next_model != False
- volume_reference_model = {} # VolumeReference
- volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['deleted'] = volume_reference_deleted_model
- volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['name'] = 'my-volume'
+ # Construct a model instance of InstanceGroupManagerCollectionNext by calling from_dict on the json representation
+ instance_group_manager_collection_next_model_dict = InstanceGroupManagerCollectionNext.from_dict(instance_group_manager_collection_next_model_json).__dict__
+ instance_group_manager_collection_next_model2 = InstanceGroupManagerCollectionNext(**instance_group_manager_collection_next_model_dict)
- volume_attachment_reference_instance_context_model = {} # VolumeAttachmentReferenceInstanceContext
- volume_attachment_reference_instance_context_model['deleted'] = volume_attachment_reference_instance_context_deleted_model
- volume_attachment_reference_instance_context_model['device'] = volume_attachment_device_model
- volume_attachment_reference_instance_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_instance_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_instance_context_model['name'] = 'my-volume-attachment'
- volume_attachment_reference_instance_context_model['volume'] = volume_reference_model
+ # Verify the model instances are equivalent
+ assert instance_group_manager_collection_next_model == instance_group_manager_collection_next_model2
- dedicated_host_reference_deleted_model = {} # DedicatedHostReferenceDeleted
- dedicated_host_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_manager_collection_next_model_json2 = instance_group_manager_collection_next_model.to_dict()
+ assert instance_group_manager_collection_next_model_json2 == instance_group_manager_collection_next_model_json
- dedicated_host_reference_model = {} # DedicatedHostReference
- dedicated_host_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model['deleted'] = dedicated_host_reference_deleted_model
- dedicated_host_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- dedicated_host_reference_model['name'] = 'my-host'
- dedicated_host_reference_model['resource_type'] = 'dedicated_host'
+class TestModel_InstanceGroupManagerPatch():
+ """
+ Test Class for InstanceGroupManagerPatch
+ """
- instance_disk_model = {} # InstanceDisk
- instance_disk_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_model['interface_type'] = 'nvme'
- instance_disk_model['name'] = 'my-instance-disk'
- instance_disk_model['resource_type'] = 'instance_disk'
- instance_disk_model['size'] = 100
+ def test_instance_group_manager_patch_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupManagerPatch
+ """
- instance_gpu_model = {} # InstanceGPU
- instance_gpu_model['count'] = 1
- instance_gpu_model['manufacturer'] = 'nvidia'
- instance_gpu_model['memory'] = 1
- instance_gpu_model['model'] = 'Tesla V100'
+ # Construct a json representation of a InstanceGroupManagerPatch model
+ instance_group_manager_patch_model_json = {}
+ instance_group_manager_patch_model_json['aggregation_window'] = 120
+ instance_group_manager_patch_model_json['cooldown'] = 210
+ instance_group_manager_patch_model_json['management_enabled'] = True
+ instance_group_manager_patch_model_json['max_membership_count'] = 10
+ instance_group_manager_patch_model_json['min_membership_count'] = 10
+ instance_group_manager_patch_model_json['name'] = 'my-instance-group-manager'
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of InstanceGroupManagerPatch by calling from_dict on the json representation
+ instance_group_manager_patch_model = InstanceGroupManagerPatch.from_dict(instance_group_manager_patch_model_json)
+ assert instance_group_manager_patch_model != False
- image_reference_model = {} # ImageReference
- image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['deleted'] = image_reference_deleted_model
- image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['name'] = 'my-image'
+ # Construct a model instance of InstanceGroupManagerPatch by calling from_dict on the json representation
+ instance_group_manager_patch_model_dict = InstanceGroupManagerPatch.from_dict(instance_group_manager_patch_model_json).__dict__
+ instance_group_manager_patch_model2 = InstanceGroupManagerPatch(**instance_group_manager_patch_model_dict)
- network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted
- network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert instance_group_manager_patch_model == instance_group_manager_patch_model2
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_manager_patch_model_json2 = instance_group_manager_patch_model.to_dict()
+ assert instance_group_manager_patch_model_json2 == instance_group_manager_patch_model_json
- 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'
+class TestModel_InstanceGroupManagerPolicyCollection():
+ """
+ Test Class for InstanceGroupManagerPolicyCollection
+ """
- network_interface_instance_context_reference_model = {} # NetworkInterfaceInstanceContextReference
- 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['primary_ipv4_address'] = '192.168.3.4'
- network_interface_instance_context_reference_model['resource_type'] = 'network_interface'
- network_interface_instance_context_reference_model['subnet'] = subnet_reference_model
+ def test_instance_group_manager_policy_collection_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupManagerPolicyCollection
+ """
- dedicated_host_group_reference_deleted_model = {} # DedicatedHostGroupReferenceDeleted
- dedicated_host_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- instance_placement_target_model = {} # InstancePlacementTargetDedicatedHostGroupReference
- instance_placement_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- instance_placement_target_model['deleted'] = dedicated_host_group_reference_deleted_model
- instance_placement_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- instance_placement_target_model['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
- instance_placement_target_model['name'] = 'my-host-group'
- instance_placement_target_model['resource_type'] = 'dedicated_host_group'
+ instance_group_manager_policy_collection_first_model = {} # InstanceGroupManagerPolicyCollectionFirst
+ instance_group_manager_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20'
- instance_profile_reference_model = {} # InstanceProfileReference
- instance_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
- instance_profile_reference_model['name'] = 'bc1-4x16'
+ instance_group_manager_policy_collection_next_model = {} # InstanceGroupManagerPolicyCollectionNext
+ instance_group_manager_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- 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'
+ instance_group_manager_policy_model = {} # InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy
+ instance_group_manager_policy_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_group_manager_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_policy_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_policy_model['name'] = 'my-instance-group-manager-policy'
+ instance_group_manager_policy_model['updated_at'] = "2019-01-01T12:00:00Z"
+ instance_group_manager_policy_model['metric_type'] = 'cpu'
+ instance_group_manager_policy_model['metric_value'] = 38
+ instance_group_manager_policy_model['policy_type'] = 'target'
- instance_status_reason_model = {} # InstanceStatusReason
- instance_status_reason_model['code'] = 'cannot_start_storage'
- instance_status_reason_model['message'] = 'The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted'
- instance_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
+ # Construct a json representation of a InstanceGroupManagerPolicyCollection model
+ instance_group_manager_policy_collection_model_json = {}
+ instance_group_manager_policy_collection_model_json['first'] = instance_group_manager_policy_collection_first_model
+ instance_group_manager_policy_collection_model_json['limit'] = 20
+ instance_group_manager_policy_collection_model_json['next'] = instance_group_manager_policy_collection_next_model
+ instance_group_manager_policy_collection_model_json['policies'] = [instance_group_manager_policy_model]
+ instance_group_manager_policy_collection_model_json['total_count'] = 132
- instance_vcpu_model = {} # InstanceVCPU
- instance_vcpu_model['architecture'] = 'amd64'
- instance_vcpu_model['count'] = 4
+ # Construct a model instance of InstanceGroupManagerPolicyCollection by calling from_dict on the json representation
+ instance_group_manager_policy_collection_model = InstanceGroupManagerPolicyCollection.from_dict(instance_group_manager_policy_collection_model_json)
+ assert instance_group_manager_policy_collection_model != False
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of InstanceGroupManagerPolicyCollection by calling from_dict on the json representation
+ instance_group_manager_policy_collection_model_dict = InstanceGroupManagerPolicyCollection.from_dict(instance_group_manager_policy_collection_model_json).__dict__
+ instance_group_manager_policy_collection_model2 = InstanceGroupManagerPolicyCollection(**instance_group_manager_policy_collection_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert instance_group_manager_policy_collection_model == instance_group_manager_policy_collection_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_manager_policy_collection_model_json2 = instance_group_manager_policy_collection_model.to_dict()
+ assert instance_group_manager_policy_collection_model_json2 == instance_group_manager_policy_collection_model_json
- instance_model = {} # Instance
- instance_model['bandwidth'] = 1000
- instance_model['boot_volume_attachment'] = volume_attachment_reference_instance_context_model
- instance_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_model['dedicated_host'] = dedicated_host_reference_model
- instance_model['disks'] = [instance_disk_model]
- instance_model['gpu'] = instance_gpu_model
- instance_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_model['image'] = image_reference_model
- instance_model['memory'] = 8
- instance_model['name'] = 'my-instance'
- instance_model['network_interfaces'] = [network_interface_instance_context_reference_model]
- instance_model['placement_target'] = instance_placement_target_model
- instance_model['primary_network_interface'] = network_interface_instance_context_reference_model
- instance_model['profile'] = instance_profile_reference_model
- instance_model['resource_group'] = resource_group_reference_model
- instance_model['startable'] = True
- instance_model['status'] = 'deleting'
- instance_model['status_reasons'] = [instance_status_reason_model]
- instance_model['total_network_bandwidth'] = 500
- instance_model['total_volume_bandwidth'] = 500
- instance_model['vcpu'] = instance_vcpu_model
- instance_model['volume_attachments'] = [volume_attachment_reference_instance_context_model]
- instance_model['vpc'] = vpc_reference_model
- instance_model['zone'] = zone_reference_model
+class TestModel_InstanceGroupManagerPolicyCollectionFirst():
+ """
+ Test Class for InstanceGroupManagerPolicyCollectionFirst
+ """
- instance_collection_next_model = {} # InstanceCollectionNext
- instance_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ def test_instance_group_manager_policy_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupManagerPolicyCollectionFirst
+ """
- # Construct a json representation of a InstanceCollection model
- instance_collection_model_json = {}
- instance_collection_model_json['first'] = instance_collection_first_model
- instance_collection_model_json['instances'] = [instance_model]
- instance_collection_model_json['limit'] = 20
- instance_collection_model_json['next'] = instance_collection_next_model
- instance_collection_model_json['total_count'] = 132
+ # Construct a json representation of a InstanceGroupManagerPolicyCollectionFirst model
+ instance_group_manager_policy_collection_first_model_json = {}
+ instance_group_manager_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20'
- # Construct a model instance of InstanceCollection by calling from_dict on the json representation
- instance_collection_model = InstanceCollection.from_dict(instance_collection_model_json)
- assert instance_collection_model != False
+ # Construct a model instance of InstanceGroupManagerPolicyCollectionFirst by calling from_dict on the json representation
+ instance_group_manager_policy_collection_first_model = InstanceGroupManagerPolicyCollectionFirst.from_dict(instance_group_manager_policy_collection_first_model_json)
+ assert instance_group_manager_policy_collection_first_model != False
- # Construct a model instance of InstanceCollection by calling from_dict on the json representation
- instance_collection_model_dict = InstanceCollection.from_dict(instance_collection_model_json).__dict__
- instance_collection_model2 = InstanceCollection(**instance_collection_model_dict)
+ # Construct a model instance of InstanceGroupManagerPolicyCollectionFirst by calling from_dict on the json representation
+ instance_group_manager_policy_collection_first_model_dict = InstanceGroupManagerPolicyCollectionFirst.from_dict(instance_group_manager_policy_collection_first_model_json).__dict__
+ instance_group_manager_policy_collection_first_model2 = InstanceGroupManagerPolicyCollectionFirst(**instance_group_manager_policy_collection_first_model_dict)
# Verify the model instances are equivalent
- assert instance_collection_model == instance_collection_model2
+ assert instance_group_manager_policy_collection_first_model == instance_group_manager_policy_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- instance_collection_model_json2 = instance_collection_model.to_dict()
- assert instance_collection_model_json2 == instance_collection_model_json
+ instance_group_manager_policy_collection_first_model_json2 = instance_group_manager_policy_collection_first_model.to_dict()
+ assert instance_group_manager_policy_collection_first_model_json2 == instance_group_manager_policy_collection_first_model_json
-class TestModel_InstanceCollectionFirst():
+class TestModel_InstanceGroupManagerPolicyCollectionNext():
"""
- Test Class for InstanceCollectionFirst
+ Test Class for InstanceGroupManagerPolicyCollectionNext
"""
- def test_instance_collection_first_serialization(self):
+ def test_instance_group_manager_policy_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceCollectionFirst
+ Test serialization/deserialization for InstanceGroupManagerPolicyCollectionNext
"""
- # Construct a json representation of a InstanceCollectionFirst model
- instance_collection_first_model_json = {}
- instance_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?limit=20'
+ # Construct a json representation of a InstanceGroupManagerPolicyCollectionNext model
+ instance_group_manager_policy_collection_next_model_json = {}
+ instance_group_manager_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of InstanceCollectionFirst by calling from_dict on the json representation
- instance_collection_first_model = InstanceCollectionFirst.from_dict(instance_collection_first_model_json)
- assert instance_collection_first_model != False
+ # Construct a model instance of InstanceGroupManagerPolicyCollectionNext by calling from_dict on the json representation
+ instance_group_manager_policy_collection_next_model = InstanceGroupManagerPolicyCollectionNext.from_dict(instance_group_manager_policy_collection_next_model_json)
+ assert instance_group_manager_policy_collection_next_model != False
- # Construct a model instance of InstanceCollectionFirst by calling from_dict on the json representation
- instance_collection_first_model_dict = InstanceCollectionFirst.from_dict(instance_collection_first_model_json).__dict__
- instance_collection_first_model2 = InstanceCollectionFirst(**instance_collection_first_model_dict)
+ # Construct a model instance of InstanceGroupManagerPolicyCollectionNext by calling from_dict on the json representation
+ instance_group_manager_policy_collection_next_model_dict = InstanceGroupManagerPolicyCollectionNext.from_dict(instance_group_manager_policy_collection_next_model_json).__dict__
+ instance_group_manager_policy_collection_next_model2 = InstanceGroupManagerPolicyCollectionNext(**instance_group_manager_policy_collection_next_model_dict)
# Verify the model instances are equivalent
- assert instance_collection_first_model == instance_collection_first_model2
+ assert instance_group_manager_policy_collection_next_model == instance_group_manager_policy_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- instance_collection_first_model_json2 = instance_collection_first_model.to_dict()
- assert instance_collection_first_model_json2 == instance_collection_first_model_json
+ instance_group_manager_policy_collection_next_model_json2 = instance_group_manager_policy_collection_next_model.to_dict()
+ assert instance_group_manager_policy_collection_next_model_json2 == instance_group_manager_policy_collection_next_model_json
-class TestModel_InstanceCollectionNext():
+class TestModel_InstanceGroupManagerPolicyPatch():
"""
- Test Class for InstanceCollectionNext
+ Test Class for InstanceGroupManagerPolicyPatch
"""
- def test_instance_collection_next_serialization(self):
+ def test_instance_group_manager_policy_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceCollectionNext
+ Test serialization/deserialization for InstanceGroupManagerPolicyPatch
"""
- # Construct a json representation of a InstanceCollectionNext model
- instance_collection_next_model_json = {}
- instance_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a InstanceGroupManagerPolicyPatch model
+ instance_group_manager_policy_patch_model_json = {}
+ instance_group_manager_policy_patch_model_json['metric_type'] = 'cpu'
+ instance_group_manager_policy_patch_model_json['metric_value'] = 38
+ instance_group_manager_policy_patch_model_json['name'] = 'my-instance-group-manager-policy'
- # Construct a model instance of InstanceCollectionNext by calling from_dict on the json representation
- instance_collection_next_model = InstanceCollectionNext.from_dict(instance_collection_next_model_json)
- assert instance_collection_next_model != False
+ # Construct a model instance of InstanceGroupManagerPolicyPatch by calling from_dict on the json representation
+ instance_group_manager_policy_patch_model = InstanceGroupManagerPolicyPatch.from_dict(instance_group_manager_policy_patch_model_json)
+ assert instance_group_manager_policy_patch_model != False
- # Construct a model instance of InstanceCollectionNext by calling from_dict on the json representation
- instance_collection_next_model_dict = InstanceCollectionNext.from_dict(instance_collection_next_model_json).__dict__
- instance_collection_next_model2 = InstanceCollectionNext(**instance_collection_next_model_dict)
+ # Construct a model instance of InstanceGroupManagerPolicyPatch by calling from_dict on the json representation
+ instance_group_manager_policy_patch_model_dict = InstanceGroupManagerPolicyPatch.from_dict(instance_group_manager_policy_patch_model_json).__dict__
+ instance_group_manager_policy_patch_model2 = InstanceGroupManagerPolicyPatch(**instance_group_manager_policy_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_collection_next_model == instance_collection_next_model2
+ assert instance_group_manager_policy_patch_model == instance_group_manager_policy_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_collection_next_model_json2 = instance_collection_next_model.to_dict()
- assert instance_collection_next_model_json2 == instance_collection_next_model_json
+ instance_group_manager_policy_patch_model_json2 = instance_group_manager_policy_patch_model.to_dict()
+ assert instance_group_manager_policy_patch_model_json2 == instance_group_manager_policy_patch_model_json
-class TestModel_InstanceConsoleAccessToken():
+class TestModel_InstanceGroupManagerPolicyReference():
"""
- Test Class for InstanceConsoleAccessToken
+ Test Class for InstanceGroupManagerPolicyReference
"""
- def test_instance_console_access_token_serialization(self):
+ def test_instance_group_manager_policy_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceConsoleAccessToken
+ Test serialization/deserialization for InstanceGroupManagerPolicyReference
"""
- # Construct a json representation of a InstanceConsoleAccessToken model
- instance_console_access_token_model_json = {}
- instance_console_access_token_model_json['access_token'] = 'VGhpcyBJcyBhIHRva2Vu'
- instance_console_access_token_model_json['console_type'] = 'serial'
- instance_console_access_token_model_json['created_at'] = "2020-07-27T21:50:14Z"
- instance_console_access_token_model_json['expires_at'] = "2020-07-27T21:51:14Z"
- instance_console_access_token_model_json['force'] = False
- instance_console_access_token_model_json['href'] = 'wss://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/console?access_token=VGhpcyBJcyBhIHRva2Vu'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceConsoleAccessToken by calling from_dict on the json representation
- instance_console_access_token_model = InstanceConsoleAccessToken.from_dict(instance_console_access_token_model_json)
- assert instance_console_access_token_model != False
+ instance_group_manager_policy_reference_deleted_model = {} # InstanceGroupManagerPolicyReferenceDeleted
+ instance_group_manager_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceConsoleAccessToken by calling from_dict on the json representation
- instance_console_access_token_model_dict = InstanceConsoleAccessToken.from_dict(instance_console_access_token_model_json).__dict__
- instance_console_access_token_model2 = InstanceConsoleAccessToken(**instance_console_access_token_model_dict)
+ # Construct a json representation of a InstanceGroupManagerPolicyReference model
+ instance_group_manager_policy_reference_model_json = {}
+ instance_group_manager_policy_reference_model_json['deleted'] = instance_group_manager_policy_reference_deleted_model
+ instance_group_manager_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_policy_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_policy_reference_model_json['name'] = 'my-instance-group-manager-policy'
+
+ # Construct a model instance of InstanceGroupManagerPolicyReference by calling from_dict on the json representation
+ instance_group_manager_policy_reference_model = InstanceGroupManagerPolicyReference.from_dict(instance_group_manager_policy_reference_model_json)
+ assert instance_group_manager_policy_reference_model != False
+
+ # Construct a model instance of InstanceGroupManagerPolicyReference by calling from_dict on the json representation
+ instance_group_manager_policy_reference_model_dict = InstanceGroupManagerPolicyReference.from_dict(instance_group_manager_policy_reference_model_json).__dict__
+ instance_group_manager_policy_reference_model2 = InstanceGroupManagerPolicyReference(**instance_group_manager_policy_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_console_access_token_model == instance_console_access_token_model2
+ assert instance_group_manager_policy_reference_model == instance_group_manager_policy_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_console_access_token_model_json2 = instance_console_access_token_model.to_dict()
- assert instance_console_access_token_model_json2 == instance_console_access_token_model_json
+ instance_group_manager_policy_reference_model_json2 = instance_group_manager_policy_reference_model.to_dict()
+ assert instance_group_manager_policy_reference_model_json2 == instance_group_manager_policy_reference_model_json
-class TestModel_InstanceDisk():
+class TestModel_InstanceGroupManagerPolicyReferenceDeleted():
"""
- Test Class for InstanceDisk
+ Test Class for InstanceGroupManagerPolicyReferenceDeleted
"""
- def test_instance_disk_serialization(self):
+ def test_instance_group_manager_policy_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceDisk
+ Test serialization/deserialization for InstanceGroupManagerPolicyReferenceDeleted
"""
- # Construct a json representation of a InstanceDisk model
- instance_disk_model_json = {}
- instance_disk_model_json['created_at'] = "2019-01-01T12:00:00Z"
- instance_disk_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_model_json['interface_type'] = 'nvme'
- instance_disk_model_json['name'] = 'my-instance-disk'
- instance_disk_model_json['resource_type'] = 'instance_disk'
- instance_disk_model_json['size'] = 100
+ # Construct a json representation of a InstanceGroupManagerPolicyReferenceDeleted model
+ instance_group_manager_policy_reference_deleted_model_json = {}
+ instance_group_manager_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceDisk by calling from_dict on the json representation
- instance_disk_model = InstanceDisk.from_dict(instance_disk_model_json)
- assert instance_disk_model != False
+ # Construct a model instance of InstanceGroupManagerPolicyReferenceDeleted by calling from_dict on the json representation
+ instance_group_manager_policy_reference_deleted_model = InstanceGroupManagerPolicyReferenceDeleted.from_dict(instance_group_manager_policy_reference_deleted_model_json)
+ assert instance_group_manager_policy_reference_deleted_model != False
- # Construct a model instance of InstanceDisk by calling from_dict on the json representation
- instance_disk_model_dict = InstanceDisk.from_dict(instance_disk_model_json).__dict__
- instance_disk_model2 = InstanceDisk(**instance_disk_model_dict)
+ # Construct a model instance of InstanceGroupManagerPolicyReferenceDeleted by calling from_dict on the json representation
+ instance_group_manager_policy_reference_deleted_model_dict = InstanceGroupManagerPolicyReferenceDeleted.from_dict(instance_group_manager_policy_reference_deleted_model_json).__dict__
+ instance_group_manager_policy_reference_deleted_model2 = InstanceGroupManagerPolicyReferenceDeleted(**instance_group_manager_policy_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert instance_disk_model == instance_disk_model2
+ assert instance_group_manager_policy_reference_deleted_model == instance_group_manager_policy_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- instance_disk_model_json2 = instance_disk_model.to_dict()
- assert instance_disk_model_json2 == instance_disk_model_json
+ instance_group_manager_policy_reference_deleted_model_json2 = instance_group_manager_policy_reference_deleted_model.to_dict()
+ assert instance_group_manager_policy_reference_deleted_model_json2 == instance_group_manager_policy_reference_deleted_model_json
-class TestModel_InstanceDiskCollection():
+class TestModel_InstanceGroupManagerReference():
"""
- Test Class for InstanceDiskCollection
+ Test Class for InstanceGroupManagerReference
"""
- def test_instance_disk_collection_serialization(self):
+ def test_instance_group_manager_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceDiskCollection
+ Test serialization/deserialization for InstanceGroupManagerReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_disk_model = {} # InstanceDisk
- instance_disk_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_disk_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_model['interface_type'] = 'nvme'
- instance_disk_model['name'] = 'my-instance-disk'
- instance_disk_model['resource_type'] = 'instance_disk'
- instance_disk_model['size'] = 100
+ instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
+ instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a InstanceDiskCollection model
- instance_disk_collection_model_json = {}
- instance_disk_collection_model_json['disks'] = [instance_disk_model]
+ # Construct a json representation of a InstanceGroupManagerReference model
+ instance_group_manager_reference_model_json = {}
+ instance_group_manager_reference_model_json['deleted'] = instance_group_manager_reference_deleted_model
+ instance_group_manager_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ instance_group_manager_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_manager_reference_model_json['name'] = 'my-instance-group-manager'
- # Construct a model instance of InstanceDiskCollection by calling from_dict on the json representation
- instance_disk_collection_model = InstanceDiskCollection.from_dict(instance_disk_collection_model_json)
- assert instance_disk_collection_model != False
+ # Construct a model instance of InstanceGroupManagerReference by calling from_dict on the json representation
+ instance_group_manager_reference_model = InstanceGroupManagerReference.from_dict(instance_group_manager_reference_model_json)
+ assert instance_group_manager_reference_model != False
- # Construct a model instance of InstanceDiskCollection by calling from_dict on the json representation
- instance_disk_collection_model_dict = InstanceDiskCollection.from_dict(instance_disk_collection_model_json).__dict__
- instance_disk_collection_model2 = InstanceDiskCollection(**instance_disk_collection_model_dict)
+ # Construct a model instance of InstanceGroupManagerReference by calling from_dict on the json representation
+ instance_group_manager_reference_model_dict = InstanceGroupManagerReference.from_dict(instance_group_manager_reference_model_json).__dict__
+ instance_group_manager_reference_model2 = InstanceGroupManagerReference(**instance_group_manager_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_disk_collection_model == instance_disk_collection_model2
+ assert instance_group_manager_reference_model == instance_group_manager_reference_model2
- # Convert model instance back to dict and verify no loss of data
- instance_disk_collection_model_json2 = instance_disk_collection_model.to_dict()
- assert instance_disk_collection_model_json2 == instance_disk_collection_model_json
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_manager_reference_model_json2 = instance_group_manager_reference_model.to_dict()
+ assert instance_group_manager_reference_model_json2 == instance_group_manager_reference_model_json
-class TestModel_InstanceDiskPatch():
+class TestModel_InstanceGroupManagerReferenceDeleted():
"""
- Test Class for InstanceDiskPatch
+ Test Class for InstanceGroupManagerReferenceDeleted
"""
- def test_instance_disk_patch_serialization(self):
+ def test_instance_group_manager_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceDiskPatch
+ Test serialization/deserialization for InstanceGroupManagerReferenceDeleted
"""
- # Construct a json representation of a InstanceDiskPatch model
- instance_disk_patch_model_json = {}
- instance_disk_patch_model_json['name'] = 'my-instance-disk-updated'
+ # Construct a json representation of a InstanceGroupManagerReferenceDeleted model
+ instance_group_manager_reference_deleted_model_json = {}
+ instance_group_manager_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceDiskPatch by calling from_dict on the json representation
- instance_disk_patch_model = InstanceDiskPatch.from_dict(instance_disk_patch_model_json)
- assert instance_disk_patch_model != False
+ # Construct a model instance of InstanceGroupManagerReferenceDeleted by calling from_dict on the json representation
+ instance_group_manager_reference_deleted_model = InstanceGroupManagerReferenceDeleted.from_dict(instance_group_manager_reference_deleted_model_json)
+ assert instance_group_manager_reference_deleted_model != False
- # Construct a model instance of InstanceDiskPatch by calling from_dict on the json representation
- instance_disk_patch_model_dict = InstanceDiskPatch.from_dict(instance_disk_patch_model_json).__dict__
- instance_disk_patch_model2 = InstanceDiskPatch(**instance_disk_patch_model_dict)
+ # Construct a model instance of InstanceGroupManagerReferenceDeleted by calling from_dict on the json representation
+ instance_group_manager_reference_deleted_model_dict = InstanceGroupManagerReferenceDeleted.from_dict(instance_group_manager_reference_deleted_model_json).__dict__
+ instance_group_manager_reference_deleted_model2 = InstanceGroupManagerReferenceDeleted(**instance_group_manager_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert instance_disk_patch_model == instance_disk_patch_model2
+ assert instance_group_manager_reference_deleted_model == instance_group_manager_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- instance_disk_patch_model_json2 = instance_disk_patch_model.to_dict()
- assert instance_disk_patch_model_json2 == instance_disk_patch_model_json
+ instance_group_manager_reference_deleted_model_json2 = instance_group_manager_reference_deleted_model.to_dict()
+ assert instance_group_manager_reference_deleted_model_json2 == instance_group_manager_reference_deleted_model_json
-class TestModel_InstanceDiskReference():
+class TestModel_InstanceGroupManagerScheduledActionGroup():
"""
- Test Class for InstanceDiskReference
+ Test Class for InstanceGroupManagerScheduledActionGroup
"""
- def test_instance_disk_reference_serialization(self):
+ def test_instance_group_manager_scheduled_action_group_serialization(self):
"""
- Test serialization/deserialization for InstanceDiskReference
+ Test serialization/deserialization for InstanceGroupManagerScheduledActionGroup
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_disk_reference_deleted_model = {} # InstanceDiskReferenceDeleted
- instance_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a InstanceDiskReference model
- instance_disk_reference_model_json = {}
- instance_disk_reference_model_json['deleted'] = instance_disk_reference_deleted_model
- instance_disk_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- instance_disk_reference_model_json['name'] = 'my-instance-disk'
- instance_disk_reference_model_json['resource_type'] = 'instance_disk'
+ # Construct a json representation of a InstanceGroupManagerScheduledActionGroup model
+ instance_group_manager_scheduled_action_group_model_json = {}
+ instance_group_manager_scheduled_action_group_model_json['membership_count'] = 10
- # Construct a model instance of InstanceDiskReference by calling from_dict on the json representation
- instance_disk_reference_model = InstanceDiskReference.from_dict(instance_disk_reference_model_json)
- assert instance_disk_reference_model != False
+ # Construct a model instance of InstanceGroupManagerScheduledActionGroup by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_group_model = InstanceGroupManagerScheduledActionGroup.from_dict(instance_group_manager_scheduled_action_group_model_json)
+ assert instance_group_manager_scheduled_action_group_model != False
- # Construct a model instance of InstanceDiskReference by calling from_dict on the json representation
- instance_disk_reference_model_dict = InstanceDiskReference.from_dict(instance_disk_reference_model_json).__dict__
- instance_disk_reference_model2 = InstanceDiskReference(**instance_disk_reference_model_dict)
+ # Construct a model instance of InstanceGroupManagerScheduledActionGroup by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_group_model_dict = InstanceGroupManagerScheduledActionGroup.from_dict(instance_group_manager_scheduled_action_group_model_json).__dict__
+ instance_group_manager_scheduled_action_group_model2 = InstanceGroupManagerScheduledActionGroup(**instance_group_manager_scheduled_action_group_model_dict)
# Verify the model instances are equivalent
- assert instance_disk_reference_model == instance_disk_reference_model2
+ assert instance_group_manager_scheduled_action_group_model == instance_group_manager_scheduled_action_group_model2
# Convert model instance back to dict and verify no loss of data
- instance_disk_reference_model_json2 = instance_disk_reference_model.to_dict()
- assert instance_disk_reference_model_json2 == instance_disk_reference_model_json
+ instance_group_manager_scheduled_action_group_model_json2 = instance_group_manager_scheduled_action_group_model.to_dict()
+ assert instance_group_manager_scheduled_action_group_model_json2 == instance_group_manager_scheduled_action_group_model_json
-class TestModel_InstanceDiskReferenceDeleted():
+class TestModel_InstanceGroupManagerScheduledActionGroupPrototype():
"""
- Test Class for InstanceDiskReferenceDeleted
+ Test Class for InstanceGroupManagerScheduledActionGroupPrototype
"""
- def test_instance_disk_reference_deleted_serialization(self):
+ def test_instance_group_manager_scheduled_action_group_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceDiskReferenceDeleted
+ Test serialization/deserialization for InstanceGroupManagerScheduledActionGroupPrototype
"""
- # Construct a json representation of a InstanceDiskReferenceDeleted model
- instance_disk_reference_deleted_model_json = {}
- instance_disk_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a InstanceGroupManagerScheduledActionGroupPrototype model
+ instance_group_manager_scheduled_action_group_prototype_model_json = {}
+ instance_group_manager_scheduled_action_group_prototype_model_json['membership_count'] = 10
- # Construct a model instance of InstanceDiskReferenceDeleted by calling from_dict on the json representation
- instance_disk_reference_deleted_model = InstanceDiskReferenceDeleted.from_dict(instance_disk_reference_deleted_model_json)
- assert instance_disk_reference_deleted_model != False
+ # Construct a model instance of InstanceGroupManagerScheduledActionGroupPrototype by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_group_prototype_model = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(instance_group_manager_scheduled_action_group_prototype_model_json)
+ assert instance_group_manager_scheduled_action_group_prototype_model != False
- # Construct a model instance of InstanceDiskReferenceDeleted by calling from_dict on the json representation
- instance_disk_reference_deleted_model_dict = InstanceDiskReferenceDeleted.from_dict(instance_disk_reference_deleted_model_json).__dict__
- instance_disk_reference_deleted_model2 = InstanceDiskReferenceDeleted(**instance_disk_reference_deleted_model_dict)
+ # Construct a model instance of InstanceGroupManagerScheduledActionGroupPrototype by calling from_dict on the json representation
+ instance_group_manager_scheduled_action_group_prototype_model_dict = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(instance_group_manager_scheduled_action_group_prototype_model_json).__dict__
+ instance_group_manager_scheduled_action_group_prototype_model2 = InstanceGroupManagerScheduledActionGroupPrototype(**instance_group_manager_scheduled_action_group_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_disk_reference_deleted_model == instance_disk_reference_deleted_model2
+ assert instance_group_manager_scheduled_action_group_prototype_model == instance_group_manager_scheduled_action_group_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_disk_reference_deleted_model_json2 = instance_disk_reference_deleted_model.to_dict()
- assert instance_disk_reference_deleted_model_json2 == instance_disk_reference_deleted_model_json
+ instance_group_manager_scheduled_action_group_prototype_model_json2 = instance_group_manager_scheduled_action_group_prototype_model.to_dict()
+ assert instance_group_manager_scheduled_action_group_prototype_model_json2 == instance_group_manager_scheduled_action_group_prototype_model_json
-class TestModel_InstanceGPU():
+class TestModel_InstanceGroupMembership():
"""
- Test Class for InstanceGPU
+ Test Class for InstanceGroupMembership
"""
- def test_instance_gpu_serialization(self):
+ def test_instance_group_membership_serialization(self):
"""
- Test serialization/deserialization for InstanceGPU
+ Test serialization/deserialization for InstanceGroupMembership
"""
- # Construct a json representation of a InstanceGPU model
- instance_gpu_model_json = {}
- instance_gpu_model_json['count'] = 1
- instance_gpu_model_json['manufacturer'] = 'nvidia'
- instance_gpu_model_json['memory'] = 1
- instance_gpu_model_json['model'] = 'Tesla V100'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceGPU by calling from_dict on the json representation
- instance_gpu_model = InstanceGPU.from_dict(instance_gpu_model_json)
- assert instance_gpu_model != False
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceGPU by calling from_dict on the json representation
- instance_gpu_model_dict = InstanceGPU.from_dict(instance_gpu_model_json).__dict__
- instance_gpu_model2 = InstanceGPU(**instance_gpu_model_dict)
+ instance_reference_model = {} # InstanceReference
+ instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['deleted'] = instance_reference_deleted_model
+ instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['name'] = 'my-instance'
+
+ instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
+ instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_template_reference_model = {} # InstanceTemplateReference
+ instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_reference_model['deleted'] = instance_template_reference_deleted_model
+ instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_reference_model['name'] = 'my-instance-template'
+
+ load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
+ load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference
+ load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model
+ load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a json representation of a InstanceGroupMembership model
+ instance_group_membership_model_json = {}
+ instance_group_membership_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ instance_group_membership_model_json['delete_instance_on_membership_delete'] = True
+ instance_group_membership_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed'
+ instance_group_membership_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_membership_model_json['instance'] = instance_reference_model
+ instance_group_membership_model_json['instance_template'] = instance_template_reference_model
+ instance_group_membership_model_json['name'] = 'my-instance-group-membership'
+ instance_group_membership_model_json['pool_member'] = load_balancer_pool_member_reference_model
+ instance_group_membership_model_json['status'] = 'deleting'
+ instance_group_membership_model_json['updated_at'] = "2019-01-01T12:00:00Z"
+
+ # Construct a model instance of InstanceGroupMembership by calling from_dict on the json representation
+ instance_group_membership_model = InstanceGroupMembership.from_dict(instance_group_membership_model_json)
+ assert instance_group_membership_model != False
+
+ # Construct a model instance of InstanceGroupMembership by calling from_dict on the json representation
+ instance_group_membership_model_dict = InstanceGroupMembership.from_dict(instance_group_membership_model_json).__dict__
+ instance_group_membership_model2 = InstanceGroupMembership(**instance_group_membership_model_dict)
# Verify the model instances are equivalent
- assert instance_gpu_model == instance_gpu_model2
+ assert instance_group_membership_model == instance_group_membership_model2
# Convert model instance back to dict and verify no loss of data
- instance_gpu_model_json2 = instance_gpu_model.to_dict()
- assert instance_gpu_model_json2 == instance_gpu_model_json
+ instance_group_membership_model_json2 = instance_group_membership_model.to_dict()
+ assert instance_group_membership_model_json2 == instance_group_membership_model_json
-class TestModel_InstanceGroup():
+class TestModel_InstanceGroupMembershipCollection():
"""
- Test Class for InstanceGroup
+ Test Class for InstanceGroupMembershipCollection
"""
- def test_instance_group_serialization(self):
+ def test_instance_group_membership_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceGroup
+ Test serialization/deserialization for InstanceGroupMembershipCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
+ instance_group_membership_collection_first_model = {} # InstanceGroupMembershipCollectionFirst
+ instance_group_membership_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20'
+
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ instance_reference_model = {} # InstanceReference
+ instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['deleted'] = instance_reference_deleted_model
+ instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['name'] = 'my-instance'
+
instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
@@ -34162,11353 +36273,11443 @@ def test_instance_group_serialization(self):
instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
instance_template_reference_model['name'] = 'my-instance-template'
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
+ load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
- load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference
+ load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model
+ load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
- instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_group_membership_model = {} # InstanceGroupMembership
+ instance_group_membership_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_group_membership_model['delete_instance_on_membership_delete'] = True
+ instance_group_membership_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed'
+ instance_group_membership_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_membership_model['instance'] = instance_reference_model
+ instance_group_membership_model['instance_template'] = instance_template_reference_model
+ instance_group_membership_model['name'] = 'my-instance-group-membership'
+ instance_group_membership_model['pool_member'] = load_balancer_pool_member_reference_model
+ instance_group_membership_model['status'] = 'deleting'
+ instance_group_membership_model['updated_at'] = "2019-01-01T12:00:00Z"
- instance_group_manager_reference_model = {} # InstanceGroupManagerReference
- instance_group_manager_reference_model['deleted'] = instance_group_manager_reference_deleted_model
- instance_group_manager_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- instance_group_manager_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_reference_model['name'] = 'my-instance-group-manager'
+ instance_group_membership_collection_next_model = {} # InstanceGroupMembershipCollectionNext
+ instance_group_membership_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- 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'
+ # Construct a json representation of a InstanceGroupMembershipCollection model
+ instance_group_membership_collection_model_json = {}
+ instance_group_membership_collection_model_json['first'] = instance_group_membership_collection_first_model
+ instance_group_membership_collection_model_json['limit'] = 20
+ instance_group_membership_collection_model_json['memberships'] = [instance_group_membership_model]
+ instance_group_membership_collection_model_json['next'] = instance_group_membership_collection_next_model
+ instance_group_membership_collection_model_json['total_count'] = 132
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of InstanceGroupMembershipCollection by calling from_dict on the json representation
+ instance_group_membership_collection_model = InstanceGroupMembershipCollection.from_dict(instance_group_membership_collection_model_json)
+ assert instance_group_membership_collection_model != False
- 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'
+ # Construct a model instance of InstanceGroupMembershipCollection by calling from_dict on the json representation
+ instance_group_membership_collection_model_dict = InstanceGroupMembershipCollection.from_dict(instance_group_membership_collection_model_json).__dict__
+ instance_group_membership_collection_model2 = InstanceGroupMembershipCollection(**instance_group_membership_collection_model_dict)
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert instance_group_membership_collection_model == instance_group_membership_collection_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_membership_collection_model_json2 = instance_group_membership_collection_model.to_dict()
+ assert instance_group_membership_collection_model_json2 == instance_group_membership_collection_model_json
- # Construct a json representation of a InstanceGroup model
- instance_group_model_json = {}
- instance_group_model_json['application_port'] = 22
- instance_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
- instance_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_model_json['instance_template'] = instance_template_reference_model
- instance_group_model_json['load_balancer_pool'] = load_balancer_pool_reference_model
- instance_group_model_json['managers'] = [instance_group_manager_reference_model]
- instance_group_model_json['membership_count'] = 10
- instance_group_model_json['name'] = 'my-instance-group'
- instance_group_model_json['resource_group'] = resource_group_reference_model
- instance_group_model_json['status'] = 'deleting'
- instance_group_model_json['subnets'] = [subnet_reference_model]
- instance_group_model_json['updated_at'] = "2019-01-01T12:00:00Z"
- instance_group_model_json['vpc'] = vpc_reference_model
+class TestModel_InstanceGroupMembershipCollectionFirst():
+ """
+ Test Class for InstanceGroupMembershipCollectionFirst
+ """
- # Construct a model instance of InstanceGroup by calling from_dict on the json representation
- instance_group_model = InstanceGroup.from_dict(instance_group_model_json)
- assert instance_group_model != False
+ def test_instance_group_membership_collection_first_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupMembershipCollectionFirst
+ """
- # Construct a model instance of InstanceGroup by calling from_dict on the json representation
- instance_group_model_dict = InstanceGroup.from_dict(instance_group_model_json).__dict__
- instance_group_model2 = InstanceGroup(**instance_group_model_dict)
+ # Construct a json representation of a InstanceGroupMembershipCollectionFirst model
+ instance_group_membership_collection_first_model_json = {}
+ instance_group_membership_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20'
+
+ # Construct a model instance of InstanceGroupMembershipCollectionFirst by calling from_dict on the json representation
+ instance_group_membership_collection_first_model = InstanceGroupMembershipCollectionFirst.from_dict(instance_group_membership_collection_first_model_json)
+ assert instance_group_membership_collection_first_model != False
+
+ # Construct a model instance of InstanceGroupMembershipCollectionFirst by calling from_dict on the json representation
+ instance_group_membership_collection_first_model_dict = InstanceGroupMembershipCollectionFirst.from_dict(instance_group_membership_collection_first_model_json).__dict__
+ instance_group_membership_collection_first_model2 = InstanceGroupMembershipCollectionFirst(**instance_group_membership_collection_first_model_dict)
# Verify the model instances are equivalent
- assert instance_group_model == instance_group_model2
+ assert instance_group_membership_collection_first_model == instance_group_membership_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_model_json2 = instance_group_model.to_dict()
- assert instance_group_model_json2 == instance_group_model_json
+ instance_group_membership_collection_first_model_json2 = instance_group_membership_collection_first_model.to_dict()
+ assert instance_group_membership_collection_first_model_json2 == instance_group_membership_collection_first_model_json
-class TestModel_InstanceGroupCollection():
+class TestModel_InstanceGroupMembershipCollectionNext():
"""
- Test Class for InstanceGroupCollection
+ Test Class for InstanceGroupMembershipCollectionNext
"""
- def test_instance_group_collection_serialization(self):
+ def test_instance_group_membership_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupCollection
+ Test serialization/deserialization for InstanceGroupMembershipCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a InstanceGroupMembershipCollectionNext model
+ instance_group_membership_collection_next_model_json = {}
+ instance_group_membership_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- instance_group_collection_first_model = {} # InstanceGroupCollectionFirst
- instance_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20'
+ # Construct a model instance of InstanceGroupMembershipCollectionNext by calling from_dict on the json representation
+ instance_group_membership_collection_next_model = InstanceGroupMembershipCollectionNext.from_dict(instance_group_membership_collection_next_model_json)
+ assert instance_group_membership_collection_next_model != False
- instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
- instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of InstanceGroupMembershipCollectionNext by calling from_dict on the json representation
+ instance_group_membership_collection_next_model_dict = InstanceGroupMembershipCollectionNext.from_dict(instance_group_membership_collection_next_model_json).__dict__
+ instance_group_membership_collection_next_model2 = InstanceGroupMembershipCollectionNext(**instance_group_membership_collection_next_model_dict)
- instance_template_reference_model = {} # InstanceTemplateReference
- instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_reference_model['deleted'] = instance_template_reference_deleted_model
- instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- instance_template_reference_model['name'] = 'my-instance-template'
+ # Verify the model instances are equivalent
+ assert instance_group_membership_collection_next_model == instance_group_membership_collection_next_model2
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_membership_collection_next_model_json2 = instance_group_membership_collection_next_model.to_dict()
+ assert instance_group_membership_collection_next_model_json2 == instance_group_membership_collection_next_model_json
- load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
- load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+class TestModel_InstanceGroupMembershipPatch():
+ """
+ Test Class for InstanceGroupMembershipPatch
+ """
- instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
- instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ def test_instance_group_membership_patch_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupMembershipPatch
+ """
- instance_group_manager_reference_model = {} # InstanceGroupManagerReference
- instance_group_manager_reference_model['deleted'] = instance_group_manager_reference_deleted_model
- instance_group_manager_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- instance_group_manager_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_reference_model['name'] = 'my-instance-group-manager'
+ # Construct a json representation of a InstanceGroupMembershipPatch model
+ instance_group_membership_patch_model_json = {}
+ instance_group_membership_patch_model_json['name'] = 'my-instance-group-membership'
- 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'
+ # Construct a model instance of InstanceGroupMembershipPatch by calling from_dict on the json representation
+ instance_group_membership_patch_model = InstanceGroupMembershipPatch.from_dict(instance_group_membership_patch_model_json)
+ assert instance_group_membership_patch_model != False
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of InstanceGroupMembershipPatch by calling from_dict on the json representation
+ instance_group_membership_patch_model_dict = InstanceGroupMembershipPatch.from_dict(instance_group_membership_patch_model_json).__dict__
+ instance_group_membership_patch_model2 = InstanceGroupMembershipPatch(**instance_group_membership_patch_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert instance_group_membership_patch_model == instance_group_membership_patch_model2
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_membership_patch_model_json2 = instance_group_membership_patch_model.to_dict()
+ assert instance_group_membership_patch_model_json2 == instance_group_membership_patch_model_json
- 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'
+class TestModel_InstanceGroupPatch():
+ """
+ Test Class for InstanceGroupPatch
+ """
- instance_group_model = {} # InstanceGroup
- instance_group_model['application_port'] = 22
- instance_group_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_model['instance_template'] = instance_template_reference_model
- instance_group_model['load_balancer_pool'] = load_balancer_pool_reference_model
- instance_group_model['managers'] = [instance_group_manager_reference_model]
- instance_group_model['membership_count'] = 10
- instance_group_model['name'] = 'my-instance-group'
- instance_group_model['resource_group'] = resource_group_reference_model
- instance_group_model['status'] = 'deleting'
- instance_group_model['subnets'] = [subnet_reference_model]
- instance_group_model['updated_at'] = "2019-01-01T12:00:00Z"
- instance_group_model['vpc'] = vpc_reference_model
+ def test_instance_group_patch_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupPatch
+ """
- instance_group_collection_next_model = {} # InstanceGroupCollectionNext
- instance_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a json representation of a InstanceGroupCollection model
- instance_group_collection_model_json = {}
- instance_group_collection_model_json['first'] = instance_group_collection_first_model
- instance_group_collection_model_json['instance_groups'] = [instance_group_model]
- instance_group_collection_model_json['limit'] = 20
- instance_group_collection_model_json['next'] = instance_group_collection_next_model
- instance_group_collection_model_json['total_count'] = 132
+ instance_template_identity_model = {} # InstanceTemplateIdentityById
+ instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of InstanceGroupCollection by calling from_dict on the json representation
- instance_group_collection_model = InstanceGroupCollection.from_dict(instance_group_collection_model_json)
- assert instance_group_collection_model != False
+ load_balancer_identity_model = {} # LoadBalancerIdentityById
+ load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- # Construct a model instance of InstanceGroupCollection by calling from_dict on the json representation
- instance_group_collection_model_dict = InstanceGroupCollection.from_dict(instance_group_collection_model_json).__dict__
- instance_group_collection_model2 = InstanceGroupCollection(**instance_group_collection_model_dict)
+ load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById
+ load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # Construct a json representation of a InstanceGroupPatch model
+ instance_group_patch_model_json = {}
+ instance_group_patch_model_json['application_port'] = 22
+ instance_group_patch_model_json['instance_template'] = instance_template_identity_model
+ instance_group_patch_model_json['load_balancer'] = load_balancer_identity_model
+ instance_group_patch_model_json['load_balancer_pool'] = load_balancer_pool_identity_model
+ instance_group_patch_model_json['membership_count'] = 10
+ instance_group_patch_model_json['name'] = 'my-instance-group'
+ instance_group_patch_model_json['subnets'] = [subnet_identity_model]
+
+ # Construct a model instance of InstanceGroupPatch by calling from_dict on the json representation
+ instance_group_patch_model = InstanceGroupPatch.from_dict(instance_group_patch_model_json)
+ assert instance_group_patch_model != False
+
+ # Construct a model instance of InstanceGroupPatch by calling from_dict on the json representation
+ instance_group_patch_model_dict = InstanceGroupPatch.from_dict(instance_group_patch_model_json).__dict__
+ instance_group_patch_model2 = InstanceGroupPatch(**instance_group_patch_model_dict)
+
+ # Verify the model instances are equivalent
+ assert instance_group_patch_model == instance_group_patch_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ instance_group_patch_model_json2 = instance_group_patch_model.to_dict()
+ assert instance_group_patch_model_json2 == instance_group_patch_model_json
+
+class TestModel_InstanceGroupReference():
+ """
+ Test Class for InstanceGroupReference
+ """
+
+ def test_instance_group_reference_serialization(self):
+ """
+ Test serialization/deserialization for InstanceGroupReference
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ instance_group_reference_deleted_model = {} # InstanceGroupReferenceDeleted
+ instance_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a json representation of a InstanceGroupReference model
+ instance_group_reference_model_json = {}
+ instance_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_reference_model_json['deleted'] = instance_group_reference_deleted_model
+ instance_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_reference_model_json['name'] = 'my-instance-group'
+
+ # Construct a model instance of InstanceGroupReference by calling from_dict on the json representation
+ instance_group_reference_model = InstanceGroupReference.from_dict(instance_group_reference_model_json)
+ assert instance_group_reference_model != False
+
+ # Construct a model instance of InstanceGroupReference by calling from_dict on the json representation
+ instance_group_reference_model_dict = InstanceGroupReference.from_dict(instance_group_reference_model_json).__dict__
+ instance_group_reference_model2 = InstanceGroupReference(**instance_group_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_group_collection_model == instance_group_collection_model2
+ assert instance_group_reference_model == instance_group_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_collection_model_json2 = instance_group_collection_model.to_dict()
- assert instance_group_collection_model_json2 == instance_group_collection_model_json
+ instance_group_reference_model_json2 = instance_group_reference_model.to_dict()
+ assert instance_group_reference_model_json2 == instance_group_reference_model_json
-class TestModel_InstanceGroupCollectionFirst():
+class TestModel_InstanceGroupReferenceDeleted():
"""
- Test Class for InstanceGroupCollectionFirst
+ Test Class for InstanceGroupReferenceDeleted
"""
- def test_instance_group_collection_first_serialization(self):
+ def test_instance_group_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupCollectionFirst
+ Test serialization/deserialization for InstanceGroupReferenceDeleted
"""
- # Construct a json representation of a InstanceGroupCollectionFirst model
- instance_group_collection_first_model_json = {}
- instance_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?limit=20'
+ # Construct a json representation of a InstanceGroupReferenceDeleted model
+ instance_group_reference_deleted_model_json = {}
+ instance_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceGroupCollectionFirst by calling from_dict on the json representation
- instance_group_collection_first_model = InstanceGroupCollectionFirst.from_dict(instance_group_collection_first_model_json)
- assert instance_group_collection_first_model != False
+ # Construct a model instance of InstanceGroupReferenceDeleted by calling from_dict on the json representation
+ instance_group_reference_deleted_model = InstanceGroupReferenceDeleted.from_dict(instance_group_reference_deleted_model_json)
+ assert instance_group_reference_deleted_model != False
- # Construct a model instance of InstanceGroupCollectionFirst by calling from_dict on the json representation
- instance_group_collection_first_model_dict = InstanceGroupCollectionFirst.from_dict(instance_group_collection_first_model_json).__dict__
- instance_group_collection_first_model2 = InstanceGroupCollectionFirst(**instance_group_collection_first_model_dict)
+ # Construct a model instance of InstanceGroupReferenceDeleted by calling from_dict on the json representation
+ instance_group_reference_deleted_model_dict = InstanceGroupReferenceDeleted.from_dict(instance_group_reference_deleted_model_json).__dict__
+ instance_group_reference_deleted_model2 = InstanceGroupReferenceDeleted(**instance_group_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert instance_group_collection_first_model == instance_group_collection_first_model2
+ assert instance_group_reference_deleted_model == instance_group_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_collection_first_model_json2 = instance_group_collection_first_model.to_dict()
- assert instance_group_collection_first_model_json2 == instance_group_collection_first_model_json
+ instance_group_reference_deleted_model_json2 = instance_group_reference_deleted_model.to_dict()
+ assert instance_group_reference_deleted_model_json2 == instance_group_reference_deleted_model_json
-class TestModel_InstanceGroupCollectionNext():
+class TestModel_InstanceInitialization():
"""
- Test Class for InstanceGroupCollectionNext
+ Test Class for InstanceInitialization
"""
- def test_instance_group_collection_next_serialization(self):
+ def test_instance_initialization_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupCollectionNext
+ Test serialization/deserialization for InstanceInitialization
"""
- # Construct a json representation of a InstanceGroupCollectionNext model
- instance_group_collection_next_model_json = {}
- instance_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- # Construct a model instance of InstanceGroupCollectionNext by calling from_dict on the json representation
- instance_group_collection_next_model = InstanceGroupCollectionNext.from_dict(instance_group_collection_next_model_json)
- assert instance_group_collection_next_model != False
-
- # Construct a model instance of InstanceGroupCollectionNext by calling from_dict on the json representation
- instance_group_collection_next_model_dict = InstanceGroupCollectionNext.from_dict(instance_group_collection_next_model_json).__dict__
- instance_group_collection_next_model2 = InstanceGroupCollectionNext(**instance_group_collection_next_model_dict)
+ # Construct dict forms of any model objects needed in order to build this model.
- # Verify the model instances are equivalent
- assert instance_group_collection_next_model == instance_group_collection_next_model2
+ key_reference_deleted_model = {} # KeyReferenceDeleted
+ key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- instance_group_collection_next_model_json2 = instance_group_collection_next_model.to_dict()
- assert instance_group_collection_next_model_json2 == instance_group_collection_next_model_json
+ key_reference_model = {} # KeyReference
+ key_reference_model['crn'] = 'crn:[...]'
+ key_reference_model['deleted'] = key_reference_deleted_model
+ key_reference_model['fingerprint'] = 'SHA256:RJ+YWs2kupwFGiJuLqY85twmcdLOUcjIc9cA6IR8n8E'
+ key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45'
+ key_reference_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45'
+ key_reference_model['name'] = 'my-key-1'
-class TestModel_InstanceGroupManagerActionGroupPatch():
- """
- Test Class for InstanceGroupManagerActionGroupPatch
- """
+ key_identity_by_fingerprint_model = {} # KeyIdentityByFingerprint
+ key_identity_by_fingerprint_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
- def test_instance_group_manager_action_group_patch_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupManagerActionGroupPatch
- """
+ instance_initialization_password_model = {} # InstanceInitializationPassword
+ instance_initialization_password_model['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
+ instance_initialization_password_model['encryption_key'] = key_identity_by_fingerprint_model
- # Construct a json representation of a InstanceGroupManagerActionGroupPatch model
- instance_group_manager_action_group_patch_model_json = {}
- instance_group_manager_action_group_patch_model_json['membership_count'] = 10
+ # Construct a json representation of a InstanceInitialization model
+ instance_initialization_model_json = {}
+ instance_initialization_model_json['keys'] = [key_reference_model]
+ instance_initialization_model_json['password'] = instance_initialization_password_model
- # Construct a model instance of InstanceGroupManagerActionGroupPatch by calling from_dict on the json representation
- instance_group_manager_action_group_patch_model = InstanceGroupManagerActionGroupPatch.from_dict(instance_group_manager_action_group_patch_model_json)
- assert instance_group_manager_action_group_patch_model != False
+ # Construct a model instance of InstanceInitialization by calling from_dict on the json representation
+ instance_initialization_model = InstanceInitialization.from_dict(instance_initialization_model_json)
+ assert instance_initialization_model != False
- # Construct a model instance of InstanceGroupManagerActionGroupPatch by calling from_dict on the json representation
- instance_group_manager_action_group_patch_model_dict = InstanceGroupManagerActionGroupPatch.from_dict(instance_group_manager_action_group_patch_model_json).__dict__
- instance_group_manager_action_group_patch_model2 = InstanceGroupManagerActionGroupPatch(**instance_group_manager_action_group_patch_model_dict)
+ # Construct a model instance of InstanceInitialization by calling from_dict on the json representation
+ instance_initialization_model_dict = InstanceInitialization.from_dict(instance_initialization_model_json).__dict__
+ instance_initialization_model2 = InstanceInitialization(**instance_initialization_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_action_group_patch_model == instance_group_manager_action_group_patch_model2
+ assert instance_initialization_model == instance_initialization_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_action_group_patch_model_json2 = instance_group_manager_action_group_patch_model.to_dict()
- assert instance_group_manager_action_group_patch_model_json2 == instance_group_manager_action_group_patch_model_json
+ instance_initialization_model_json2 = instance_initialization_model.to_dict()
+ assert instance_initialization_model_json2 == instance_initialization_model_json
-class TestModel_InstanceGroupManagerActionManagerPatch():
+class TestModel_InstanceInitializationPassword():
"""
- Test Class for InstanceGroupManagerActionManagerPatch
+ Test Class for InstanceInitializationPassword
"""
- def test_instance_group_manager_action_manager_patch_serialization(self):
+ def test_instance_initialization_password_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionManagerPatch
+ Test serialization/deserialization for InstanceInitializationPassword
"""
- # Construct a json representation of a InstanceGroupManagerActionManagerPatch model
- instance_group_manager_action_manager_patch_model_json = {}
- instance_group_manager_action_manager_patch_model_json['max_membership_count'] = 10
- instance_group_manager_action_manager_patch_model_json['min_membership_count'] = 10
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceGroupManagerActionManagerPatch by calling from_dict on the json representation
- instance_group_manager_action_manager_patch_model = InstanceGroupManagerActionManagerPatch.from_dict(instance_group_manager_action_manager_patch_model_json)
- assert instance_group_manager_action_manager_patch_model != False
+ key_identity_by_fingerprint_model = {} # KeyIdentityByFingerprint
+ key_identity_by_fingerprint_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
- # Construct a model instance of InstanceGroupManagerActionManagerPatch by calling from_dict on the json representation
- instance_group_manager_action_manager_patch_model_dict = InstanceGroupManagerActionManagerPatch.from_dict(instance_group_manager_action_manager_patch_model_json).__dict__
- instance_group_manager_action_manager_patch_model2 = InstanceGroupManagerActionManagerPatch(**instance_group_manager_action_manager_patch_model_dict)
+ # Construct a json representation of a InstanceInitializationPassword model
+ instance_initialization_password_model_json = {}
+ instance_initialization_password_model_json['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
+ instance_initialization_password_model_json['encryption_key'] = key_identity_by_fingerprint_model
+
+ # Construct a model instance of InstanceInitializationPassword by calling from_dict on the json representation
+ instance_initialization_password_model = InstanceInitializationPassword.from_dict(instance_initialization_password_model_json)
+ assert instance_initialization_password_model != False
+
+ # Construct a model instance of InstanceInitializationPassword by calling from_dict on the json representation
+ instance_initialization_password_model_dict = InstanceInitializationPassword.from_dict(instance_initialization_password_model_json).__dict__
+ instance_initialization_password_model2 = InstanceInitializationPassword(**instance_initialization_password_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_action_manager_patch_model == instance_group_manager_action_manager_patch_model2
+ assert instance_initialization_password_model == instance_initialization_password_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_action_manager_patch_model_json2 = instance_group_manager_action_manager_patch_model.to_dict()
- assert instance_group_manager_action_manager_patch_model_json2 == instance_group_manager_action_manager_patch_model_json
+ instance_initialization_password_model_json2 = instance_initialization_password_model.to_dict()
+ assert instance_initialization_password_model_json2 == instance_initialization_password_model_json
-class TestModel_InstanceGroupManagerActionPatch():
+class TestModel_InstancePatch():
"""
- Test Class for InstanceGroupManagerActionPatch
+ Test Class for InstancePatch
"""
- def test_instance_group_manager_action_patch_serialization(self):
+ def test_instance_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionPatch
+ Test serialization/deserialization for InstancePatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_group_manager_action_group_patch_model = {} # InstanceGroupManagerActionGroupPatch
- instance_group_manager_action_group_patch_model['membership_count'] = 10
+ instance_placement_target_patch_model = {} # InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_patch_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_action_manager_patch_model = {} # InstanceGroupManagerActionManagerPatch
- instance_group_manager_action_manager_patch_model['max_membership_count'] = 10
- instance_group_manager_action_manager_patch_model['min_membership_count'] = 10
+ instance_patch_profile_model = {} # InstancePatchProfileInstanceProfileIdentityByName
+ instance_patch_profile_model['name'] = 'bc1-4x16'
- # Construct a json representation of a InstanceGroupManagerActionPatch model
- instance_group_manager_action_patch_model_json = {}
- instance_group_manager_action_patch_model_json['cron_spec'] = '*/5 1,2,3 * * *'
- instance_group_manager_action_patch_model_json['group'] = instance_group_manager_action_group_patch_model
- instance_group_manager_action_patch_model_json['manager'] = instance_group_manager_action_manager_patch_model
- instance_group_manager_action_patch_model_json['name'] = 'my-instance-group-manager-action'
- instance_group_manager_action_patch_model_json['run_at'] = "2019-01-01T12:00:00Z"
+ # Construct a json representation of a InstancePatch model
+ instance_patch_model_json = {}
+ instance_patch_model_json['name'] = 'my-instance'
+ instance_patch_model_json['placement_target'] = instance_placement_target_patch_model
+ instance_patch_model_json['profile'] = instance_patch_profile_model
+ instance_patch_model_json['total_volume_bandwidth'] = 500
- # Construct a model instance of InstanceGroupManagerActionPatch by calling from_dict on the json representation
- instance_group_manager_action_patch_model = InstanceGroupManagerActionPatch.from_dict(instance_group_manager_action_patch_model_json)
- assert instance_group_manager_action_patch_model != False
+ # Construct a model instance of InstancePatch by calling from_dict on the json representation
+ instance_patch_model = InstancePatch.from_dict(instance_patch_model_json)
+ assert instance_patch_model != False
- # Construct a model instance of InstanceGroupManagerActionPatch by calling from_dict on the json representation
- instance_group_manager_action_patch_model_dict = InstanceGroupManagerActionPatch.from_dict(instance_group_manager_action_patch_model_json).__dict__
- instance_group_manager_action_patch_model2 = InstanceGroupManagerActionPatch(**instance_group_manager_action_patch_model_dict)
+ # Construct a model instance of InstancePatch by calling from_dict on the json representation
+ instance_patch_model_dict = InstancePatch.from_dict(instance_patch_model_json).__dict__
+ instance_patch_model2 = InstancePatch(**instance_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_action_patch_model == instance_group_manager_action_patch_model2
+ assert instance_patch_model == instance_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_action_patch_model_json2 = instance_group_manager_action_patch_model.to_dict()
- assert instance_group_manager_action_patch_model_json2 == instance_group_manager_action_patch_model_json
+ instance_patch_model_json2 = instance_patch_model.to_dict()
+ assert instance_patch_model_json2 == instance_patch_model_json
-class TestModel_InstanceGroupManagerActionReference():
+class TestModel_InstanceProfile():
"""
- Test Class for InstanceGroupManagerActionReference
+ Test Class for InstanceProfile
"""
- def test_instance_group_manager_action_reference_serialization(self):
+ def test_instance_profile_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionReference
+ Test serialization/deserialization for InstanceProfile
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_group_manager_action_reference_deleted_model = {} # InstanceGroupManagerActionReferenceDeleted
- instance_group_manager_action_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed
+ instance_profile_bandwidth_model['type'] = 'fixed'
+ instance_profile_bandwidth_model['value'] = 20000
- # Construct a json representation of a InstanceGroupManagerActionReference model
- instance_group_manager_action_reference_model_json = {}
- instance_group_manager_action_reference_model_json['deleted'] = instance_group_manager_action_reference_deleted_model
- instance_group_manager_action_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_action_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_action_reference_model_json['name'] = 'my-instance-group-manager-action'
- instance_group_manager_action_reference_model_json['resource_type'] = 'instance_group_manager_action'
+ instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed
+ instance_profile_disk_quantity_model['type'] = 'fixed'
+ instance_profile_disk_quantity_model['value'] = 4
- # Construct a model instance of InstanceGroupManagerActionReference by calling from_dict on the json representation
- instance_group_manager_action_reference_model = InstanceGroupManagerActionReference.from_dict(instance_group_manager_action_reference_model_json)
- assert instance_group_manager_action_reference_model != False
+ instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed
+ instance_profile_disk_size_model['type'] = 'fixed'
+ instance_profile_disk_size_model['value'] = 100
- # Construct a model instance of InstanceGroupManagerActionReference by calling from_dict on the json representation
- instance_group_manager_action_reference_model_dict = InstanceGroupManagerActionReference.from_dict(instance_group_manager_action_reference_model_json).__dict__
- instance_group_manager_action_reference_model2 = InstanceGroupManagerActionReference(**instance_group_manager_action_reference_model_dict)
+ instance_profile_disk_supported_interfaces_model = {} # InstanceProfileDiskSupportedInterfaces
+ instance_profile_disk_supported_interfaces_model['default'] = 'nvme'
+ instance_profile_disk_supported_interfaces_model['type'] = 'enum'
+ instance_profile_disk_supported_interfaces_model['values'] = ['nvme']
- # Verify the model instances are equivalent
- assert instance_group_manager_action_reference_model == instance_group_manager_action_reference_model2
+ instance_profile_disk_model = {} # InstanceProfileDisk
+ instance_profile_disk_model['quantity'] = instance_profile_disk_quantity_model
+ instance_profile_disk_model['size'] = instance_profile_disk_size_model
+ instance_profile_disk_model['supported_interface_types'] = instance_profile_disk_supported_interfaces_model
- # Convert model instance back to dict and verify no loss of data
- instance_group_manager_action_reference_model_json2 = instance_group_manager_action_reference_model.to_dict()
- assert instance_group_manager_action_reference_model_json2 == instance_group_manager_action_reference_model_json
+ instance_profile_gpu_model = {} # InstanceProfileGPUFixed
+ instance_profile_gpu_model['type'] = 'fixed'
+ instance_profile_gpu_model['value'] = 2
-class TestModel_InstanceGroupManagerActionReferenceDeleted():
- """
- Test Class for InstanceGroupManagerActionReferenceDeleted
- """
+ instance_profile_gpu_manufacturer_model = {} # InstanceProfileGPUManufacturer
+ instance_profile_gpu_manufacturer_model['type'] = 'enum'
+ instance_profile_gpu_manufacturer_model['values'] = ['nvidia']
- def test_instance_group_manager_action_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupManagerActionReferenceDeleted
- """
+ instance_profile_gpu_memory_model = {} # InstanceProfileGPUMemoryFixed
+ instance_profile_gpu_memory_model['type'] = 'fixed'
+ instance_profile_gpu_memory_model['value'] = 16
- # Construct a json representation of a InstanceGroupManagerActionReferenceDeleted model
- instance_group_manager_action_reference_deleted_model_json = {}
- instance_group_manager_action_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_profile_gpu_model_model = {} # InstanceProfileGPUModel
+ instance_profile_gpu_model_model['type'] = 'enum'
+ instance_profile_gpu_model_model['values'] = ['Tesla V100']
- # Construct a model instance of InstanceGroupManagerActionReferenceDeleted by calling from_dict on the json representation
- instance_group_manager_action_reference_deleted_model = InstanceGroupManagerActionReferenceDeleted.from_dict(instance_group_manager_action_reference_deleted_model_json)
- assert instance_group_manager_action_reference_deleted_model != False
+ instance_profile_memory_model = {} # InstanceProfileMemoryFixed
+ instance_profile_memory_model['type'] = 'fixed'
+ instance_profile_memory_model['value'] = 16
- # Construct a model instance of InstanceGroupManagerActionReferenceDeleted by calling from_dict on the json representation
- instance_group_manager_action_reference_deleted_model_dict = InstanceGroupManagerActionReferenceDeleted.from_dict(instance_group_manager_action_reference_deleted_model_json).__dict__
- instance_group_manager_action_reference_deleted_model2 = InstanceGroupManagerActionReferenceDeleted(**instance_group_manager_action_reference_deleted_model_dict)
+ instance_profile_os_architecture_model = {} # InstanceProfileOSArchitecture
+ instance_profile_os_architecture_model['default'] = 'testString'
+ instance_profile_os_architecture_model['type'] = 'enum'
+ instance_profile_os_architecture_model['values'] = ['amd64']
+
+ instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed
+ instance_profile_port_speed_model['type'] = 'fixed'
+ instance_profile_port_speed_model['value'] = 1000
+
+ instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed
+ instance_profile_volume_bandwidth_model['type'] = 'fixed'
+ instance_profile_volume_bandwidth_model['value'] = 20000
+
+ instance_profile_vcpu_architecture_model = {} # InstanceProfileVCPUArchitecture
+ instance_profile_vcpu_architecture_model['default'] = 'testString'
+ instance_profile_vcpu_architecture_model['type'] = 'fixed'
+ instance_profile_vcpu_architecture_model['value'] = 'amd64'
+
+ instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed
+ instance_profile_vcpu_model['type'] = 'fixed'
+ instance_profile_vcpu_model['value'] = 16
+
+ # Construct a json representation of a InstanceProfile model
+ instance_profile_model_json = {}
+ instance_profile_model_json['bandwidth'] = instance_profile_bandwidth_model
+ instance_profile_model_json['disks'] = [instance_profile_disk_model]
+ instance_profile_model_json['family'] = 'balanced'
+ instance_profile_model_json['gpu_count'] = instance_profile_gpu_model
+ instance_profile_model_json['gpu_manufacturer'] = instance_profile_gpu_manufacturer_model
+ instance_profile_model_json['gpu_memory'] = instance_profile_gpu_memory_model
+ instance_profile_model_json['gpu_model'] = instance_profile_gpu_model_model
+ instance_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
+ instance_profile_model_json['memory'] = instance_profile_memory_model
+ instance_profile_model_json['name'] = 'bc1-4x16'
+ instance_profile_model_json['os_architecture'] = instance_profile_os_architecture_model
+ instance_profile_model_json['port_speed'] = instance_profile_port_speed_model
+ instance_profile_model_json['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model
+ instance_profile_model_json['vcpu_architecture'] = instance_profile_vcpu_architecture_model
+ instance_profile_model_json['vcpu_count'] = instance_profile_vcpu_model
+
+ # Construct a model instance of InstanceProfile by calling from_dict on the json representation
+ instance_profile_model = InstanceProfile.from_dict(instance_profile_model_json)
+ assert instance_profile_model != False
+
+ # Construct a model instance of InstanceProfile by calling from_dict on the json representation
+ instance_profile_model_dict = InstanceProfile.from_dict(instance_profile_model_json).__dict__
+ instance_profile_model2 = InstanceProfile(**instance_profile_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_action_reference_deleted_model == instance_group_manager_action_reference_deleted_model2
+ assert instance_profile_model == instance_profile_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_action_reference_deleted_model_json2 = instance_group_manager_action_reference_deleted_model.to_dict()
- assert instance_group_manager_action_reference_deleted_model_json2 == instance_group_manager_action_reference_deleted_model_json
+ instance_profile_model_json2 = instance_profile_model.to_dict()
+ assert instance_profile_model_json2 == instance_profile_model_json
-class TestModel_InstanceGroupManagerActionsCollection():
+class TestModel_InstanceProfileCollection():
"""
- Test Class for InstanceGroupManagerActionsCollection
+ Test Class for InstanceProfileCollection
"""
- def test_instance_group_manager_actions_collection_serialization(self):
+ def test_instance_profile_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionsCollection
+ Test serialization/deserialization for InstanceProfileCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_group_manager_scheduled_action_group_model = {} # InstanceGroupManagerScheduledActionGroup
- instance_group_manager_scheduled_action_group_model['membership_count'] = 10
+ instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed
+ instance_profile_bandwidth_model['type'] = 'fixed'
+ instance_profile_bandwidth_model['value'] = 20000
- instance_group_manager_action_model = {} # InstanceGroupManagerActionScheduledActionGroupTarget
- instance_group_manager_action_model['auto_delete'] = True
- instance_group_manager_action_model['auto_delete_timeout'] = 24
- instance_group_manager_action_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_group_manager_action_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_action_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_action_model['name'] = 'my-instance-group-manager-action'
- instance_group_manager_action_model['resource_type'] = 'instance_group_manager_action'
- instance_group_manager_action_model['status'] = 'active'
- instance_group_manager_action_model['updated_at'] = "2019-01-01T12:00:00Z"
- instance_group_manager_action_model['action_type'] = 'scheduled'
- instance_group_manager_action_model['cron_spec'] = '*/5 1,2,3 * * *'
- instance_group_manager_action_model['last_applied_at'] = "2019-01-01T12:00:00Z"
- instance_group_manager_action_model['next_run_at'] = "2019-01-01T12:00:00Z"
- instance_group_manager_action_model['group'] = instance_group_manager_scheduled_action_group_model
+ instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed
+ instance_profile_disk_quantity_model['type'] = 'fixed'
+ instance_profile_disk_quantity_model['value'] = 4
- instance_group_manager_actions_collection_first_model = {} # InstanceGroupManagerActionsCollectionFirst
- instance_group_manager_actions_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20'
+ instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed
+ instance_profile_disk_size_model['type'] = 'fixed'
+ instance_profile_disk_size_model['value'] = 100
- instance_group_manager_actions_collection_next_model = {} # InstanceGroupManagerActionsCollectionNext
- instance_group_manager_actions_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ instance_profile_disk_supported_interfaces_model = {} # InstanceProfileDiskSupportedInterfaces
+ instance_profile_disk_supported_interfaces_model['default'] = 'nvme'
+ instance_profile_disk_supported_interfaces_model['type'] = 'enum'
+ instance_profile_disk_supported_interfaces_model['values'] = ['nvme']
- # Construct a json representation of a InstanceGroupManagerActionsCollection model
- instance_group_manager_actions_collection_model_json = {}
- instance_group_manager_actions_collection_model_json['actions'] = [instance_group_manager_action_model]
- instance_group_manager_actions_collection_model_json['first'] = instance_group_manager_actions_collection_first_model
- instance_group_manager_actions_collection_model_json['limit'] = 20
- instance_group_manager_actions_collection_model_json['next'] = instance_group_manager_actions_collection_next_model
- instance_group_manager_actions_collection_model_json['total_count'] = 132
+ instance_profile_disk_model = {} # InstanceProfileDisk
+ instance_profile_disk_model['quantity'] = instance_profile_disk_quantity_model
+ instance_profile_disk_model['size'] = instance_profile_disk_size_model
+ instance_profile_disk_model['supported_interface_types'] = instance_profile_disk_supported_interfaces_model
- # Construct a model instance of InstanceGroupManagerActionsCollection by calling from_dict on the json representation
- instance_group_manager_actions_collection_model = InstanceGroupManagerActionsCollection.from_dict(instance_group_manager_actions_collection_model_json)
- assert instance_group_manager_actions_collection_model != False
+ instance_profile_gpu_model = {} # InstanceProfileGPUFixed
+ instance_profile_gpu_model['type'] = 'fixed'
+ instance_profile_gpu_model['value'] = 2
- # Construct a model instance of InstanceGroupManagerActionsCollection by calling from_dict on the json representation
- instance_group_manager_actions_collection_model_dict = InstanceGroupManagerActionsCollection.from_dict(instance_group_manager_actions_collection_model_json).__dict__
- instance_group_manager_actions_collection_model2 = InstanceGroupManagerActionsCollection(**instance_group_manager_actions_collection_model_dict)
+ instance_profile_gpu_manufacturer_model = {} # InstanceProfileGPUManufacturer
+ instance_profile_gpu_manufacturer_model['type'] = 'enum'
+ instance_profile_gpu_manufacturer_model['values'] = ['nvidia']
+
+ instance_profile_gpu_memory_model = {} # InstanceProfileGPUMemoryFixed
+ instance_profile_gpu_memory_model['type'] = 'fixed'
+ instance_profile_gpu_memory_model['value'] = 16
+
+ instance_profile_gpu_model_model = {} # InstanceProfileGPUModel
+ instance_profile_gpu_model_model['type'] = 'enum'
+ instance_profile_gpu_model_model['values'] = ['Tesla V100']
+
+ instance_profile_memory_model = {} # InstanceProfileMemoryFixed
+ instance_profile_memory_model['type'] = 'fixed'
+ instance_profile_memory_model['value'] = 16
+
+ instance_profile_os_architecture_model = {} # InstanceProfileOSArchitecture
+ instance_profile_os_architecture_model['default'] = 'testString'
+ instance_profile_os_architecture_model['type'] = 'enum'
+ instance_profile_os_architecture_model['values'] = ['amd64']
+
+ instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed
+ instance_profile_port_speed_model['type'] = 'fixed'
+ instance_profile_port_speed_model['value'] = 1000
+
+ instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed
+ instance_profile_volume_bandwidth_model['type'] = 'fixed'
+ instance_profile_volume_bandwidth_model['value'] = 20000
+
+ instance_profile_vcpu_architecture_model = {} # InstanceProfileVCPUArchitecture
+ instance_profile_vcpu_architecture_model['default'] = 'testString'
+ instance_profile_vcpu_architecture_model['type'] = 'fixed'
+ instance_profile_vcpu_architecture_model['value'] = 'amd64'
+
+ instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed
+ instance_profile_vcpu_model['type'] = 'fixed'
+ instance_profile_vcpu_model['value'] = 16
+
+ instance_profile_model = {} # InstanceProfile
+ instance_profile_model['bandwidth'] = instance_profile_bandwidth_model
+ instance_profile_model['disks'] = [instance_profile_disk_model]
+ instance_profile_model['family'] = 'balanced'
+ instance_profile_model['gpu_count'] = instance_profile_gpu_model
+ instance_profile_model['gpu_manufacturer'] = instance_profile_gpu_manufacturer_model
+ instance_profile_model['gpu_memory'] = instance_profile_gpu_memory_model
+ instance_profile_model['gpu_model'] = instance_profile_gpu_model_model
+ instance_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
+ instance_profile_model['memory'] = instance_profile_memory_model
+ instance_profile_model['name'] = 'bc1-4x16'
+ instance_profile_model['os_architecture'] = instance_profile_os_architecture_model
+ instance_profile_model['port_speed'] = instance_profile_port_speed_model
+ instance_profile_model['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model
+ instance_profile_model['vcpu_architecture'] = instance_profile_vcpu_architecture_model
+ instance_profile_model['vcpu_count'] = instance_profile_vcpu_model
+
+ # Construct a json representation of a InstanceProfileCollection model
+ instance_profile_collection_model_json = {}
+ instance_profile_collection_model_json['profiles'] = [instance_profile_model]
+
+ # Construct a model instance of InstanceProfileCollection by calling from_dict on the json representation
+ instance_profile_collection_model = InstanceProfileCollection.from_dict(instance_profile_collection_model_json)
+ assert instance_profile_collection_model != False
+
+ # Construct a model instance of InstanceProfileCollection by calling from_dict on the json representation
+ instance_profile_collection_model_dict = InstanceProfileCollection.from_dict(instance_profile_collection_model_json).__dict__
+ instance_profile_collection_model2 = InstanceProfileCollection(**instance_profile_collection_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_actions_collection_model == instance_group_manager_actions_collection_model2
+ assert instance_profile_collection_model == instance_profile_collection_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_actions_collection_model_json2 = instance_group_manager_actions_collection_model.to_dict()
- assert instance_group_manager_actions_collection_model_json2 == instance_group_manager_actions_collection_model_json
+ instance_profile_collection_model_json2 = instance_profile_collection_model.to_dict()
+ assert instance_profile_collection_model_json2 == instance_profile_collection_model_json
-class TestModel_InstanceGroupManagerActionsCollectionFirst():
+class TestModel_InstanceProfileDisk():
"""
- Test Class for InstanceGroupManagerActionsCollectionFirst
+ Test Class for InstanceProfileDisk
"""
- def test_instance_group_manager_actions_collection_first_serialization(self):
+ def test_instance_profile_disk_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionsCollectionFirst
+ Test serialization/deserialization for InstanceProfileDisk
"""
- # Construct a json representation of a InstanceGroupManagerActionsCollectionFirst model
- instance_group_manager_actions_collection_first_model_json = {}
- instance_group_manager_actions_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceGroupManagerActionsCollectionFirst by calling from_dict on the json representation
- instance_group_manager_actions_collection_first_model = InstanceGroupManagerActionsCollectionFirst.from_dict(instance_group_manager_actions_collection_first_model_json)
- assert instance_group_manager_actions_collection_first_model != False
+ instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed
+ instance_profile_disk_quantity_model['type'] = 'fixed'
+ instance_profile_disk_quantity_model['value'] = 4
- # Construct a model instance of InstanceGroupManagerActionsCollectionFirst by calling from_dict on the json representation
- instance_group_manager_actions_collection_first_model_dict = InstanceGroupManagerActionsCollectionFirst.from_dict(instance_group_manager_actions_collection_first_model_json).__dict__
- instance_group_manager_actions_collection_first_model2 = InstanceGroupManagerActionsCollectionFirst(**instance_group_manager_actions_collection_first_model_dict)
+ instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed
+ instance_profile_disk_size_model['type'] = 'fixed'
+ instance_profile_disk_size_model['value'] = 100
+
+ instance_profile_disk_supported_interfaces_model = {} # InstanceProfileDiskSupportedInterfaces
+ instance_profile_disk_supported_interfaces_model['default'] = 'nvme'
+ instance_profile_disk_supported_interfaces_model['type'] = 'enum'
+ instance_profile_disk_supported_interfaces_model['values'] = ['nvme']
+
+ # Construct a json representation of a InstanceProfileDisk model
+ instance_profile_disk_model_json = {}
+ instance_profile_disk_model_json['quantity'] = instance_profile_disk_quantity_model
+ instance_profile_disk_model_json['size'] = instance_profile_disk_size_model
+ instance_profile_disk_model_json['supported_interface_types'] = instance_profile_disk_supported_interfaces_model
+
+ # Construct a model instance of InstanceProfileDisk by calling from_dict on the json representation
+ instance_profile_disk_model = InstanceProfileDisk.from_dict(instance_profile_disk_model_json)
+ assert instance_profile_disk_model != False
+
+ # Construct a model instance of InstanceProfileDisk by calling from_dict on the json representation
+ instance_profile_disk_model_dict = InstanceProfileDisk.from_dict(instance_profile_disk_model_json).__dict__
+ instance_profile_disk_model2 = InstanceProfileDisk(**instance_profile_disk_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_actions_collection_first_model == instance_group_manager_actions_collection_first_model2
+ assert instance_profile_disk_model == instance_profile_disk_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_actions_collection_first_model_json2 = instance_group_manager_actions_collection_first_model.to_dict()
- assert instance_group_manager_actions_collection_first_model_json2 == instance_group_manager_actions_collection_first_model_json
+ instance_profile_disk_model_json2 = instance_profile_disk_model.to_dict()
+ assert instance_profile_disk_model_json2 == instance_profile_disk_model_json
-class TestModel_InstanceGroupManagerActionsCollectionNext():
+class TestModel_InstanceProfileDiskSupportedInterfaces():
"""
- Test Class for InstanceGroupManagerActionsCollectionNext
+ Test Class for InstanceProfileDiskSupportedInterfaces
"""
- def test_instance_group_manager_actions_collection_next_serialization(self):
+ def test_instance_profile_disk_supported_interfaces_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerActionsCollectionNext
+ Test serialization/deserialization for InstanceProfileDiskSupportedInterfaces
"""
- # Construct a json representation of a InstanceGroupManagerActionsCollectionNext model
- instance_group_manager_actions_collection_next_model_json = {}
- instance_group_manager_actions_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/actions?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a InstanceProfileDiskSupportedInterfaces model
+ instance_profile_disk_supported_interfaces_model_json = {}
+ instance_profile_disk_supported_interfaces_model_json['default'] = 'nvme'
+ instance_profile_disk_supported_interfaces_model_json['type'] = 'enum'
+ instance_profile_disk_supported_interfaces_model_json['values'] = ['nvme']
- # Construct a model instance of InstanceGroupManagerActionsCollectionNext by calling from_dict on the json representation
- instance_group_manager_actions_collection_next_model = InstanceGroupManagerActionsCollectionNext.from_dict(instance_group_manager_actions_collection_next_model_json)
- assert instance_group_manager_actions_collection_next_model != False
+ # Construct a model instance of InstanceProfileDiskSupportedInterfaces by calling from_dict on the json representation
+ instance_profile_disk_supported_interfaces_model = InstanceProfileDiskSupportedInterfaces.from_dict(instance_profile_disk_supported_interfaces_model_json)
+ assert instance_profile_disk_supported_interfaces_model != False
- # Construct a model instance of InstanceGroupManagerActionsCollectionNext by calling from_dict on the json representation
- instance_group_manager_actions_collection_next_model_dict = InstanceGroupManagerActionsCollectionNext.from_dict(instance_group_manager_actions_collection_next_model_json).__dict__
- instance_group_manager_actions_collection_next_model2 = InstanceGroupManagerActionsCollectionNext(**instance_group_manager_actions_collection_next_model_dict)
+ # Construct a model instance of InstanceProfileDiskSupportedInterfaces by calling from_dict on the json representation
+ instance_profile_disk_supported_interfaces_model_dict = InstanceProfileDiskSupportedInterfaces.from_dict(instance_profile_disk_supported_interfaces_model_json).__dict__
+ instance_profile_disk_supported_interfaces_model2 = InstanceProfileDiskSupportedInterfaces(**instance_profile_disk_supported_interfaces_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_actions_collection_next_model == instance_group_manager_actions_collection_next_model2
+ assert instance_profile_disk_supported_interfaces_model == instance_profile_disk_supported_interfaces_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_actions_collection_next_model_json2 = instance_group_manager_actions_collection_next_model.to_dict()
- assert instance_group_manager_actions_collection_next_model_json2 == instance_group_manager_actions_collection_next_model_json
+ instance_profile_disk_supported_interfaces_model_json2 = instance_profile_disk_supported_interfaces_model.to_dict()
+ assert instance_profile_disk_supported_interfaces_model_json2 == instance_profile_disk_supported_interfaces_model_json
-class TestModel_InstanceGroupManagerCollection():
+class TestModel_InstanceProfileGPUManufacturer():
"""
- Test Class for InstanceGroupManagerCollection
+ Test Class for InstanceProfileGPUManufacturer
"""
- def test_instance_group_manager_collection_serialization(self):
+ def test_instance_profile_gpu_manufacturer_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerCollection
+ Test serialization/deserialization for InstanceProfileGPUManufacturer
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_group_manager_collection_first_model = {} # InstanceGroupManagerCollectionFirst
- instance_group_manager_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20'
-
- instance_group_manager_policy_reference_deleted_model = {} # InstanceGroupManagerPolicyReferenceDeleted
- instance_group_manager_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- instance_group_manager_policy_reference_model = {} # InstanceGroupManagerPolicyReference
- instance_group_manager_policy_reference_model['deleted'] = instance_group_manager_policy_reference_deleted_model
- instance_group_manager_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_policy_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_policy_reference_model['name'] = 'my-instance-group-manager-policy'
-
- instance_group_manager_model = {} # InstanceGroupManagerAutoScale
- instance_group_manager_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_group_manager_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- instance_group_manager_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_model['management_enabled'] = True
- instance_group_manager_model['name'] = 'my-instance-group-manager'
- instance_group_manager_model['updated_at'] = "2019-01-01T12:00:00Z"
- instance_group_manager_model['aggregation_window'] = 120
- instance_group_manager_model['cooldown'] = 210
- instance_group_manager_model['manager_type'] = 'autoscale'
- instance_group_manager_model['max_membership_count'] = 10
- instance_group_manager_model['min_membership_count'] = 10
- instance_group_manager_model['policies'] = [instance_group_manager_policy_reference_model]
-
- instance_group_manager_collection_next_model = {} # InstanceGroupManagerCollectionNext
- instance_group_manager_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- # Construct a json representation of a InstanceGroupManagerCollection model
- instance_group_manager_collection_model_json = {}
- instance_group_manager_collection_model_json['first'] = instance_group_manager_collection_first_model
- instance_group_manager_collection_model_json['limit'] = 20
- instance_group_manager_collection_model_json['managers'] = [instance_group_manager_model]
- instance_group_manager_collection_model_json['next'] = instance_group_manager_collection_next_model
- instance_group_manager_collection_model_json['total_count'] = 132
+ # Construct a json representation of a InstanceProfileGPUManufacturer model
+ instance_profile_gpu_manufacturer_model_json = {}
+ instance_profile_gpu_manufacturer_model_json['type'] = 'enum'
+ instance_profile_gpu_manufacturer_model_json['values'] = ['nvidia']
- # Construct a model instance of InstanceGroupManagerCollection by calling from_dict on the json representation
- instance_group_manager_collection_model = InstanceGroupManagerCollection.from_dict(instance_group_manager_collection_model_json)
- assert instance_group_manager_collection_model != False
+ # Construct a model instance of InstanceProfileGPUManufacturer by calling from_dict on the json representation
+ instance_profile_gpu_manufacturer_model = InstanceProfileGPUManufacturer.from_dict(instance_profile_gpu_manufacturer_model_json)
+ assert instance_profile_gpu_manufacturer_model != False
- # Construct a model instance of InstanceGroupManagerCollection by calling from_dict on the json representation
- instance_group_manager_collection_model_dict = InstanceGroupManagerCollection.from_dict(instance_group_manager_collection_model_json).__dict__
- instance_group_manager_collection_model2 = InstanceGroupManagerCollection(**instance_group_manager_collection_model_dict)
+ # Construct a model instance of InstanceProfileGPUManufacturer by calling from_dict on the json representation
+ instance_profile_gpu_manufacturer_model_dict = InstanceProfileGPUManufacturer.from_dict(instance_profile_gpu_manufacturer_model_json).__dict__
+ instance_profile_gpu_manufacturer_model2 = InstanceProfileGPUManufacturer(**instance_profile_gpu_manufacturer_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_collection_model == instance_group_manager_collection_model2
+ assert instance_profile_gpu_manufacturer_model == instance_profile_gpu_manufacturer_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_collection_model_json2 = instance_group_manager_collection_model.to_dict()
- assert instance_group_manager_collection_model_json2 == instance_group_manager_collection_model_json
+ instance_profile_gpu_manufacturer_model_json2 = instance_profile_gpu_manufacturer_model.to_dict()
+ assert instance_profile_gpu_manufacturer_model_json2 == instance_profile_gpu_manufacturer_model_json
-class TestModel_InstanceGroupManagerCollectionFirst():
+class TestModel_InstanceProfileGPUModel():
"""
- Test Class for InstanceGroupManagerCollectionFirst
+ Test Class for InstanceProfileGPUModel
"""
- def test_instance_group_manager_collection_first_serialization(self):
+ def test_instance_profile_gpu_model_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerCollectionFirst
+ Test serialization/deserialization for InstanceProfileGPUModel
"""
- # Construct a json representation of a InstanceGroupManagerCollectionFirst model
- instance_group_manager_collection_first_model_json = {}
- instance_group_manager_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?limit=20'
+ # Construct a json representation of a InstanceProfileGPUModel model
+ instance_profile_gpu_model_model_json = {}
+ instance_profile_gpu_model_model_json['type'] = 'enum'
+ instance_profile_gpu_model_model_json['values'] = ['Tesla V100']
- # Construct a model instance of InstanceGroupManagerCollectionFirst by calling from_dict on the json representation
- instance_group_manager_collection_first_model = InstanceGroupManagerCollectionFirst.from_dict(instance_group_manager_collection_first_model_json)
- assert instance_group_manager_collection_first_model != False
+ # Construct a model instance of InstanceProfileGPUModel by calling from_dict on the json representation
+ instance_profile_gpu_model_model = InstanceProfileGPUModel.from_dict(instance_profile_gpu_model_model_json)
+ assert instance_profile_gpu_model_model != False
- # Construct a model instance of InstanceGroupManagerCollectionFirst by calling from_dict on the json representation
- instance_group_manager_collection_first_model_dict = InstanceGroupManagerCollectionFirst.from_dict(instance_group_manager_collection_first_model_json).__dict__
- instance_group_manager_collection_first_model2 = InstanceGroupManagerCollectionFirst(**instance_group_manager_collection_first_model_dict)
+ # Construct a model instance of InstanceProfileGPUModel by calling from_dict on the json representation
+ instance_profile_gpu_model_model_dict = InstanceProfileGPUModel.from_dict(instance_profile_gpu_model_model_json).__dict__
+ instance_profile_gpu_model_model2 = InstanceProfileGPUModel(**instance_profile_gpu_model_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_collection_first_model == instance_group_manager_collection_first_model2
+ assert instance_profile_gpu_model_model == instance_profile_gpu_model_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_collection_first_model_json2 = instance_group_manager_collection_first_model.to_dict()
- assert instance_group_manager_collection_first_model_json2 == instance_group_manager_collection_first_model_json
+ instance_profile_gpu_model_model_json2 = instance_profile_gpu_model_model.to_dict()
+ assert instance_profile_gpu_model_model_json2 == instance_profile_gpu_model_model_json
-class TestModel_InstanceGroupManagerCollectionNext():
+class TestModel_InstanceProfileOSArchitecture():
"""
- Test Class for InstanceGroupManagerCollectionNext
+ Test Class for InstanceProfileOSArchitecture
"""
- def test_instance_group_manager_collection_next_serialization(self):
+ def test_instance_profile_os_architecture_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerCollectionNext
+ Test serialization/deserialization for InstanceProfileOSArchitecture
"""
- # Construct a json representation of a InstanceGroupManagerCollectionNext model
- instance_group_manager_collection_next_model_json = {}
- instance_group_manager_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a InstanceProfileOSArchitecture model
+ instance_profile_os_architecture_model_json = {}
+ instance_profile_os_architecture_model_json['default'] = 'testString'
+ instance_profile_os_architecture_model_json['type'] = 'enum'
+ instance_profile_os_architecture_model_json['values'] = ['amd64']
- # Construct a model instance of InstanceGroupManagerCollectionNext by calling from_dict on the json representation
- instance_group_manager_collection_next_model = InstanceGroupManagerCollectionNext.from_dict(instance_group_manager_collection_next_model_json)
- assert instance_group_manager_collection_next_model != False
+ # Construct a model instance of InstanceProfileOSArchitecture by calling from_dict on the json representation
+ instance_profile_os_architecture_model = InstanceProfileOSArchitecture.from_dict(instance_profile_os_architecture_model_json)
+ assert instance_profile_os_architecture_model != False
- # Construct a model instance of InstanceGroupManagerCollectionNext by calling from_dict on the json representation
- instance_group_manager_collection_next_model_dict = InstanceGroupManagerCollectionNext.from_dict(instance_group_manager_collection_next_model_json).__dict__
- instance_group_manager_collection_next_model2 = InstanceGroupManagerCollectionNext(**instance_group_manager_collection_next_model_dict)
+ # Construct a model instance of InstanceProfileOSArchitecture by calling from_dict on the json representation
+ instance_profile_os_architecture_model_dict = InstanceProfileOSArchitecture.from_dict(instance_profile_os_architecture_model_json).__dict__
+ instance_profile_os_architecture_model2 = InstanceProfileOSArchitecture(**instance_profile_os_architecture_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_collection_next_model == instance_group_manager_collection_next_model2
+ assert instance_profile_os_architecture_model == instance_profile_os_architecture_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_collection_next_model_json2 = instance_group_manager_collection_next_model.to_dict()
- assert instance_group_manager_collection_next_model_json2 == instance_group_manager_collection_next_model_json
+ instance_profile_os_architecture_model_json2 = instance_profile_os_architecture_model.to_dict()
+ assert instance_profile_os_architecture_model_json2 == instance_profile_os_architecture_model_json
-class TestModel_InstanceGroupManagerPatch():
+class TestModel_InstanceProfileReference():
"""
- Test Class for InstanceGroupManagerPatch
+ Test Class for InstanceProfileReference
"""
- def test_instance_group_manager_patch_serialization(self):
+ def test_instance_profile_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPatch
+ Test serialization/deserialization for InstanceProfileReference
"""
- # Construct a json representation of a InstanceGroupManagerPatch model
- instance_group_manager_patch_model_json = {}
- instance_group_manager_patch_model_json['aggregation_window'] = 120
- instance_group_manager_patch_model_json['cooldown'] = 210
- instance_group_manager_patch_model_json['management_enabled'] = True
- instance_group_manager_patch_model_json['max_membership_count'] = 10
- instance_group_manager_patch_model_json['min_membership_count'] = 10
- instance_group_manager_patch_model_json['name'] = 'my-instance-group-manager'
+ # Construct a json representation of a InstanceProfileReference model
+ instance_profile_reference_model_json = {}
+ instance_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
+ instance_profile_reference_model_json['name'] = 'bc1-4x16'
- # Construct a model instance of InstanceGroupManagerPatch by calling from_dict on the json representation
- instance_group_manager_patch_model = InstanceGroupManagerPatch.from_dict(instance_group_manager_patch_model_json)
- assert instance_group_manager_patch_model != False
+ # Construct a model instance of InstanceProfileReference by calling from_dict on the json representation
+ instance_profile_reference_model = InstanceProfileReference.from_dict(instance_profile_reference_model_json)
+ assert instance_profile_reference_model != False
- # Construct a model instance of InstanceGroupManagerPatch by calling from_dict on the json representation
- instance_group_manager_patch_model_dict = InstanceGroupManagerPatch.from_dict(instance_group_manager_patch_model_json).__dict__
- instance_group_manager_patch_model2 = InstanceGroupManagerPatch(**instance_group_manager_patch_model_dict)
+ # Construct a model instance of InstanceProfileReference by calling from_dict on the json representation
+ instance_profile_reference_model_dict = InstanceProfileReference.from_dict(instance_profile_reference_model_json).__dict__
+ instance_profile_reference_model2 = InstanceProfileReference(**instance_profile_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_patch_model == instance_group_manager_patch_model2
+ assert instance_profile_reference_model == instance_profile_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_patch_model_json2 = instance_group_manager_patch_model.to_dict()
- assert instance_group_manager_patch_model_json2 == instance_group_manager_patch_model_json
+ instance_profile_reference_model_json2 = instance_profile_reference_model.to_dict()
+ assert instance_profile_reference_model_json2 == instance_profile_reference_model_json
-class TestModel_InstanceGroupManagerPolicyCollection():
+class TestModel_InstanceProfileVCPUArchitecture():
"""
- Test Class for InstanceGroupManagerPolicyCollection
+ Test Class for InstanceProfileVCPUArchitecture
"""
- def test_instance_group_manager_policy_collection_serialization(self):
+ def test_instance_profile_vcpu_architecture_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyCollection
+ Test serialization/deserialization for InstanceProfileVCPUArchitecture
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_group_manager_policy_collection_first_model = {} # InstanceGroupManagerPolicyCollectionFirst
- instance_group_manager_policy_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20'
-
- instance_group_manager_policy_collection_next_model = {} # InstanceGroupManagerPolicyCollectionNext
- instance_group_manager_policy_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- instance_group_manager_policy_model = {} # InstanceGroupManagerPolicyInstanceGroupManagerTargetPolicy
- instance_group_manager_policy_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_group_manager_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_policy_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_policy_model['name'] = 'my-instance-group-manager-policy'
- instance_group_manager_policy_model['updated_at'] = "2019-01-01T12:00:00Z"
- instance_group_manager_policy_model['metric_type'] = 'cpu'
- instance_group_manager_policy_model['metric_value'] = 38
- instance_group_manager_policy_model['policy_type'] = 'target'
-
- # Construct a json representation of a InstanceGroupManagerPolicyCollection model
- instance_group_manager_policy_collection_model_json = {}
- instance_group_manager_policy_collection_model_json['first'] = instance_group_manager_policy_collection_first_model
- instance_group_manager_policy_collection_model_json['limit'] = 20
- instance_group_manager_policy_collection_model_json['next'] = instance_group_manager_policy_collection_next_model
- instance_group_manager_policy_collection_model_json['policies'] = [instance_group_manager_policy_model]
- instance_group_manager_policy_collection_model_json['total_count'] = 132
+ # Construct a json representation of a InstanceProfileVCPUArchitecture model
+ instance_profile_vcpu_architecture_model_json = {}
+ instance_profile_vcpu_architecture_model_json['default'] = 'testString'
+ instance_profile_vcpu_architecture_model_json['type'] = 'fixed'
+ instance_profile_vcpu_architecture_model_json['value'] = 'amd64'
- # Construct a model instance of InstanceGroupManagerPolicyCollection by calling from_dict on the json representation
- instance_group_manager_policy_collection_model = InstanceGroupManagerPolicyCollection.from_dict(instance_group_manager_policy_collection_model_json)
- assert instance_group_manager_policy_collection_model != False
+ # Construct a model instance of InstanceProfileVCPUArchitecture by calling from_dict on the json representation
+ instance_profile_vcpu_architecture_model = InstanceProfileVCPUArchitecture.from_dict(instance_profile_vcpu_architecture_model_json)
+ assert instance_profile_vcpu_architecture_model != False
- # Construct a model instance of InstanceGroupManagerPolicyCollection by calling from_dict on the json representation
- instance_group_manager_policy_collection_model_dict = InstanceGroupManagerPolicyCollection.from_dict(instance_group_manager_policy_collection_model_json).__dict__
- instance_group_manager_policy_collection_model2 = InstanceGroupManagerPolicyCollection(**instance_group_manager_policy_collection_model_dict)
+ # Construct a model instance of InstanceProfileVCPUArchitecture by calling from_dict on the json representation
+ instance_profile_vcpu_architecture_model_dict = InstanceProfileVCPUArchitecture.from_dict(instance_profile_vcpu_architecture_model_json).__dict__
+ instance_profile_vcpu_architecture_model2 = InstanceProfileVCPUArchitecture(**instance_profile_vcpu_architecture_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_policy_collection_model == instance_group_manager_policy_collection_model2
+ assert instance_profile_vcpu_architecture_model == instance_profile_vcpu_architecture_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_policy_collection_model_json2 = instance_group_manager_policy_collection_model.to_dict()
- assert instance_group_manager_policy_collection_model_json2 == instance_group_manager_policy_collection_model_json
+ instance_profile_vcpu_architecture_model_json2 = instance_profile_vcpu_architecture_model.to_dict()
+ assert instance_profile_vcpu_architecture_model_json2 == instance_profile_vcpu_architecture_model_json
-class TestModel_InstanceGroupManagerPolicyCollectionFirst():
+class TestModel_InstanceReference():
"""
- Test Class for InstanceGroupManagerPolicyCollectionFirst
+ Test Class for InstanceReference
"""
- def test_instance_group_manager_policy_collection_first_serialization(self):
+ def test_instance_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyCollectionFirst
+ Test serialization/deserialization for InstanceReference
"""
- # Construct a json representation of a InstanceGroupManagerPolicyCollectionFirst model
- instance_group_manager_policy_collection_first_model_json = {}
- instance_group_manager_policy_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceGroupManagerPolicyCollectionFirst by calling from_dict on the json representation
- instance_group_manager_policy_collection_first_model = InstanceGroupManagerPolicyCollectionFirst.from_dict(instance_group_manager_policy_collection_first_model_json)
- assert instance_group_manager_policy_collection_first_model != False
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceGroupManagerPolicyCollectionFirst by calling from_dict on the json representation
- instance_group_manager_policy_collection_first_model_dict = InstanceGroupManagerPolicyCollectionFirst.from_dict(instance_group_manager_policy_collection_first_model_json).__dict__
- instance_group_manager_policy_collection_first_model2 = InstanceGroupManagerPolicyCollectionFirst(**instance_group_manager_policy_collection_first_model_dict)
+ # Construct a json representation of a InstanceReference model
+ instance_reference_model_json = {}
+ instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model_json['deleted'] = instance_reference_deleted_model
+ instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model_json['name'] = 'my-instance'
+
+ # Construct a model instance of InstanceReference by calling from_dict on the json representation
+ instance_reference_model = InstanceReference.from_dict(instance_reference_model_json)
+ assert instance_reference_model != False
+
+ # Construct a model instance of InstanceReference by calling from_dict on the json representation
+ instance_reference_model_dict = InstanceReference.from_dict(instance_reference_model_json).__dict__
+ instance_reference_model2 = InstanceReference(**instance_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_policy_collection_first_model == instance_group_manager_policy_collection_first_model2
+ assert instance_reference_model == instance_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_policy_collection_first_model_json2 = instance_group_manager_policy_collection_first_model.to_dict()
- assert instance_group_manager_policy_collection_first_model_json2 == instance_group_manager_policy_collection_first_model_json
+ instance_reference_model_json2 = instance_reference_model.to_dict()
+ assert instance_reference_model_json2 == instance_reference_model_json
-class TestModel_InstanceGroupManagerPolicyCollectionNext():
+class TestModel_InstanceReferenceDeleted():
"""
- Test Class for InstanceGroupManagerPolicyCollectionNext
+ Test Class for InstanceReferenceDeleted
"""
- def test_instance_group_manager_policy_collection_next_serialization(self):
+ def test_instance_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyCollectionNext
+ Test serialization/deserialization for InstanceReferenceDeleted
"""
- # Construct a json representation of a InstanceGroupManagerPolicyCollectionNext model
- instance_group_manager_policy_collection_next_model_json = {}
- instance_group_manager_policy_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a InstanceReferenceDeleted model
+ instance_reference_deleted_model_json = {}
+ instance_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceGroupManagerPolicyCollectionNext by calling from_dict on the json representation
- instance_group_manager_policy_collection_next_model = InstanceGroupManagerPolicyCollectionNext.from_dict(instance_group_manager_policy_collection_next_model_json)
- assert instance_group_manager_policy_collection_next_model != False
+ # Construct a model instance of InstanceReferenceDeleted by calling from_dict on the json representation
+ instance_reference_deleted_model = InstanceReferenceDeleted.from_dict(instance_reference_deleted_model_json)
+ assert instance_reference_deleted_model != False
- # Construct a model instance of InstanceGroupManagerPolicyCollectionNext by calling from_dict on the json representation
- instance_group_manager_policy_collection_next_model_dict = InstanceGroupManagerPolicyCollectionNext.from_dict(instance_group_manager_policy_collection_next_model_json).__dict__
- instance_group_manager_policy_collection_next_model2 = InstanceGroupManagerPolicyCollectionNext(**instance_group_manager_policy_collection_next_model_dict)
+ # Construct a model instance of InstanceReferenceDeleted by calling from_dict on the json representation
+ instance_reference_deleted_model_dict = InstanceReferenceDeleted.from_dict(instance_reference_deleted_model_json).__dict__
+ instance_reference_deleted_model2 = InstanceReferenceDeleted(**instance_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_policy_collection_next_model == instance_group_manager_policy_collection_next_model2
+ assert instance_reference_deleted_model == instance_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_policy_collection_next_model_json2 = instance_group_manager_policy_collection_next_model.to_dict()
- assert instance_group_manager_policy_collection_next_model_json2 == instance_group_manager_policy_collection_next_model_json
+ instance_reference_deleted_model_json2 = instance_reference_deleted_model.to_dict()
+ assert instance_reference_deleted_model_json2 == instance_reference_deleted_model_json
-class TestModel_InstanceGroupManagerPolicyPatch():
+class TestModel_InstanceStatusReason():
"""
- Test Class for InstanceGroupManagerPolicyPatch
+ Test Class for InstanceStatusReason
"""
- def test_instance_group_manager_policy_patch_serialization(self):
+ def test_instance_status_reason_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyPatch
+ Test serialization/deserialization for InstanceStatusReason
"""
- # Construct a json representation of a InstanceGroupManagerPolicyPatch model
- instance_group_manager_policy_patch_model_json = {}
- instance_group_manager_policy_patch_model_json['metric_type'] = 'cpu'
- instance_group_manager_policy_patch_model_json['metric_value'] = 38
- instance_group_manager_policy_patch_model_json['name'] = 'my-instance-group-manager-policy'
+ # Construct a json representation of a InstanceStatusReason model
+ instance_status_reason_model_json = {}
+ instance_status_reason_model_json['code'] = 'cannot_start_storage'
+ instance_status_reason_model_json['message'] = 'The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted'
+ instance_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
- # Construct a model instance of InstanceGroupManagerPolicyPatch by calling from_dict on the json representation
- instance_group_manager_policy_patch_model = InstanceGroupManagerPolicyPatch.from_dict(instance_group_manager_policy_patch_model_json)
- assert instance_group_manager_policy_patch_model != False
+ # Construct a model instance of InstanceStatusReason by calling from_dict on the json representation
+ instance_status_reason_model = InstanceStatusReason.from_dict(instance_status_reason_model_json)
+ assert instance_status_reason_model != False
- # Construct a model instance of InstanceGroupManagerPolicyPatch by calling from_dict on the json representation
- instance_group_manager_policy_patch_model_dict = InstanceGroupManagerPolicyPatch.from_dict(instance_group_manager_policy_patch_model_json).__dict__
- instance_group_manager_policy_patch_model2 = InstanceGroupManagerPolicyPatch(**instance_group_manager_policy_patch_model_dict)
+ # Construct a model instance of InstanceStatusReason by calling from_dict on the json representation
+ instance_status_reason_model_dict = InstanceStatusReason.from_dict(instance_status_reason_model_json).__dict__
+ instance_status_reason_model2 = InstanceStatusReason(**instance_status_reason_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_policy_patch_model == instance_group_manager_policy_patch_model2
+ assert instance_status_reason_model == instance_status_reason_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_policy_patch_model_json2 = instance_group_manager_policy_patch_model.to_dict()
- assert instance_group_manager_policy_patch_model_json2 == instance_group_manager_policy_patch_model_json
+ instance_status_reason_model_json2 = instance_status_reason_model.to_dict()
+ assert instance_status_reason_model_json2 == instance_status_reason_model_json
-class TestModel_InstanceGroupManagerPolicyReference():
+class TestModel_InstanceTemplateCollection():
"""
- Test Class for InstanceGroupManagerPolicyReference
+ Test Class for InstanceTemplateCollection
"""
- def test_instance_group_manager_policy_reference_serialization(self):
+ def test_instance_template_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerPolicyReference
+ Test serialization/deserialization for InstanceTemplateCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_group_manager_policy_reference_deleted_model = {} # InstanceGroupManagerPolicyReferenceDeleted
- instance_group_manager_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_template_collection_first_model = {} # InstanceTemplateCollectionFirst
+ instance_template_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20'
- # Construct a json representation of a InstanceGroupManagerPolicyReference model
- instance_group_manager_policy_reference_model_json = {}
- instance_group_manager_policy_reference_model_json['deleted'] = instance_group_manager_policy_reference_deleted_model
- instance_group_manager_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/managers/4c939b00-601f-11ea-bca2-000c29475bed/policies/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_policy_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_policy_reference_model_json['name'] = 'my-instance-group-manager-policy'
+ instance_template_collection_next_model = {} # InstanceTemplateCollectionNext
+ instance_template_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of InstanceGroupManagerPolicyReference by calling from_dict on the json representation
- instance_group_manager_policy_reference_model = InstanceGroupManagerPolicyReference.from_dict(instance_group_manager_policy_reference_model_json)
- assert instance_group_manager_policy_reference_model != False
+ key_identity_model = {} # KeyIdentityById
+ key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- # Construct a model instance of InstanceGroupManagerPolicyReference by calling from_dict on the json representation
- instance_group_manager_policy_reference_model_dict = InstanceGroupManagerPolicyReference.from_dict(instance_group_manager_policy_reference_model_json).__dict__
- instance_group_manager_policy_reference_model2 = InstanceGroupManagerPolicyReference(**instance_group_manager_policy_reference_model_dict)
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Verify the model instances are equivalent
- assert instance_group_manager_policy_reference_model == instance_group_manager_policy_reference_model2
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Convert model instance back to dict and verify no loss of data
- instance_group_manager_policy_reference_model_json2 = instance_group_manager_policy_reference_model.to_dict()
- assert instance_group_manager_policy_reference_model_json2 == instance_group_manager_policy_reference_model_json
+ network_interface_prototype_model = {} # NetworkInterfacePrototype
+ network_interface_prototype_model['allow_ip_spoofing'] = True
+ network_interface_prototype_model['name'] = 'my-network-interface'
+ network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5'
+ network_interface_prototype_model['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model['subnet'] = subnet_identity_model
-class TestModel_InstanceGroupManagerPolicyReferenceDeleted():
- """
- Test Class for InstanceGroupManagerPolicyReferenceDeleted
- """
+ instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
+ instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- def test_instance_group_manager_policy_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupManagerPolicyReferenceDeleted
- """
+ instance_profile_identity_model = {} # InstanceProfileIdentityByName
+ instance_profile_identity_model['name'] = 'cc1-16x32'
- # Construct a json representation of a InstanceGroupManagerPolicyReferenceDeleted model
- instance_group_manager_policy_reference_deleted_model_json = {}
- instance_group_manager_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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'
- # Construct a model instance of InstanceGroupManagerPolicyReferenceDeleted by calling from_dict on the json representation
- instance_group_manager_policy_reference_deleted_model = InstanceGroupManagerPolicyReferenceDeleted.from_dict(instance_group_manager_policy_reference_deleted_model_json)
- assert instance_group_manager_policy_reference_deleted_model != False
+ volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById
+ volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a model instance of InstanceGroupManagerPolicyReferenceDeleted by calling from_dict on the json representation
- instance_group_manager_policy_reference_deleted_model_dict = InstanceGroupManagerPolicyReferenceDeleted.from_dict(instance_group_manager_policy_reference_deleted_model_json).__dict__
- instance_group_manager_policy_reference_deleted_model2 = InstanceGroupManagerPolicyReferenceDeleted(**instance_group_manager_policy_reference_deleted_model_dict)
+ volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext
+ volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model
- # Verify the model instances are equivalent
- assert instance_group_manager_policy_reference_deleted_model == instance_group_manager_policy_reference_deleted_model2
+ vpc_identity_model = {} # VPCIdentityById
+ vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- # Convert model instance back to dict and verify no loss of data
- instance_group_manager_policy_reference_deleted_model_json2 = instance_group_manager_policy_reference_deleted_model.to_dict()
- assert instance_group_manager_policy_reference_deleted_model_json2 == instance_group_manager_policy_reference_deleted_model_json
+ 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'
-class TestModel_InstanceGroupManagerReference():
- """
- Test Class for InstanceGroupManagerReference
- """
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- def test_instance_group_manager_reference_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupManagerReference
- """
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 38
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- # Construct dict forms of any model objects needed in order to build this model.
+ volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext
+ volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model
- instance_group_manager_reference_deleted_model = {} # InstanceGroupManagerReferenceDeleted
- instance_group_manager_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ image_identity_model = {} # ImageIdentityById
+ image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- # Construct a json representation of a InstanceGroupManagerReference model
- instance_group_manager_reference_model_json = {}
- instance_group_manager_reference_model_json['deleted'] = instance_group_manager_reference_deleted_model
- instance_group_manager_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/managers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- instance_group_manager_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_manager_reference_model_json['name'] = 'my-instance-group-manager'
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ instance_template_model = {} # InstanceTemplateInstanceByImage
+ instance_template_model['created_at'] = "2019-01-01T12:00:00Z"
+ instance_template_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_model['keys'] = [key_identity_model]
+ instance_template_model['name'] = 'my-instance-template'
+ instance_template_model['network_interfaces'] = [network_interface_prototype_model]
+ instance_template_model['placement_target'] = instance_placement_target_prototype_model
+ instance_template_model['profile'] = instance_profile_identity_model
+ instance_template_model['resource_group'] = resource_group_reference_model
+ instance_template_model['total_volume_bandwidth'] = 500
+ instance_template_model['user_data'] = 'testString'
+ instance_template_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model]
+ instance_template_model['vpc'] = vpc_identity_model
+ instance_template_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
+ instance_template_model['image'] = image_identity_model
+ instance_template_model['primary_network_interface'] = network_interface_prototype_model
+ instance_template_model['zone'] = zone_identity_model
+
+ # Construct a json representation of a InstanceTemplateCollection model
+ instance_template_collection_model_json = {}
+ instance_template_collection_model_json['first'] = instance_template_collection_first_model
+ instance_template_collection_model_json['limit'] = 20
+ instance_template_collection_model_json['next'] = instance_template_collection_next_model
+ instance_template_collection_model_json['templates'] = [instance_template_model]
+ instance_template_collection_model_json['total_count'] = 132
- # Construct a model instance of InstanceGroupManagerReference by calling from_dict on the json representation
- instance_group_manager_reference_model = InstanceGroupManagerReference.from_dict(instance_group_manager_reference_model_json)
- assert instance_group_manager_reference_model != False
+ # Construct a model instance of InstanceTemplateCollection by calling from_dict on the json representation
+ instance_template_collection_model = InstanceTemplateCollection.from_dict(instance_template_collection_model_json)
+ assert instance_template_collection_model != False
- # Construct a model instance of InstanceGroupManagerReference by calling from_dict on the json representation
- instance_group_manager_reference_model_dict = InstanceGroupManagerReference.from_dict(instance_group_manager_reference_model_json).__dict__
- instance_group_manager_reference_model2 = InstanceGroupManagerReference(**instance_group_manager_reference_model_dict)
+ # Construct a model instance of InstanceTemplateCollection by calling from_dict on the json representation
+ instance_template_collection_model_dict = InstanceTemplateCollection.from_dict(instance_template_collection_model_json).__dict__
+ instance_template_collection_model2 = InstanceTemplateCollection(**instance_template_collection_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_reference_model == instance_group_manager_reference_model2
+ assert instance_template_collection_model == instance_template_collection_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_reference_model_json2 = instance_group_manager_reference_model.to_dict()
- assert instance_group_manager_reference_model_json2 == instance_group_manager_reference_model_json
+ instance_template_collection_model_json2 = instance_template_collection_model.to_dict()
+ assert instance_template_collection_model_json2 == instance_template_collection_model_json
-class TestModel_InstanceGroupManagerReferenceDeleted():
+class TestModel_InstanceTemplateCollectionFirst():
"""
- Test Class for InstanceGroupManagerReferenceDeleted
+ Test Class for InstanceTemplateCollectionFirst
"""
- def test_instance_group_manager_reference_deleted_serialization(self):
+ def test_instance_template_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerReferenceDeleted
+ Test serialization/deserialization for InstanceTemplateCollectionFirst
"""
- # Construct a json representation of a InstanceGroupManagerReferenceDeleted model
- instance_group_manager_reference_deleted_model_json = {}
- instance_group_manager_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a InstanceTemplateCollectionFirst model
+ instance_template_collection_first_model_json = {}
+ instance_template_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20'
- # Construct a model instance of InstanceGroupManagerReferenceDeleted by calling from_dict on the json representation
- instance_group_manager_reference_deleted_model = InstanceGroupManagerReferenceDeleted.from_dict(instance_group_manager_reference_deleted_model_json)
- assert instance_group_manager_reference_deleted_model != False
+ # Construct a model instance of InstanceTemplateCollectionFirst by calling from_dict on the json representation
+ instance_template_collection_first_model = InstanceTemplateCollectionFirst.from_dict(instance_template_collection_first_model_json)
+ assert instance_template_collection_first_model != False
- # Construct a model instance of InstanceGroupManagerReferenceDeleted by calling from_dict on the json representation
- instance_group_manager_reference_deleted_model_dict = InstanceGroupManagerReferenceDeleted.from_dict(instance_group_manager_reference_deleted_model_json).__dict__
- instance_group_manager_reference_deleted_model2 = InstanceGroupManagerReferenceDeleted(**instance_group_manager_reference_deleted_model_dict)
+ # Construct a model instance of InstanceTemplateCollectionFirst by calling from_dict on the json representation
+ instance_template_collection_first_model_dict = InstanceTemplateCollectionFirst.from_dict(instance_template_collection_first_model_json).__dict__
+ instance_template_collection_first_model2 = InstanceTemplateCollectionFirst(**instance_template_collection_first_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_reference_deleted_model == instance_group_manager_reference_deleted_model2
+ assert instance_template_collection_first_model == instance_template_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_reference_deleted_model_json2 = instance_group_manager_reference_deleted_model.to_dict()
- assert instance_group_manager_reference_deleted_model_json2 == instance_group_manager_reference_deleted_model_json
+ instance_template_collection_first_model_json2 = instance_template_collection_first_model.to_dict()
+ assert instance_template_collection_first_model_json2 == instance_template_collection_first_model_json
-class TestModel_InstanceGroupManagerScheduledActionGroup():
+class TestModel_InstanceTemplateCollectionNext():
"""
- Test Class for InstanceGroupManagerScheduledActionGroup
+ Test Class for InstanceTemplateCollectionNext
"""
- def test_instance_group_manager_scheduled_action_group_serialization(self):
+ def test_instance_template_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerScheduledActionGroup
+ Test serialization/deserialization for InstanceTemplateCollectionNext
"""
- # Construct a json representation of a InstanceGroupManagerScheduledActionGroup model
- instance_group_manager_scheduled_action_group_model_json = {}
- instance_group_manager_scheduled_action_group_model_json['membership_count'] = 10
+ # Construct a json representation of a InstanceTemplateCollectionNext model
+ instance_template_collection_next_model_json = {}
+ instance_template_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of InstanceGroupManagerScheduledActionGroup by calling from_dict on the json representation
- instance_group_manager_scheduled_action_group_model = InstanceGroupManagerScheduledActionGroup.from_dict(instance_group_manager_scheduled_action_group_model_json)
- assert instance_group_manager_scheduled_action_group_model != False
+ # Construct a model instance of InstanceTemplateCollectionNext by calling from_dict on the json representation
+ instance_template_collection_next_model = InstanceTemplateCollectionNext.from_dict(instance_template_collection_next_model_json)
+ assert instance_template_collection_next_model != False
- # Construct a model instance of InstanceGroupManagerScheduledActionGroup by calling from_dict on the json representation
- instance_group_manager_scheduled_action_group_model_dict = InstanceGroupManagerScheduledActionGroup.from_dict(instance_group_manager_scheduled_action_group_model_json).__dict__
- instance_group_manager_scheduled_action_group_model2 = InstanceGroupManagerScheduledActionGroup(**instance_group_manager_scheduled_action_group_model_dict)
+ # Construct a model instance of InstanceTemplateCollectionNext by calling from_dict on the json representation
+ instance_template_collection_next_model_dict = InstanceTemplateCollectionNext.from_dict(instance_template_collection_next_model_json).__dict__
+ instance_template_collection_next_model2 = InstanceTemplateCollectionNext(**instance_template_collection_next_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_scheduled_action_group_model == instance_group_manager_scheduled_action_group_model2
+ assert instance_template_collection_next_model == instance_template_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_scheduled_action_group_model_json2 = instance_group_manager_scheduled_action_group_model.to_dict()
- assert instance_group_manager_scheduled_action_group_model_json2 == instance_group_manager_scheduled_action_group_model_json
+ instance_template_collection_next_model_json2 = instance_template_collection_next_model.to_dict()
+ assert instance_template_collection_next_model_json2 == instance_template_collection_next_model_json
-class TestModel_InstanceGroupManagerScheduledActionGroupPrototype():
+class TestModel_InstanceTemplatePatch():
"""
- Test Class for InstanceGroupManagerScheduledActionGroupPrototype
+ Test Class for InstanceTemplatePatch
"""
- def test_instance_group_manager_scheduled_action_group_prototype_serialization(self):
+ def test_instance_template_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupManagerScheduledActionGroupPrototype
+ Test serialization/deserialization for InstanceTemplatePatch
"""
- # Construct a json representation of a InstanceGroupManagerScheduledActionGroupPrototype model
- instance_group_manager_scheduled_action_group_prototype_model_json = {}
- instance_group_manager_scheduled_action_group_prototype_model_json['membership_count'] = 10
+ # Construct a json representation of a InstanceTemplatePatch model
+ instance_template_patch_model_json = {}
+ instance_template_patch_model_json['name'] = 'my-instance-template'
- # Construct a model instance of InstanceGroupManagerScheduledActionGroupPrototype by calling from_dict on the json representation
- instance_group_manager_scheduled_action_group_prototype_model = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(instance_group_manager_scheduled_action_group_prototype_model_json)
- assert instance_group_manager_scheduled_action_group_prototype_model != False
+ # Construct a model instance of InstanceTemplatePatch by calling from_dict on the json representation
+ instance_template_patch_model = InstanceTemplatePatch.from_dict(instance_template_patch_model_json)
+ assert instance_template_patch_model != False
- # Construct a model instance of InstanceGroupManagerScheduledActionGroupPrototype by calling from_dict on the json representation
- instance_group_manager_scheduled_action_group_prototype_model_dict = InstanceGroupManagerScheduledActionGroupPrototype.from_dict(instance_group_manager_scheduled_action_group_prototype_model_json).__dict__
- instance_group_manager_scheduled_action_group_prototype_model2 = InstanceGroupManagerScheduledActionGroupPrototype(**instance_group_manager_scheduled_action_group_prototype_model_dict)
+ # Construct a model instance of InstanceTemplatePatch by calling from_dict on the json representation
+ instance_template_patch_model_dict = InstanceTemplatePatch.from_dict(instance_template_patch_model_json).__dict__
+ instance_template_patch_model2 = InstanceTemplatePatch(**instance_template_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_group_manager_scheduled_action_group_prototype_model == instance_group_manager_scheduled_action_group_prototype_model2
+ assert instance_template_patch_model == instance_template_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_manager_scheduled_action_group_prototype_model_json2 = instance_group_manager_scheduled_action_group_prototype_model.to_dict()
- assert instance_group_manager_scheduled_action_group_prototype_model_json2 == instance_group_manager_scheduled_action_group_prototype_model_json
+ instance_template_patch_model_json2 = instance_template_patch_model.to_dict()
+ assert instance_template_patch_model_json2 == instance_template_patch_model_json
-class TestModel_InstanceGroupMembership():
+class TestModel_InstanceTemplateReference():
"""
- Test Class for InstanceGroupMembership
+ Test Class for InstanceTemplateReference
"""
- def test_instance_group_membership_serialization(self):
+ def test_instance_template_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupMembership
+ Test serialization/deserialization for InstanceTemplateReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- instance_reference_model = {} # InstanceReference
- instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['deleted'] = instance_reference_deleted_model
- instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['name'] = 'my-instance'
-
instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_template_reference_model = {} # InstanceTemplateReference
- instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_reference_model['deleted'] = instance_template_reference_deleted_model
- instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- instance_template_reference_model['name'] = 'my-instance-template'
-
- load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
- load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference
- load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model
- load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a json representation of a InstanceGroupMembership model
- instance_group_membership_model_json = {}
- instance_group_membership_model_json['created_at'] = "2019-01-01T12:00:00Z"
- instance_group_membership_model_json['delete_instance_on_membership_delete'] = True
- instance_group_membership_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed'
- instance_group_membership_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_membership_model_json['instance'] = instance_reference_model
- instance_group_membership_model_json['instance_template'] = instance_template_reference_model
- instance_group_membership_model_json['name'] = 'my-instance-group-membership'
- instance_group_membership_model_json['pool_member'] = load_balancer_pool_member_reference_model
- instance_group_membership_model_json['status'] = 'deleting'
- instance_group_membership_model_json['updated_at'] = "2019-01-01T12:00:00Z"
+ # Construct a json representation of a InstanceTemplateReference model
+ instance_template_reference_model_json = {}
+ instance_template_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_reference_model_json['deleted'] = instance_template_reference_deleted_model
+ instance_template_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_template_reference_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ instance_template_reference_model_json['name'] = 'my-instance-template'
- # Construct a model instance of InstanceGroupMembership by calling from_dict on the json representation
- instance_group_membership_model = InstanceGroupMembership.from_dict(instance_group_membership_model_json)
- assert instance_group_membership_model != False
+ # Construct a model instance of InstanceTemplateReference by calling from_dict on the json representation
+ instance_template_reference_model = InstanceTemplateReference.from_dict(instance_template_reference_model_json)
+ assert instance_template_reference_model != False
- # Construct a model instance of InstanceGroupMembership by calling from_dict on the json representation
- instance_group_membership_model_dict = InstanceGroupMembership.from_dict(instance_group_membership_model_json).__dict__
- instance_group_membership_model2 = InstanceGroupMembership(**instance_group_membership_model_dict)
+ # Construct a model instance of InstanceTemplateReference by calling from_dict on the json representation
+ instance_template_reference_model_dict = InstanceTemplateReference.from_dict(instance_template_reference_model_json).__dict__
+ instance_template_reference_model2 = InstanceTemplateReference(**instance_template_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_group_membership_model == instance_group_membership_model2
+ assert instance_template_reference_model == instance_template_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_membership_model_json2 = instance_group_membership_model.to_dict()
- assert instance_group_membership_model_json2 == instance_group_membership_model_json
+ instance_template_reference_model_json2 = instance_template_reference_model.to_dict()
+ assert instance_template_reference_model_json2 == instance_template_reference_model_json
-class TestModel_InstanceGroupMembershipCollection():
+class TestModel_InstanceTemplateReferenceDeleted():
"""
- Test Class for InstanceGroupMembershipCollection
+ Test Class for InstanceTemplateReferenceDeleted
"""
- def test_instance_group_membership_collection_serialization(self):
+ def test_instance_template_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupMembershipCollection
+ Test serialization/deserialization for InstanceTemplateReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_group_membership_collection_first_model = {} # InstanceGroupMembershipCollectionFirst
- instance_group_membership_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20'
-
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- instance_reference_model = {} # InstanceReference
- instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['deleted'] = instance_reference_deleted_model
- instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['name'] = 'my-instance'
-
- instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
- instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- instance_template_reference_model = {} # InstanceTemplateReference
- instance_template_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_reference_model['deleted'] = instance_template_reference_deleted_model
- instance_template_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- instance_template_reference_model['name'] = 'my-instance-template'
-
- load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
- load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference
- load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model
- load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- instance_group_membership_model = {} # InstanceGroupMembership
- instance_group_membership_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_group_membership_model['delete_instance_on_membership_delete'] = True
- instance_group_membership_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a/memberships/8b002d86-601f-11ea-898b-000c29475bed'
- instance_group_membership_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_membership_model['instance'] = instance_reference_model
- instance_group_membership_model['instance_template'] = instance_template_reference_model
- instance_group_membership_model['name'] = 'my-instance-group-membership'
- instance_group_membership_model['pool_member'] = load_balancer_pool_member_reference_model
- instance_group_membership_model['status'] = 'deleting'
- instance_group_membership_model['updated_at'] = "2019-01-01T12:00:00Z"
-
- instance_group_membership_collection_next_model = {} # InstanceGroupMembershipCollectionNext
- instance_group_membership_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- # Construct a json representation of a InstanceGroupMembershipCollection model
- instance_group_membership_collection_model_json = {}
- instance_group_membership_collection_model_json['first'] = instance_group_membership_collection_first_model
- instance_group_membership_collection_model_json['limit'] = 20
- instance_group_membership_collection_model_json['memberships'] = [instance_group_membership_model]
- instance_group_membership_collection_model_json['next'] = instance_group_membership_collection_next_model
- instance_group_membership_collection_model_json['total_count'] = 132
+ # Construct a json representation of a InstanceTemplateReferenceDeleted model
+ instance_template_reference_deleted_model_json = {}
+ instance_template_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceGroupMembershipCollection by calling from_dict on the json representation
- instance_group_membership_collection_model = InstanceGroupMembershipCollection.from_dict(instance_group_membership_collection_model_json)
- assert instance_group_membership_collection_model != False
+ # Construct a model instance of InstanceTemplateReferenceDeleted by calling from_dict on the json representation
+ instance_template_reference_deleted_model = InstanceTemplateReferenceDeleted.from_dict(instance_template_reference_deleted_model_json)
+ assert instance_template_reference_deleted_model != False
- # Construct a model instance of InstanceGroupMembershipCollection by calling from_dict on the json representation
- instance_group_membership_collection_model_dict = InstanceGroupMembershipCollection.from_dict(instance_group_membership_collection_model_json).__dict__
- instance_group_membership_collection_model2 = InstanceGroupMembershipCollection(**instance_group_membership_collection_model_dict)
+ # Construct a model instance of InstanceTemplateReferenceDeleted by calling from_dict on the json representation
+ instance_template_reference_deleted_model_dict = InstanceTemplateReferenceDeleted.from_dict(instance_template_reference_deleted_model_json).__dict__
+ instance_template_reference_deleted_model2 = InstanceTemplateReferenceDeleted(**instance_template_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert instance_group_membership_collection_model == instance_group_membership_collection_model2
+ assert instance_template_reference_deleted_model == instance_template_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_membership_collection_model_json2 = instance_group_membership_collection_model.to_dict()
- assert instance_group_membership_collection_model_json2 == instance_group_membership_collection_model_json
+ instance_template_reference_deleted_model_json2 = instance_template_reference_deleted_model.to_dict()
+ assert instance_template_reference_deleted_model_json2 == instance_template_reference_deleted_model_json
-class TestModel_InstanceGroupMembershipCollectionFirst():
+class TestModel_InstanceVCPU():
"""
- Test Class for InstanceGroupMembershipCollectionFirst
+ Test Class for InstanceVCPU
"""
- def test_instance_group_membership_collection_first_serialization(self):
+ def test_instance_vcpu_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupMembershipCollectionFirst
+ Test serialization/deserialization for InstanceVCPU
"""
- # Construct a json representation of a InstanceGroupMembershipCollectionFirst model
- instance_group_membership_collection_first_model_json = {}
- instance_group_membership_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?limit=20'
+ # Construct a json representation of a InstanceVCPU model
+ instance_vcpu_model_json = {}
+ instance_vcpu_model_json['architecture'] = 'amd64'
+ instance_vcpu_model_json['count'] = 4
- # Construct a model instance of InstanceGroupMembershipCollectionFirst by calling from_dict on the json representation
- instance_group_membership_collection_first_model = InstanceGroupMembershipCollectionFirst.from_dict(instance_group_membership_collection_first_model_json)
- assert instance_group_membership_collection_first_model != False
+ # Construct a model instance of InstanceVCPU by calling from_dict on the json representation
+ instance_vcpu_model = InstanceVCPU.from_dict(instance_vcpu_model_json)
+ assert instance_vcpu_model != False
- # Construct a model instance of InstanceGroupMembershipCollectionFirst by calling from_dict on the json representation
- instance_group_membership_collection_first_model_dict = InstanceGroupMembershipCollectionFirst.from_dict(instance_group_membership_collection_first_model_json).__dict__
- instance_group_membership_collection_first_model2 = InstanceGroupMembershipCollectionFirst(**instance_group_membership_collection_first_model_dict)
+ # Construct a model instance of InstanceVCPU by calling from_dict on the json representation
+ instance_vcpu_model_dict = InstanceVCPU.from_dict(instance_vcpu_model_json).__dict__
+ instance_vcpu_model2 = InstanceVCPU(**instance_vcpu_model_dict)
# Verify the model instances are equivalent
- assert instance_group_membership_collection_first_model == instance_group_membership_collection_first_model2
+ assert instance_vcpu_model == instance_vcpu_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_membership_collection_first_model_json2 = instance_group_membership_collection_first_model.to_dict()
- assert instance_group_membership_collection_first_model_json2 == instance_group_membership_collection_first_model_json
+ instance_vcpu_model_json2 = instance_vcpu_model.to_dict()
+ assert instance_vcpu_model_json2 == instance_vcpu_model_json
-class TestModel_InstanceGroupMembershipCollectionNext():
+class TestModel_Key():
"""
- Test Class for InstanceGroupMembershipCollectionNext
+ Test Class for Key
"""
- def test_instance_group_membership_collection_next_serialization(self):
+ def test_key_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupMembershipCollectionNext
+ Test serialization/deserialization for Key
"""
- # Construct a json representation of a InstanceGroupMembershipCollectionNext model
- instance_group_membership_collection_next_model_json = {}
- instance_group_membership_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/7241e2a8-601f-11ea-8503-000c29475bed/memberships?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- # Construct a model instance of InstanceGroupMembershipCollectionNext by calling from_dict on the json representation
- instance_group_membership_collection_next_model = InstanceGroupMembershipCollectionNext.from_dict(instance_group_membership_collection_next_model_json)
- assert instance_group_membership_collection_next_model != False
-
- # Construct a model instance of InstanceGroupMembershipCollectionNext by calling from_dict on the json representation
- instance_group_membership_collection_next_model_dict = InstanceGroupMembershipCollectionNext.from_dict(instance_group_membership_collection_next_model_json).__dict__
- instance_group_membership_collection_next_model2 = InstanceGroupMembershipCollectionNext(**instance_group_membership_collection_next_model_dict)
-
- # Verify the model instances are equivalent
- assert instance_group_membership_collection_next_model == instance_group_membership_collection_next_model2
-
- # Convert model instance back to dict and verify no loss of data
- instance_group_membership_collection_next_model_json2 = instance_group_membership_collection_next_model.to_dict()
- assert instance_group_membership_collection_next_model_json2 == instance_group_membership_collection_next_model_json
-
-class TestModel_InstanceGroupMembershipPatch():
- """
- Test Class for InstanceGroupMembershipPatch
- """
+ # Construct dict forms of any model objects needed in order to build this model.
- def test_instance_group_membership_patch_serialization(self):
- """
- Test serialization/deserialization for InstanceGroupMembershipPatch
- """
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/resource_groups/3fad3f2204eb4998c3964d254ffcd771'
+ resource_group_reference_model['id'] = '3fad3f2204eb4998c3964d254ffcd771'
+ resource_group_reference_model['name'] = 'Default'
- # Construct a json representation of a InstanceGroupMembershipPatch model
- instance_group_membership_patch_model_json = {}
- instance_group_membership_patch_model_json['name'] = 'my-instance-group-membership'
+ # Construct a json representation of a Key model
+ key_model_json = {}
+ key_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ key_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
+ key_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_model_json['length'] = 2048
+ key_model_json['name'] = 'my-key'
+ key_model_json['public_key'] = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En'
+ key_model_json['resource_group'] = resource_group_reference_model
+ key_model_json['type'] = 'rsa'
- # Construct a model instance of InstanceGroupMembershipPatch by calling from_dict on the json representation
- instance_group_membership_patch_model = InstanceGroupMembershipPatch.from_dict(instance_group_membership_patch_model_json)
- assert instance_group_membership_patch_model != False
+ # Construct a model instance of Key by calling from_dict on the json representation
+ key_model = Key.from_dict(key_model_json)
+ assert key_model != False
- # Construct a model instance of InstanceGroupMembershipPatch by calling from_dict on the json representation
- instance_group_membership_patch_model_dict = InstanceGroupMembershipPatch.from_dict(instance_group_membership_patch_model_json).__dict__
- instance_group_membership_patch_model2 = InstanceGroupMembershipPatch(**instance_group_membership_patch_model_dict)
+ # Construct a model instance of Key by calling from_dict on the json representation
+ key_model_dict = Key.from_dict(key_model_json).__dict__
+ key_model2 = Key(**key_model_dict)
# Verify the model instances are equivalent
- assert instance_group_membership_patch_model == instance_group_membership_patch_model2
+ assert key_model == key_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_membership_patch_model_json2 = instance_group_membership_patch_model.to_dict()
- assert instance_group_membership_patch_model_json2 == instance_group_membership_patch_model_json
+ key_model_json2 = key_model.to_dict()
+ assert key_model_json2 == key_model_json
-class TestModel_InstanceGroupPatch():
+class TestModel_KeyCollection():
"""
- Test Class for InstanceGroupPatch
+ Test Class for KeyCollection
"""
- def test_instance_group_patch_serialization(self):
+ def test_key_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupPatch
+ Test serialization/deserialization for KeyCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_template_identity_model = {} # InstanceTemplateIdentityById
- instance_template_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_collection_first_model = {} # KeyCollectionFirst
+ key_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?limit=50'
- load_balancer_identity_model = {} # LoadBalancerIdentityById
- load_balancer_identity_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/resource_groups/3fad3f2204eb4998c3964d254ffcd771'
+ resource_group_reference_model['id'] = '3fad3f2204eb4998c3964d254ffcd771'
+ resource_group_reference_model['name'] = 'Default'
- load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById
- load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ key_model = {} # Key
+ key_model['created_at'] = "2019-01-29T03:48:11Z"
+ key_model['crn'] = 'crn:[...]'
+ key_model['fingerprint'] = 'SHA256:RJ+YWs2kupwFGiJuLqY85twmcdLOUcjIc9cA6IR8n8E'
+ key_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45'
+ key_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45'
+ key_model['length'] = 2048
+ key_model['name'] = 'my-key-1'
+ key_model['public_key'] = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En'
+ key_model['resource_group'] = resource_group_reference_model
+ key_model['type'] = 'rsa'
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ key_collection_next_model = {} # KeyCollectionNext
+ key_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a json representation of a InstanceGroupPatch model
- instance_group_patch_model_json = {}
- instance_group_patch_model_json['application_port'] = 22
- instance_group_patch_model_json['instance_template'] = instance_template_identity_model
- instance_group_patch_model_json['load_balancer'] = load_balancer_identity_model
- instance_group_patch_model_json['load_balancer_pool'] = load_balancer_pool_identity_model
- instance_group_patch_model_json['membership_count'] = 10
- instance_group_patch_model_json['name'] = 'my-instance-group'
- instance_group_patch_model_json['subnets'] = [subnet_identity_model]
+ # Construct a json representation of a KeyCollection model
+ key_collection_model_json = {}
+ key_collection_model_json['first'] = key_collection_first_model
+ key_collection_model_json['keys'] = [key_model]
+ key_collection_model_json['limit'] = 20
+ key_collection_model_json['next'] = key_collection_next_model
+ key_collection_model_json['total_count'] = 132
- # Construct a model instance of InstanceGroupPatch by calling from_dict on the json representation
- instance_group_patch_model = InstanceGroupPatch.from_dict(instance_group_patch_model_json)
- assert instance_group_patch_model != False
+ # Construct a model instance of KeyCollection by calling from_dict on the json representation
+ key_collection_model = KeyCollection.from_dict(key_collection_model_json)
+ assert key_collection_model != False
- # Construct a model instance of InstanceGroupPatch by calling from_dict on the json representation
- instance_group_patch_model_dict = InstanceGroupPatch.from_dict(instance_group_patch_model_json).__dict__
- instance_group_patch_model2 = InstanceGroupPatch(**instance_group_patch_model_dict)
+ # Construct a model instance of KeyCollection by calling from_dict on the json representation
+ key_collection_model_dict = KeyCollection.from_dict(key_collection_model_json).__dict__
+ key_collection_model2 = KeyCollection(**key_collection_model_dict)
# Verify the model instances are equivalent
- assert instance_group_patch_model == instance_group_patch_model2
+ assert key_collection_model == key_collection_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_patch_model_json2 = instance_group_patch_model.to_dict()
- assert instance_group_patch_model_json2 == instance_group_patch_model_json
+ key_collection_model_json2 = key_collection_model.to_dict()
+ assert key_collection_model_json2 == key_collection_model_json
-class TestModel_InstanceGroupReference():
+class TestModel_KeyCollectionFirst():
"""
- Test Class for InstanceGroupReference
+ Test Class for KeyCollectionFirst
"""
- def test_instance_group_reference_serialization(self):
+ def test_key_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupReference
+ Test serialization/deserialization for KeyCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_group_reference_deleted_model = {} # InstanceGroupReferenceDeleted
- instance_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a InstanceGroupReference model
- instance_group_reference_model_json = {}
- instance_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_reference_model_json['deleted'] = instance_group_reference_deleted_model
- instance_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_reference_model_json['name'] = 'my-instance-group'
+ # Construct a json representation of a KeyCollectionFirst model
+ key_collection_first_model_json = {}
+ key_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20'
- # Construct a model instance of InstanceGroupReference by calling from_dict on the json representation
- instance_group_reference_model = InstanceGroupReference.from_dict(instance_group_reference_model_json)
- assert instance_group_reference_model != False
+ # Construct a model instance of KeyCollectionFirst by calling from_dict on the json representation
+ key_collection_first_model = KeyCollectionFirst.from_dict(key_collection_first_model_json)
+ assert key_collection_first_model != False
- # Construct a model instance of InstanceGroupReference by calling from_dict on the json representation
- instance_group_reference_model_dict = InstanceGroupReference.from_dict(instance_group_reference_model_json).__dict__
- instance_group_reference_model2 = InstanceGroupReference(**instance_group_reference_model_dict)
+ # Construct a model instance of KeyCollectionFirst by calling from_dict on the json representation
+ key_collection_first_model_dict = KeyCollectionFirst.from_dict(key_collection_first_model_json).__dict__
+ key_collection_first_model2 = KeyCollectionFirst(**key_collection_first_model_dict)
# Verify the model instances are equivalent
- assert instance_group_reference_model == instance_group_reference_model2
+ assert key_collection_first_model == key_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_reference_model_json2 = instance_group_reference_model.to_dict()
- assert instance_group_reference_model_json2 == instance_group_reference_model_json
+ key_collection_first_model_json2 = key_collection_first_model.to_dict()
+ assert key_collection_first_model_json2 == key_collection_first_model_json
-class TestModel_InstanceGroupReferenceDeleted():
+class TestModel_KeyCollectionNext():
"""
- Test Class for InstanceGroupReferenceDeleted
+ Test Class for KeyCollectionNext
"""
- def test_instance_group_reference_deleted_serialization(self):
+ def test_key_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceGroupReferenceDeleted
+ Test serialization/deserialization for KeyCollectionNext
"""
- # Construct a json representation of a InstanceGroupReferenceDeleted model
- instance_group_reference_deleted_model_json = {}
- instance_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a KeyCollectionNext model
+ key_collection_next_model_json = {}
+ key_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of InstanceGroupReferenceDeleted by calling from_dict on the json representation
- instance_group_reference_deleted_model = InstanceGroupReferenceDeleted.from_dict(instance_group_reference_deleted_model_json)
- assert instance_group_reference_deleted_model != False
+ # Construct a model instance of KeyCollectionNext by calling from_dict on the json representation
+ key_collection_next_model = KeyCollectionNext.from_dict(key_collection_next_model_json)
+ assert key_collection_next_model != False
- # Construct a model instance of InstanceGroupReferenceDeleted by calling from_dict on the json representation
- instance_group_reference_deleted_model_dict = InstanceGroupReferenceDeleted.from_dict(instance_group_reference_deleted_model_json).__dict__
- instance_group_reference_deleted_model2 = InstanceGroupReferenceDeleted(**instance_group_reference_deleted_model_dict)
+ # Construct a model instance of KeyCollectionNext by calling from_dict on the json representation
+ key_collection_next_model_dict = KeyCollectionNext.from_dict(key_collection_next_model_json).__dict__
+ key_collection_next_model2 = KeyCollectionNext(**key_collection_next_model_dict)
# Verify the model instances are equivalent
- assert instance_group_reference_deleted_model == instance_group_reference_deleted_model2
+ assert key_collection_next_model == key_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- instance_group_reference_deleted_model_json2 = instance_group_reference_deleted_model.to_dict()
- assert instance_group_reference_deleted_model_json2 == instance_group_reference_deleted_model_json
+ key_collection_next_model_json2 = key_collection_next_model.to_dict()
+ assert key_collection_next_model_json2 == key_collection_next_model_json
-class TestModel_InstanceInitialization():
+class TestModel_KeyPatch():
"""
- Test Class for InstanceInitialization
+ Test Class for KeyPatch
"""
- def test_instance_initialization_serialization(self):
+ def test_key_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceInitialization
+ Test serialization/deserialization for KeyPatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- key_reference_deleted_model = {} # KeyReferenceDeleted
- key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- key_reference_model = {} # KeyReference
- key_reference_model['crn'] = 'crn:[...]'
- key_reference_model['deleted'] = key_reference_deleted_model
- key_reference_model['fingerprint'] = 'SHA256:RJ+YWs2kupwFGiJuLqY85twmcdLOUcjIc9cA6IR8n8E'
- key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45'
- key_reference_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45'
- key_reference_model['name'] = 'my-key-1'
-
- key_identity_by_fingerprint_model = {} # KeyIdentityByFingerprint
- key_identity_by_fingerprint_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
-
- instance_initialization_password_model = {} # InstanceInitializationPassword
- instance_initialization_password_model['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
- instance_initialization_password_model['encryption_key'] = key_identity_by_fingerprint_model
-
- # Construct a json representation of a InstanceInitialization model
- instance_initialization_model_json = {}
- instance_initialization_model_json['keys'] = [key_reference_model]
- instance_initialization_model_json['password'] = instance_initialization_password_model
+ # Construct a json representation of a KeyPatch model
+ key_patch_model_json = {}
+ key_patch_model_json['name'] = 'my-key'
- # Construct a model instance of InstanceInitialization by calling from_dict on the json representation
- instance_initialization_model = InstanceInitialization.from_dict(instance_initialization_model_json)
- assert instance_initialization_model != False
+ # Construct a model instance of KeyPatch by calling from_dict on the json representation
+ key_patch_model = KeyPatch.from_dict(key_patch_model_json)
+ assert key_patch_model != False
- # Construct a model instance of InstanceInitialization by calling from_dict on the json representation
- instance_initialization_model_dict = InstanceInitialization.from_dict(instance_initialization_model_json).__dict__
- instance_initialization_model2 = InstanceInitialization(**instance_initialization_model_dict)
+ # Construct a model instance of KeyPatch by calling from_dict on the json representation
+ key_patch_model_dict = KeyPatch.from_dict(key_patch_model_json).__dict__
+ key_patch_model2 = KeyPatch(**key_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_initialization_model == instance_initialization_model2
+ assert key_patch_model == key_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_initialization_model_json2 = instance_initialization_model.to_dict()
- assert instance_initialization_model_json2 == instance_initialization_model_json
+ key_patch_model_json2 = key_patch_model.to_dict()
+ assert key_patch_model_json2 == key_patch_model_json
-class TestModel_InstanceInitializationPassword():
+class TestModel_KeyReference():
"""
- Test Class for InstanceInitializationPassword
+ Test Class for KeyReference
"""
- def test_instance_initialization_password_serialization(self):
+ def test_key_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceInitializationPassword
+ Test serialization/deserialization for KeyReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- key_identity_by_fingerprint_model = {} # KeyIdentityByFingerprint
- key_identity_by_fingerprint_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
+ key_reference_deleted_model = {} # KeyReferenceDeleted
+ key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a InstanceInitializationPassword model
- instance_initialization_password_model_json = {}
- instance_initialization_password_model_json['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
- instance_initialization_password_model_json['encryption_key'] = key_identity_by_fingerprint_model
+ # Construct a json representation of a KeyReference model
+ key_reference_model_json = {}
+ key_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_reference_model_json['deleted'] = key_reference_deleted_model
+ key_reference_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
+ key_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_reference_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_reference_model_json['name'] = 'my-key'
- # Construct a model instance of InstanceInitializationPassword by calling from_dict on the json representation
- instance_initialization_password_model = InstanceInitializationPassword.from_dict(instance_initialization_password_model_json)
- assert instance_initialization_password_model != False
+ # Construct a model instance of KeyReference by calling from_dict on the json representation
+ key_reference_model = KeyReference.from_dict(key_reference_model_json)
+ assert key_reference_model != False
- # Construct a model instance of InstanceInitializationPassword by calling from_dict on the json representation
- instance_initialization_password_model_dict = InstanceInitializationPassword.from_dict(instance_initialization_password_model_json).__dict__
- instance_initialization_password_model2 = InstanceInitializationPassword(**instance_initialization_password_model_dict)
+ # Construct a model instance of KeyReference by calling from_dict on the json representation
+ key_reference_model_dict = KeyReference.from_dict(key_reference_model_json).__dict__
+ key_reference_model2 = KeyReference(**key_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_initialization_password_model == instance_initialization_password_model2
+ assert key_reference_model == key_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_initialization_password_model_json2 = instance_initialization_password_model.to_dict()
- assert instance_initialization_password_model_json2 == instance_initialization_password_model_json
+ key_reference_model_json2 = key_reference_model.to_dict()
+ assert key_reference_model_json2 == key_reference_model_json
-class TestModel_InstancePatch():
+class TestModel_KeyReferenceDeleted():
"""
- Test Class for InstancePatch
+ Test Class for KeyReferenceDeleted
"""
- def test_instance_patch_serialization(self):
+ def test_key_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstancePatch
+ Test serialization/deserialization for KeyReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_patch_profile_model = {} # InstancePatchProfileInstanceProfileIdentityByName
- instance_patch_profile_model['name'] = 'bc1-4x16'
-
- # Construct a json representation of a InstancePatch model
- instance_patch_model_json = {}
- instance_patch_model_json['name'] = 'my-instance'
- instance_patch_model_json['profile'] = instance_patch_profile_model
- instance_patch_model_json['total_volume_bandwidth'] = 500
+ # Construct a json representation of a KeyReferenceDeleted model
+ key_reference_deleted_model_json = {}
+ key_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstancePatch by calling from_dict on the json representation
- instance_patch_model = InstancePatch.from_dict(instance_patch_model_json)
- assert instance_patch_model != False
+ # Construct a model instance of KeyReferenceDeleted by calling from_dict on the json representation
+ key_reference_deleted_model = KeyReferenceDeleted.from_dict(key_reference_deleted_model_json)
+ assert key_reference_deleted_model != False
- # Construct a model instance of InstancePatch by calling from_dict on the json representation
- instance_patch_model_dict = InstancePatch.from_dict(instance_patch_model_json).__dict__
- instance_patch_model2 = InstancePatch(**instance_patch_model_dict)
+ # Construct a model instance of KeyReferenceDeleted by calling from_dict on the json representation
+ key_reference_deleted_model_dict = KeyReferenceDeleted.from_dict(key_reference_deleted_model_json).__dict__
+ key_reference_deleted_model2 = KeyReferenceDeleted(**key_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert instance_patch_model == instance_patch_model2
+ assert key_reference_deleted_model == key_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- instance_patch_model_json2 = instance_patch_model.to_dict()
- assert instance_patch_model_json2 == instance_patch_model_json
+ key_reference_deleted_model_json2 = key_reference_deleted_model.to_dict()
+ assert key_reference_deleted_model_json2 == key_reference_deleted_model_json
-class TestModel_InstanceProfile():
+class TestModel_LoadBalancer():
"""
- Test Class for InstanceProfile
+ Test Class for LoadBalancer
"""
- def test_instance_profile_serialization(self):
+ def test_load_balancer_serialization(self):
"""
- Test serialization/deserialization for InstanceProfile
+ Test serialization/deserialization for LoadBalancer
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed
- instance_profile_bandwidth_model['type'] = 'fixed'
- instance_profile_bandwidth_model['value'] = 20000
-
- instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed
- instance_profile_disk_quantity_model['type'] = 'fixed'
- instance_profile_disk_quantity_model['value'] = 4
-
- instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed
- instance_profile_disk_size_model['type'] = 'fixed'
- instance_profile_disk_size_model['value'] = 100
+ load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
+ load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_profile_disk_supported_interfaces_model = {} # InstanceProfileDiskSupportedInterfaces
- instance_profile_disk_supported_interfaces_model['default'] = 'nvme'
- instance_profile_disk_supported_interfaces_model['type'] = 'enum'
- instance_profile_disk_supported_interfaces_model['values'] = ['nvme']
+ load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
+ load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
+ load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- instance_profile_disk_model = {} # InstanceProfileDisk
- instance_profile_disk_model['quantity'] = instance_profile_disk_quantity_model
- instance_profile_disk_model['size'] = instance_profile_disk_size_model
- instance_profile_disk_model['supported_interface_types'] = instance_profile_disk_supported_interfaces_model
+ load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
+ load_balancer_logging_datapath_model['active'] = True
- instance_profile_gpu_model = {} # InstanceProfileGPUFixed
- instance_profile_gpu_model['type'] = 'fixed'
- instance_profile_gpu_model['value'] = 2
+ load_balancer_logging_model = {} # LoadBalancerLogging
+ load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
- instance_profile_gpu_manufacturer_model = {} # InstanceProfileGPUManufacturer
- instance_profile_gpu_manufacturer_model['type'] = 'enum'
- instance_profile_gpu_manufacturer_model['values'] = ['nvidia']
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_profile_gpu_memory_model = {} # InstanceProfileGPUMemoryFixed
- instance_profile_gpu_memory_model['type'] = 'fixed'
- instance_profile_gpu_memory_model['value'] = 16
+ load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
+ load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
- instance_profile_gpu_model_model = {} # InstanceProfileGPUModel
- instance_profile_gpu_model_model['type'] = 'enum'
- instance_profile_gpu_model_model['values'] = ['Tesla V100']
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- instance_profile_memory_model = {} # InstanceProfileMemoryFixed
- instance_profile_memory_model['type'] = 'fixed'
- instance_profile_memory_model['value'] = 16
+ load_balancer_profile_reference_model = {} # LoadBalancerProfileReference
+ load_balancer_profile_reference_model['family'] = 'network'
+ load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
+ load_balancer_profile_reference_model['name'] = 'network-fixed'
- instance_profile_os_architecture_model = {} # InstanceProfileOSArchitecture
- instance_profile_os_architecture_model['default'] = 'testString'
- instance_profile_os_architecture_model['type'] = 'enum'
- instance_profile_os_architecture_model['values'] = ['amd64']
+ 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'
- instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed
- instance_profile_port_speed_model['type'] = 'fixed'
- instance_profile_port_speed_model['value'] = 1000
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed
- instance_profile_volume_bandwidth_model['type'] = 'fixed'
- instance_profile_volume_bandwidth_model['value'] = 20000
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
- instance_profile_vcpu_architecture_model = {} # InstanceProfileVCPUArchitecture
- instance_profile_vcpu_architecture_model['default'] = 'testString'
- instance_profile_vcpu_architecture_model['type'] = 'fixed'
- instance_profile_vcpu_architecture_model['value'] = 'amd64'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed
- instance_profile_vcpu_model['type'] = 'fixed'
- instance_profile_vcpu_model['value'] = 16
+ 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'
- # Construct a json representation of a InstanceProfile model
- instance_profile_model_json = {}
- instance_profile_model_json['bandwidth'] = instance_profile_bandwidth_model
- instance_profile_model_json['disks'] = [instance_profile_disk_model]
- instance_profile_model_json['family'] = 'balanced'
- instance_profile_model_json['gpu_count'] = instance_profile_gpu_model
- instance_profile_model_json['gpu_manufacturer'] = instance_profile_gpu_manufacturer_model
- instance_profile_model_json['gpu_memory'] = instance_profile_gpu_memory_model
- instance_profile_model_json['gpu_model'] = instance_profile_gpu_model_model
- instance_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
- instance_profile_model_json['memory'] = instance_profile_memory_model
- instance_profile_model_json['name'] = 'bc1-4x16'
- instance_profile_model_json['os_architecture'] = instance_profile_os_architecture_model
- instance_profile_model_json['port_speed'] = instance_profile_port_speed_model
- instance_profile_model_json['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model
- instance_profile_model_json['vcpu_architecture'] = instance_profile_vcpu_architecture_model
- instance_profile_model_json['vcpu_count'] = instance_profile_vcpu_model
+ # Construct a json representation of a LoadBalancer model
+ load_balancer_model_json = {}
+ load_balancer_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model_json['hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net'
+ load_balancer_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model_json['is_public'] = True
+ load_balancer_model_json['listeners'] = [load_balancer_listener_reference_model]
+ load_balancer_model_json['logging'] = load_balancer_logging_model
+ load_balancer_model_json['name'] = 'my-load-balancer'
+ load_balancer_model_json['operating_status'] = 'offline'
+ load_balancer_model_json['pools'] = [load_balancer_pool_reference_model]
+ load_balancer_model_json['private_ips'] = [ip_model]
+ load_balancer_model_json['profile'] = load_balancer_profile_reference_model
+ load_balancer_model_json['provisioning_status'] = 'active'
+ load_balancer_model_json['public_ips'] = [ip_model]
+ load_balancer_model_json['resource_group'] = resource_group_reference_model
+ load_balancer_model_json['route_mode'] = True
+ load_balancer_model_json['security_groups'] = [security_group_reference_model]
+ load_balancer_model_json['security_groups_supported'] = True
+ load_balancer_model_json['subnets'] = [subnet_reference_model]
- # Construct a model instance of InstanceProfile by calling from_dict on the json representation
- instance_profile_model = InstanceProfile.from_dict(instance_profile_model_json)
- assert instance_profile_model != False
+ # Construct a model instance of LoadBalancer by calling from_dict on the json representation
+ load_balancer_model = LoadBalancer.from_dict(load_balancer_model_json)
+ assert load_balancer_model != False
- # Construct a model instance of InstanceProfile by calling from_dict on the json representation
- instance_profile_model_dict = InstanceProfile.from_dict(instance_profile_model_json).__dict__
- instance_profile_model2 = InstanceProfile(**instance_profile_model_dict)
+ # Construct a model instance of LoadBalancer by calling from_dict on the json representation
+ load_balancer_model_dict = LoadBalancer.from_dict(load_balancer_model_json).__dict__
+ load_balancer_model2 = LoadBalancer(**load_balancer_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_model == instance_profile_model2
+ assert load_balancer_model == load_balancer_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_model_json2 = instance_profile_model.to_dict()
- assert instance_profile_model_json2 == instance_profile_model_json
+ load_balancer_model_json2 = load_balancer_model.to_dict()
+ assert load_balancer_model_json2 == load_balancer_model_json
-class TestModel_InstanceProfileCollection():
+class TestModel_LoadBalancerCollection():
"""
- Test Class for InstanceProfileCollection
+ Test Class for LoadBalancerCollection
"""
- def test_instance_profile_collection_serialization(self):
+ def test_load_balancer_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileCollection
+ Test serialization/deserialization for LoadBalancerCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_profile_bandwidth_model = {} # InstanceProfileBandwidthFixed
- instance_profile_bandwidth_model['type'] = 'fixed'
- instance_profile_bandwidth_model['value'] = 20000
+ load_balancer_collection_first_model = {} # LoadBalancerCollectionFirst
+ load_balancer_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20'
- instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed
- instance_profile_disk_quantity_model['type'] = 'fixed'
- instance_profile_disk_quantity_model['value'] = 4
+ load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
+ load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed
- instance_profile_disk_size_model['type'] = 'fixed'
- instance_profile_disk_size_model['value'] = 100
+ load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
+ load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
+ load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- instance_profile_disk_supported_interfaces_model = {} # InstanceProfileDiskSupportedInterfaces
- instance_profile_disk_supported_interfaces_model['default'] = 'nvme'
- instance_profile_disk_supported_interfaces_model['type'] = 'enum'
- instance_profile_disk_supported_interfaces_model['values'] = ['nvme']
+ load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
+ load_balancer_logging_datapath_model['active'] = True
- instance_profile_disk_model = {} # InstanceProfileDisk
- instance_profile_disk_model['quantity'] = instance_profile_disk_quantity_model
- instance_profile_disk_model['size'] = instance_profile_disk_size_model
- instance_profile_disk_model['supported_interface_types'] = instance_profile_disk_supported_interfaces_model
+ load_balancer_logging_model = {} # LoadBalancerLogging
+ load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
- instance_profile_gpu_model = {} # InstanceProfileGPUFixed
- instance_profile_gpu_model['type'] = 'fixed'
- instance_profile_gpu_model['value'] = 2
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_profile_gpu_manufacturer_model = {} # InstanceProfileGPUManufacturer
- instance_profile_gpu_manufacturer_model['type'] = 'enum'
- instance_profile_gpu_manufacturer_model['values'] = ['nvidia']
+ load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
+ load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
- instance_profile_gpu_memory_model = {} # InstanceProfileGPUMemoryFixed
- instance_profile_gpu_memory_model['type'] = 'fixed'
- instance_profile_gpu_memory_model['value'] = 16
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- instance_profile_gpu_model_model = {} # InstanceProfileGPUModel
- instance_profile_gpu_model_model['type'] = 'enum'
- instance_profile_gpu_model_model['values'] = ['Tesla V100']
+ load_balancer_profile_reference_model = {} # LoadBalancerProfileReference
+ load_balancer_profile_reference_model['family'] = 'network'
+ load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
+ load_balancer_profile_reference_model['name'] = 'network-fixed'
- instance_profile_memory_model = {} # InstanceProfileMemoryFixed
- instance_profile_memory_model['type'] = 'fixed'
- instance_profile_memory_model['value'] = 16
+ 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'
- instance_profile_os_architecture_model = {} # InstanceProfileOSArchitecture
- instance_profile_os_architecture_model['default'] = 'testString'
- instance_profile_os_architecture_model['type'] = 'enum'
- instance_profile_os_architecture_model['values'] = ['amd64']
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_profile_port_speed_model = {} # InstanceProfilePortSpeedFixed
- instance_profile_port_speed_model['type'] = 'fixed'
- instance_profile_port_speed_model['value'] = 1000
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
- instance_profile_volume_bandwidth_model = {} # InstanceProfileVolumeBandwidthFixed
- instance_profile_volume_bandwidth_model['type'] = 'fixed'
- instance_profile_volume_bandwidth_model['value'] = 20000
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- instance_profile_vcpu_architecture_model = {} # InstanceProfileVCPUArchitecture
- instance_profile_vcpu_architecture_model['default'] = 'testString'
- instance_profile_vcpu_architecture_model['type'] = 'fixed'
- instance_profile_vcpu_architecture_model['value'] = 'amd64'
+ 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'
- instance_profile_vcpu_model = {} # InstanceProfileVCPUFixed
- instance_profile_vcpu_model['type'] = 'fixed'
- instance_profile_vcpu_model['value'] = 16
+ load_balancer_model = {} # LoadBalancer
+ load_balancer_model['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model['hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net'
+ load_balancer_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
+ load_balancer_model['is_public'] = True
+ load_balancer_model['listeners'] = [load_balancer_listener_reference_model]
+ load_balancer_model['logging'] = load_balancer_logging_model
+ load_balancer_model['name'] = 'my-load-balancer'
+ load_balancer_model['operating_status'] = 'offline'
+ load_balancer_model['pools'] = [load_balancer_pool_reference_model]
+ load_balancer_model['private_ips'] = [ip_model]
+ load_balancer_model['profile'] = load_balancer_profile_reference_model
+ load_balancer_model['provisioning_status'] = 'active'
+ load_balancer_model['public_ips'] = [ip_model]
+ load_balancer_model['resource_group'] = resource_group_reference_model
+ load_balancer_model['route_mode'] = True
+ load_balancer_model['security_groups'] = [security_group_reference_model]
+ load_balancer_model['security_groups_supported'] = True
+ load_balancer_model['subnets'] = [subnet_reference_model]
- instance_profile_model = {} # InstanceProfile
- instance_profile_model['bandwidth'] = instance_profile_bandwidth_model
- instance_profile_model['disks'] = [instance_profile_disk_model]
- instance_profile_model['family'] = 'balanced'
- instance_profile_model['gpu_count'] = instance_profile_gpu_model
- instance_profile_model['gpu_manufacturer'] = instance_profile_gpu_manufacturer_model
- instance_profile_model['gpu_memory'] = instance_profile_gpu_memory_model
- instance_profile_model['gpu_model'] = instance_profile_gpu_model_model
- instance_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
- instance_profile_model['memory'] = instance_profile_memory_model
- instance_profile_model['name'] = 'bc1-4x16'
- instance_profile_model['os_architecture'] = instance_profile_os_architecture_model
- instance_profile_model['port_speed'] = instance_profile_port_speed_model
- instance_profile_model['total_volume_bandwidth'] = instance_profile_volume_bandwidth_model
- instance_profile_model['vcpu_architecture'] = instance_profile_vcpu_architecture_model
- instance_profile_model['vcpu_count'] = instance_profile_vcpu_model
+ load_balancer_collection_next_model = {} # LoadBalancerCollectionNext
+ load_balancer_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
- # Construct a json representation of a InstanceProfileCollection model
- instance_profile_collection_model_json = {}
- instance_profile_collection_model_json['profiles'] = [instance_profile_model]
+ # Construct a json representation of a LoadBalancerCollection model
+ load_balancer_collection_model_json = {}
+ load_balancer_collection_model_json['first'] = load_balancer_collection_first_model
+ load_balancer_collection_model_json['limit'] = 20
+ load_balancer_collection_model_json['load_balancers'] = [load_balancer_model]
+ load_balancer_collection_model_json['next'] = load_balancer_collection_next_model
+ load_balancer_collection_model_json['total_count'] = 132
- # Construct a model instance of InstanceProfileCollection by calling from_dict on the json representation
- instance_profile_collection_model = InstanceProfileCollection.from_dict(instance_profile_collection_model_json)
- assert instance_profile_collection_model != False
+ # Construct a model instance of LoadBalancerCollection by calling from_dict on the json representation
+ load_balancer_collection_model = LoadBalancerCollection.from_dict(load_balancer_collection_model_json)
+ assert load_balancer_collection_model != False
- # Construct a model instance of InstanceProfileCollection by calling from_dict on the json representation
- instance_profile_collection_model_dict = InstanceProfileCollection.from_dict(instance_profile_collection_model_json).__dict__
- instance_profile_collection_model2 = InstanceProfileCollection(**instance_profile_collection_model_dict)
+ # Construct a model instance of LoadBalancerCollection by calling from_dict on the json representation
+ load_balancer_collection_model_dict = LoadBalancerCollection.from_dict(load_balancer_collection_model_json).__dict__
+ load_balancer_collection_model2 = LoadBalancerCollection(**load_balancer_collection_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_collection_model == instance_profile_collection_model2
+ assert load_balancer_collection_model == load_balancer_collection_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_collection_model_json2 = instance_profile_collection_model.to_dict()
- assert instance_profile_collection_model_json2 == instance_profile_collection_model_json
+ load_balancer_collection_model_json2 = load_balancer_collection_model.to_dict()
+ assert load_balancer_collection_model_json2 == load_balancer_collection_model_json
-class TestModel_InstanceProfileDisk():
+class TestModel_LoadBalancerCollectionFirst():
"""
- Test Class for InstanceProfileDisk
+ Test Class for LoadBalancerCollectionFirst
"""
- def test_instance_profile_disk_serialization(self):
+ def test_load_balancer_collection_first_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDisk
+ Test serialization/deserialization for LoadBalancerCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- instance_profile_disk_quantity_model = {} # InstanceProfileDiskQuantityFixed
- instance_profile_disk_quantity_model['type'] = 'fixed'
- instance_profile_disk_quantity_model['value'] = 4
-
- instance_profile_disk_size_model = {} # InstanceProfileDiskSizeFixed
- instance_profile_disk_size_model['type'] = 'fixed'
- instance_profile_disk_size_model['value'] = 100
-
- instance_profile_disk_supported_interfaces_model = {} # InstanceProfileDiskSupportedInterfaces
- instance_profile_disk_supported_interfaces_model['default'] = 'nvme'
- instance_profile_disk_supported_interfaces_model['type'] = 'enum'
- instance_profile_disk_supported_interfaces_model['values'] = ['nvme']
-
- # Construct a json representation of a InstanceProfileDisk model
- instance_profile_disk_model_json = {}
- instance_profile_disk_model_json['quantity'] = instance_profile_disk_quantity_model
- instance_profile_disk_model_json['size'] = instance_profile_disk_size_model
- instance_profile_disk_model_json['supported_interface_types'] = instance_profile_disk_supported_interfaces_model
+ # Construct a json representation of a LoadBalancerCollectionFirst model
+ load_balancer_collection_first_model_json = {}
+ load_balancer_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20'
- # Construct a model instance of InstanceProfileDisk by calling from_dict on the json representation
- instance_profile_disk_model = InstanceProfileDisk.from_dict(instance_profile_disk_model_json)
- assert instance_profile_disk_model != False
+ # Construct a model instance of LoadBalancerCollectionFirst by calling from_dict on the json representation
+ load_balancer_collection_first_model = LoadBalancerCollectionFirst.from_dict(load_balancer_collection_first_model_json)
+ assert load_balancer_collection_first_model != False
- # Construct a model instance of InstanceProfileDisk by calling from_dict on the json representation
- instance_profile_disk_model_dict = InstanceProfileDisk.from_dict(instance_profile_disk_model_json).__dict__
- instance_profile_disk_model2 = InstanceProfileDisk(**instance_profile_disk_model_dict)
+ # Construct a model instance of LoadBalancerCollectionFirst by calling from_dict on the json representation
+ load_balancer_collection_first_model_dict = LoadBalancerCollectionFirst.from_dict(load_balancer_collection_first_model_json).__dict__
+ load_balancer_collection_first_model2 = LoadBalancerCollectionFirst(**load_balancer_collection_first_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_model == instance_profile_disk_model2
+ assert load_balancer_collection_first_model == load_balancer_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_model_json2 = instance_profile_disk_model.to_dict()
- assert instance_profile_disk_model_json2 == instance_profile_disk_model_json
+ load_balancer_collection_first_model_json2 = load_balancer_collection_first_model.to_dict()
+ assert load_balancer_collection_first_model_json2 == load_balancer_collection_first_model_json
-class TestModel_InstanceProfileDiskSupportedInterfaces():
+class TestModel_LoadBalancerCollectionNext():
"""
- Test Class for InstanceProfileDiskSupportedInterfaces
+ Test Class for LoadBalancerCollectionNext
"""
- def test_instance_profile_disk_supported_interfaces_serialization(self):
+ def test_load_balancer_collection_next_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileDiskSupportedInterfaces
+ Test serialization/deserialization for LoadBalancerCollectionNext
"""
- # Construct a json representation of a InstanceProfileDiskSupportedInterfaces model
- instance_profile_disk_supported_interfaces_model_json = {}
- instance_profile_disk_supported_interfaces_model_json['default'] = 'nvme'
- instance_profile_disk_supported_interfaces_model_json['type'] = 'enum'
- instance_profile_disk_supported_interfaces_model_json['values'] = ['nvme']
+ # Construct a json representation of a LoadBalancerCollectionNext model
+ load_balancer_collection_next_model_json = {}
+ load_balancer_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
- # Construct a model instance of InstanceProfileDiskSupportedInterfaces by calling from_dict on the json representation
- instance_profile_disk_supported_interfaces_model = InstanceProfileDiskSupportedInterfaces.from_dict(instance_profile_disk_supported_interfaces_model_json)
- assert instance_profile_disk_supported_interfaces_model != False
+ # Construct a model instance of LoadBalancerCollectionNext by calling from_dict on the json representation
+ load_balancer_collection_next_model = LoadBalancerCollectionNext.from_dict(load_balancer_collection_next_model_json)
+ assert load_balancer_collection_next_model != False
- # Construct a model instance of InstanceProfileDiskSupportedInterfaces by calling from_dict on the json representation
- instance_profile_disk_supported_interfaces_model_dict = InstanceProfileDiskSupportedInterfaces.from_dict(instance_profile_disk_supported_interfaces_model_json).__dict__
- instance_profile_disk_supported_interfaces_model2 = InstanceProfileDiskSupportedInterfaces(**instance_profile_disk_supported_interfaces_model_dict)
+ # Construct a model instance of LoadBalancerCollectionNext by calling from_dict on the json representation
+ load_balancer_collection_next_model_dict = LoadBalancerCollectionNext.from_dict(load_balancer_collection_next_model_json).__dict__
+ load_balancer_collection_next_model2 = LoadBalancerCollectionNext(**load_balancer_collection_next_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_disk_supported_interfaces_model == instance_profile_disk_supported_interfaces_model2
+ assert load_balancer_collection_next_model == load_balancer_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_disk_supported_interfaces_model_json2 = instance_profile_disk_supported_interfaces_model.to_dict()
- assert instance_profile_disk_supported_interfaces_model_json2 == instance_profile_disk_supported_interfaces_model_json
+ load_balancer_collection_next_model_json2 = load_balancer_collection_next_model.to_dict()
+ assert load_balancer_collection_next_model_json2 == load_balancer_collection_next_model_json
-class TestModel_InstanceProfileGPUManufacturer():
+class TestModel_LoadBalancerListener():
"""
- Test Class for InstanceProfileGPUManufacturer
+ Test Class for LoadBalancerListener
"""
- def test_instance_profile_gpu_manufacturer_serialization(self):
+ def test_load_balancer_listener_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUManufacturer
+ Test serialization/deserialization for LoadBalancerListener
"""
- # Construct a json representation of a InstanceProfileGPUManufacturer model
- instance_profile_gpu_manufacturer_model_json = {}
- instance_profile_gpu_manufacturer_model_json['type'] = 'enum'
- instance_profile_gpu_manufacturer_model_json['values'] = ['nvidia']
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileGPUManufacturer by calling from_dict on the json representation
- instance_profile_gpu_manufacturer_model = InstanceProfileGPUManufacturer.from_dict(instance_profile_gpu_manufacturer_model_json)
- assert instance_profile_gpu_manufacturer_model != False
+ certificate_instance_reference_model = {} # CertificateInstanceReference
+ certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
- # Construct a model instance of InstanceProfileGPUManufacturer by calling from_dict on the json representation
- instance_profile_gpu_manufacturer_model_dict = InstanceProfileGPUManufacturer.from_dict(instance_profile_gpu_manufacturer_model_json).__dict__
- instance_profile_gpu_manufacturer_model2 = InstanceProfileGPUManufacturer(**instance_profile_gpu_manufacturer_model_dict)
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
+ load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+
+ load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
+ load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
+ load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
+ load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ load_balancer_listener_https_redirect_model = {} # LoadBalancerListenerHTTPSRedirect
+ load_balancer_listener_https_redirect_model['http_status_code'] = 301
+ load_balancer_listener_https_redirect_model['listener'] = load_balancer_listener_reference_model
+ load_balancer_listener_https_redirect_model['uri'] = '/example?doc=get'
+
+ load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted
+ load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_listener_policy_reference_model = {} # LoadBalancerListenerPolicyReference
+ load_balancer_listener_policy_reference_model['deleted'] = load_balancer_listener_policy_reference_deleted_model
+ load_balancer_listener_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
+ load_balancer_listener_policy_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a json representation of a LoadBalancerListener model
+ load_balancer_listener_model_json = {}
+ load_balancer_listener_model_json['accept_proxy_protocol'] = True
+ load_balancer_listener_model_json['certificate_instance'] = certificate_instance_reference_model
+ load_balancer_listener_model_json['connection_limit'] = 2000
+ load_balancer_listener_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_listener_model_json['default_pool'] = load_balancer_pool_reference_model
+ load_balancer_listener_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_model_json['https_redirect'] = load_balancer_listener_https_redirect_model
+ load_balancer_listener_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_model_json['policies'] = [load_balancer_listener_policy_reference_model]
+ load_balancer_listener_model_json['port'] = 443
+ load_balancer_listener_model_json['port_max'] = 499
+ load_balancer_listener_model_json['port_min'] = 443
+ load_balancer_listener_model_json['protocol'] = 'http'
+ load_balancer_listener_model_json['provisioning_status'] = 'active'
+
+ # Construct a model instance of LoadBalancerListener by calling from_dict on the json representation
+ load_balancer_listener_model = LoadBalancerListener.from_dict(load_balancer_listener_model_json)
+ assert load_balancer_listener_model != False
+
+ # Construct a model instance of LoadBalancerListener by calling from_dict on the json representation
+ load_balancer_listener_model_dict = LoadBalancerListener.from_dict(load_balancer_listener_model_json).__dict__
+ load_balancer_listener_model2 = LoadBalancerListener(**load_balancer_listener_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_manufacturer_model == instance_profile_gpu_manufacturer_model2
+ assert load_balancer_listener_model == load_balancer_listener_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_manufacturer_model_json2 = instance_profile_gpu_manufacturer_model.to_dict()
- assert instance_profile_gpu_manufacturer_model_json2 == instance_profile_gpu_manufacturer_model_json
+ load_balancer_listener_model_json2 = load_balancer_listener_model.to_dict()
+ assert load_balancer_listener_model_json2 == load_balancer_listener_model_json
-class TestModel_InstanceProfileGPUModel():
+class TestModel_LoadBalancerListenerCollection():
"""
- Test Class for InstanceProfileGPUModel
+ Test Class for LoadBalancerListenerCollection
"""
- def test_instance_profile_gpu_model_serialization(self):
+ def test_load_balancer_listener_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileGPUModel
+ Test serialization/deserialization for LoadBalancerListenerCollection
"""
- # Construct a json representation of a InstanceProfileGPUModel model
- instance_profile_gpu_model_model_json = {}
- instance_profile_gpu_model_model_json['type'] = 'enum'
- instance_profile_gpu_model_model_json['values'] = ['Tesla V100']
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileGPUModel by calling from_dict on the json representation
- instance_profile_gpu_model_model = InstanceProfileGPUModel.from_dict(instance_profile_gpu_model_model_json)
- assert instance_profile_gpu_model_model != False
+ certificate_instance_reference_model = {} # CertificateInstanceReference
+ certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
- # Construct a model instance of InstanceProfileGPUModel by calling from_dict on the json representation
- instance_profile_gpu_model_model_dict = InstanceProfileGPUModel.from_dict(instance_profile_gpu_model_model_json).__dict__
- instance_profile_gpu_model_model2 = InstanceProfileGPUModel(**instance_profile_gpu_model_model_dict)
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
+ load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+
+ load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
+ load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
+ load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
+ load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ load_balancer_listener_https_redirect_model = {} # LoadBalancerListenerHTTPSRedirect
+ load_balancer_listener_https_redirect_model['http_status_code'] = 301
+ load_balancer_listener_https_redirect_model['listener'] = load_balancer_listener_reference_model
+ load_balancer_listener_https_redirect_model['uri'] = '/example?doc=get'
+
+ load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted
+ load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_listener_policy_reference_model = {} # LoadBalancerListenerPolicyReference
+ load_balancer_listener_policy_reference_model['deleted'] = load_balancer_listener_policy_reference_deleted_model
+ load_balancer_listener_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
+ load_balancer_listener_policy_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ load_balancer_listener_model = {} # LoadBalancerListener
+ load_balancer_listener_model['accept_proxy_protocol'] = True
+ load_balancer_listener_model['certificate_instance'] = certificate_instance_reference_model
+ load_balancer_listener_model['connection_limit'] = 2000
+ load_balancer_listener_model['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_listener_model['default_pool'] = load_balancer_pool_reference_model
+ load_balancer_listener_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_model['https_redirect'] = load_balancer_listener_https_redirect_model
+ load_balancer_listener_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_model['policies'] = [load_balancer_listener_policy_reference_model]
+ load_balancer_listener_model['port'] = 443
+ load_balancer_listener_model['port_max'] = 499
+ load_balancer_listener_model['port_min'] = 443
+ load_balancer_listener_model['protocol'] = 'http'
+ load_balancer_listener_model['provisioning_status'] = 'active'
+
+ # Construct a json representation of a LoadBalancerListenerCollection model
+ load_balancer_listener_collection_model_json = {}
+ load_balancer_listener_collection_model_json['listeners'] = [load_balancer_listener_model]
+
+ # Construct a model instance of LoadBalancerListenerCollection by calling from_dict on the json representation
+ load_balancer_listener_collection_model = LoadBalancerListenerCollection.from_dict(load_balancer_listener_collection_model_json)
+ assert load_balancer_listener_collection_model != False
+
+ # Construct a model instance of LoadBalancerListenerCollection by calling from_dict on the json representation
+ load_balancer_listener_collection_model_dict = LoadBalancerListenerCollection.from_dict(load_balancer_listener_collection_model_json).__dict__
+ load_balancer_listener_collection_model2 = LoadBalancerListenerCollection(**load_balancer_listener_collection_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_gpu_model_model == instance_profile_gpu_model_model2
+ assert load_balancer_listener_collection_model == load_balancer_listener_collection_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_gpu_model_model_json2 = instance_profile_gpu_model_model.to_dict()
- assert instance_profile_gpu_model_model_json2 == instance_profile_gpu_model_model_json
+ load_balancer_listener_collection_model_json2 = load_balancer_listener_collection_model.to_dict()
+ assert load_balancer_listener_collection_model_json2 == load_balancer_listener_collection_model_json
-class TestModel_InstanceProfileOSArchitecture():
+class TestModel_LoadBalancerListenerHTTPSRedirect():
"""
- Test Class for InstanceProfileOSArchitecture
+ Test Class for LoadBalancerListenerHTTPSRedirect
"""
- def test_instance_profile_os_architecture_serialization(self):
+ def test_load_balancer_listener_https_redirect_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileOSArchitecture
+ Test serialization/deserialization for LoadBalancerListenerHTTPSRedirect
"""
- # Construct a json representation of a InstanceProfileOSArchitecture model
- instance_profile_os_architecture_model_json = {}
- instance_profile_os_architecture_model_json['default'] = 'testString'
- instance_profile_os_architecture_model_json['type'] = 'enum'
- instance_profile_os_architecture_model_json['values'] = ['amd64']
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileOSArchitecture by calling from_dict on the json representation
- instance_profile_os_architecture_model = InstanceProfileOSArchitecture.from_dict(instance_profile_os_architecture_model_json)
- assert instance_profile_os_architecture_model != False
+ load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
+ load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceProfileOSArchitecture by calling from_dict on the json representation
- instance_profile_os_architecture_model_dict = InstanceProfileOSArchitecture.from_dict(instance_profile_os_architecture_model_json).__dict__
- instance_profile_os_architecture_model2 = InstanceProfileOSArchitecture(**instance_profile_os_architecture_model_dict)
+ load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
+ load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
+ load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a json representation of a LoadBalancerListenerHTTPSRedirect model
+ load_balancer_listener_https_redirect_model_json = {}
+ load_balancer_listener_https_redirect_model_json['http_status_code'] = 301
+ load_balancer_listener_https_redirect_model_json['listener'] = load_balancer_listener_reference_model
+ load_balancer_listener_https_redirect_model_json['uri'] = '/example?doc=get'
+
+ # Construct a model instance of LoadBalancerListenerHTTPSRedirect by calling from_dict on the json representation
+ load_balancer_listener_https_redirect_model = LoadBalancerListenerHTTPSRedirect.from_dict(load_balancer_listener_https_redirect_model_json)
+ assert load_balancer_listener_https_redirect_model != False
+
+ # Construct a model instance of LoadBalancerListenerHTTPSRedirect by calling from_dict on the json representation
+ load_balancer_listener_https_redirect_model_dict = LoadBalancerListenerHTTPSRedirect.from_dict(load_balancer_listener_https_redirect_model_json).__dict__
+ load_balancer_listener_https_redirect_model2 = LoadBalancerListenerHTTPSRedirect(**load_balancer_listener_https_redirect_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_os_architecture_model == instance_profile_os_architecture_model2
+ assert load_balancer_listener_https_redirect_model == load_balancer_listener_https_redirect_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_os_architecture_model_json2 = instance_profile_os_architecture_model.to_dict()
- assert instance_profile_os_architecture_model_json2 == instance_profile_os_architecture_model_json
+ load_balancer_listener_https_redirect_model_json2 = load_balancer_listener_https_redirect_model.to_dict()
+ assert load_balancer_listener_https_redirect_model_json2 == load_balancer_listener_https_redirect_model_json
-class TestModel_InstanceProfileReference():
+class TestModel_LoadBalancerListenerHTTPSRedirectPatch():
"""
- Test Class for InstanceProfileReference
+ Test Class for LoadBalancerListenerHTTPSRedirectPatch
"""
- def test_instance_profile_reference_serialization(self):
+ def test_load_balancer_listener_https_redirect_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileReference
+ Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPatch
"""
- # Construct a json representation of a InstanceProfileReference model
- instance_profile_reference_model_json = {}
- instance_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/profiles/bc1-4x16'
- instance_profile_reference_model_json['name'] = 'bc1-4x16'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileReference by calling from_dict on the json representation
- instance_profile_reference_model = InstanceProfileReference.from_dict(instance_profile_reference_model_json)
- assert instance_profile_reference_model != False
+ load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of InstanceProfileReference by calling from_dict on the json representation
- instance_profile_reference_model_dict = InstanceProfileReference.from_dict(instance_profile_reference_model_json).__dict__
- instance_profile_reference_model2 = InstanceProfileReference(**instance_profile_reference_model_dict)
+ # Construct a json representation of a LoadBalancerListenerHTTPSRedirectPatch model
+ load_balancer_listener_https_redirect_patch_model_json = {}
+ load_balancer_listener_https_redirect_patch_model_json['http_status_code'] = 301
+ load_balancer_listener_https_redirect_patch_model_json['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_https_redirect_patch_model_json['uri'] = '/example?doc=get'
+
+ # Construct a model instance of LoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation
+ load_balancer_listener_https_redirect_patch_model = LoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_https_redirect_patch_model_json)
+ assert load_balancer_listener_https_redirect_patch_model != False
+
+ # Construct a model instance of LoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation
+ load_balancer_listener_https_redirect_patch_model_dict = LoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_https_redirect_patch_model_json).__dict__
+ load_balancer_listener_https_redirect_patch_model2 = LoadBalancerListenerHTTPSRedirectPatch(**load_balancer_listener_https_redirect_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_reference_model == instance_profile_reference_model2
+ assert load_balancer_listener_https_redirect_patch_model == load_balancer_listener_https_redirect_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_reference_model_json2 = instance_profile_reference_model.to_dict()
- assert instance_profile_reference_model_json2 == instance_profile_reference_model_json
+ load_balancer_listener_https_redirect_patch_model_json2 = load_balancer_listener_https_redirect_patch_model.to_dict()
+ assert load_balancer_listener_https_redirect_patch_model_json2 == load_balancer_listener_https_redirect_patch_model_json
-class TestModel_InstanceProfileVCPUArchitecture():
+class TestModel_LoadBalancerListenerHTTPSRedirectPrototype():
"""
- Test Class for InstanceProfileVCPUArchitecture
+ Test Class for LoadBalancerListenerHTTPSRedirectPrototype
"""
- def test_instance_profile_vcpu_architecture_serialization(self):
+ def test_load_balancer_listener_https_redirect_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceProfileVCPUArchitecture
+ Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPrototype
"""
- # Construct a json representation of a InstanceProfileVCPUArchitecture model
- instance_profile_vcpu_architecture_model_json = {}
- instance_profile_vcpu_architecture_model_json['default'] = 'testString'
- instance_profile_vcpu_architecture_model_json['type'] = 'fixed'
- instance_profile_vcpu_architecture_model_json['value'] = 'amd64'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceProfileVCPUArchitecture by calling from_dict on the json representation
- instance_profile_vcpu_architecture_model = InstanceProfileVCPUArchitecture.from_dict(instance_profile_vcpu_architecture_model_json)
- assert instance_profile_vcpu_architecture_model != False
+ load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of InstanceProfileVCPUArchitecture by calling from_dict on the json representation
- instance_profile_vcpu_architecture_model_dict = InstanceProfileVCPUArchitecture.from_dict(instance_profile_vcpu_architecture_model_json).__dict__
- instance_profile_vcpu_architecture_model2 = InstanceProfileVCPUArchitecture(**instance_profile_vcpu_architecture_model_dict)
+ # Construct a json representation of a LoadBalancerListenerHTTPSRedirectPrototype model
+ load_balancer_listener_https_redirect_prototype_model_json = {}
+ load_balancer_listener_https_redirect_prototype_model_json['http_status_code'] = 301
+ load_balancer_listener_https_redirect_prototype_model_json['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_https_redirect_prototype_model_json['uri'] = '/example?doc=get'
+
+ # Construct a model instance of LoadBalancerListenerHTTPSRedirectPrototype by calling from_dict on the json representation
+ load_balancer_listener_https_redirect_prototype_model = LoadBalancerListenerHTTPSRedirectPrototype.from_dict(load_balancer_listener_https_redirect_prototype_model_json)
+ assert load_balancer_listener_https_redirect_prototype_model != False
+
+ # Construct a model instance of LoadBalancerListenerHTTPSRedirectPrototype by calling from_dict on the json representation
+ load_balancer_listener_https_redirect_prototype_model_dict = LoadBalancerListenerHTTPSRedirectPrototype.from_dict(load_balancer_listener_https_redirect_prototype_model_json).__dict__
+ load_balancer_listener_https_redirect_prototype_model2 = LoadBalancerListenerHTTPSRedirectPrototype(**load_balancer_listener_https_redirect_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_profile_vcpu_architecture_model == instance_profile_vcpu_architecture_model2
+ assert load_balancer_listener_https_redirect_prototype_model == load_balancer_listener_https_redirect_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_profile_vcpu_architecture_model_json2 = instance_profile_vcpu_architecture_model.to_dict()
- assert instance_profile_vcpu_architecture_model_json2 == instance_profile_vcpu_architecture_model_json
+ load_balancer_listener_https_redirect_prototype_model_json2 = load_balancer_listener_https_redirect_prototype_model.to_dict()
+ assert load_balancer_listener_https_redirect_prototype_model_json2 == load_balancer_listener_https_redirect_prototype_model_json
-class TestModel_InstanceReference():
+class TestModel_LoadBalancerListenerPatch():
"""
- Test Class for InstanceReference
+ Test Class for LoadBalancerListenerPatch
"""
- def test_instance_reference_serialization(self):
+ def test_load_balancer_listener_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceReference
+ Test serialization/deserialization for LoadBalancerListenerPatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN
+ certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
- # Construct a json representation of a InstanceReference model
- instance_reference_model_json = {}
- instance_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model_json['deleted'] = instance_reference_deleted_model
- instance_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model_json['name'] = 'my-instance'
+ load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById
+ load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of InstanceReference by calling from_dict on the json representation
- instance_reference_model = InstanceReference.from_dict(instance_reference_model_json)
- assert instance_reference_model != False
+ load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
+ load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of InstanceReference by calling from_dict on the json representation
- instance_reference_model_dict = InstanceReference.from_dict(instance_reference_model_json).__dict__
- instance_reference_model2 = InstanceReference(**instance_reference_model_dict)
+ load_balancer_listener_https_redirect_patch_model = {} # LoadBalancerListenerHTTPSRedirectPatch
+ load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301
+ load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model
+ load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get'
+
+ # Construct a json representation of a LoadBalancerListenerPatch model
+ load_balancer_listener_patch_model_json = {}
+ load_balancer_listener_patch_model_json['accept_proxy_protocol'] = True
+ load_balancer_listener_patch_model_json['certificate_instance'] = certificate_instance_identity_model
+ load_balancer_listener_patch_model_json['connection_limit'] = 2000
+ load_balancer_listener_patch_model_json['default_pool'] = load_balancer_pool_identity_model
+ load_balancer_listener_patch_model_json['https_redirect'] = load_balancer_listener_https_redirect_patch_model
+ load_balancer_listener_patch_model_json['port'] = 443
+ load_balancer_listener_patch_model_json['port_max'] = 499
+ load_balancer_listener_patch_model_json['port_min'] = 443
+ load_balancer_listener_patch_model_json['protocol'] = 'http'
+
+ # Construct a model instance of LoadBalancerListenerPatch by calling from_dict on the json representation
+ load_balancer_listener_patch_model = LoadBalancerListenerPatch.from_dict(load_balancer_listener_patch_model_json)
+ assert load_balancer_listener_patch_model != False
+
+ # Construct a model instance of LoadBalancerListenerPatch by calling from_dict on the json representation
+ load_balancer_listener_patch_model_dict = LoadBalancerListenerPatch.from_dict(load_balancer_listener_patch_model_json).__dict__
+ load_balancer_listener_patch_model2 = LoadBalancerListenerPatch(**load_balancer_listener_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_reference_model == instance_reference_model2
+ assert load_balancer_listener_patch_model == load_balancer_listener_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_reference_model_json2 = instance_reference_model.to_dict()
- assert instance_reference_model_json2 == instance_reference_model_json
+ load_balancer_listener_patch_model_json2 = load_balancer_listener_patch_model.to_dict()
+ assert load_balancer_listener_patch_model_json2 == load_balancer_listener_patch_model_json
-class TestModel_InstanceReferenceDeleted():
+class TestModel_LoadBalancerListenerPolicy():
"""
- Test Class for InstanceReferenceDeleted
+ Test Class for LoadBalancerListenerPolicy
"""
- def test_instance_reference_deleted_serialization(self):
+ def test_load_balancer_listener_policy_serialization(self):
"""
- Test serialization/deserialization for InstanceReferenceDeleted
+ Test serialization/deserialization for LoadBalancerListenerPolicy
"""
- # Construct a json representation of a InstanceReferenceDeleted model
- instance_reference_deleted_model_json = {}
- instance_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceReferenceDeleted by calling from_dict on the json representation
- instance_reference_deleted_model = InstanceReferenceDeleted.from_dict(instance_reference_deleted_model_json)
- assert instance_reference_deleted_model != False
+ load_balancer_listener_policy_rule_reference_deleted_model = {} # LoadBalancerListenerPolicyRuleReferenceDeleted
+ load_balancer_listener_policy_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceReferenceDeleted by calling from_dict on the json representation
- instance_reference_deleted_model_dict = InstanceReferenceDeleted.from_dict(instance_reference_deleted_model_json).__dict__
- instance_reference_deleted_model2 = InstanceReferenceDeleted(**instance_reference_deleted_model_dict)
+ load_balancer_listener_policy_rule_reference_model = {} # LoadBalancerListenerPolicyRuleReference
+ load_balancer_listener_policy_rule_reference_model['deleted'] = load_balancer_listener_policy_rule_reference_deleted_model
+ load_balancer_listener_policy_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
+ load_balancer_listener_policy_rule_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_listener_policy_target_model = {} # LoadBalancerListenerPolicyTargetLoadBalancerPoolReference
+ load_balancer_listener_policy_target_model['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_listener_policy_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_policy_target_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_policy_target_model['name'] = 'my-load-balancer-pool'
+
+ # Construct a json representation of a LoadBalancerListenerPolicy model
+ load_balancer_listener_policy_model_json = {}
+ load_balancer_listener_policy_model_json['action'] = 'forward'
+ load_balancer_listener_policy_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_listener_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
+ load_balancer_listener_policy_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_policy_model_json['name'] = 'my-policy'
+ load_balancer_listener_policy_model_json['priority'] = 5
+ load_balancer_listener_policy_model_json['provisioning_status'] = 'active'
+ load_balancer_listener_policy_model_json['rules'] = [load_balancer_listener_policy_rule_reference_model]
+ load_balancer_listener_policy_model_json['target'] = load_balancer_listener_policy_target_model
+
+ # Construct a model instance of LoadBalancerListenerPolicy by calling from_dict on the json representation
+ load_balancer_listener_policy_model = LoadBalancerListenerPolicy.from_dict(load_balancer_listener_policy_model_json)
+ assert load_balancer_listener_policy_model != False
+
+ # Construct a model instance of LoadBalancerListenerPolicy by calling from_dict on the json representation
+ load_balancer_listener_policy_model_dict = LoadBalancerListenerPolicy.from_dict(load_balancer_listener_policy_model_json).__dict__
+ load_balancer_listener_policy_model2 = LoadBalancerListenerPolicy(**load_balancer_listener_policy_model_dict)
# Verify the model instances are equivalent
- assert instance_reference_deleted_model == instance_reference_deleted_model2
+ assert load_balancer_listener_policy_model == load_balancer_listener_policy_model2
# Convert model instance back to dict and verify no loss of data
- instance_reference_deleted_model_json2 = instance_reference_deleted_model.to_dict()
- assert instance_reference_deleted_model_json2 == instance_reference_deleted_model_json
+ load_balancer_listener_policy_model_json2 = load_balancer_listener_policy_model.to_dict()
+ assert load_balancer_listener_policy_model_json2 == load_balancer_listener_policy_model_json
-class TestModel_InstanceStatusReason():
+class TestModel_LoadBalancerListenerPolicyCollection():
"""
- Test Class for InstanceStatusReason
+ Test Class for LoadBalancerListenerPolicyCollection
"""
- def test_instance_status_reason_serialization(self):
+ def test_load_balancer_listener_policy_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceStatusReason
+ Test serialization/deserialization for LoadBalancerListenerPolicyCollection
"""
- # Construct a json representation of a InstanceStatusReason model
- instance_status_reason_model_json = {}
- instance_status_reason_model_json['code'] = 'cannot_start_storage'
- instance_status_reason_model_json['message'] = 'The virtual server instance is unusable because the encryption key for the boot volume\nhas been deleted'
- instance_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceStatusReason by calling from_dict on the json representation
- instance_status_reason_model = InstanceStatusReason.from_dict(instance_status_reason_model_json)
- assert instance_status_reason_model != False
+ load_balancer_listener_policy_rule_reference_deleted_model = {} # LoadBalancerListenerPolicyRuleReferenceDeleted
+ load_balancer_listener_policy_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceStatusReason by calling from_dict on the json representation
- instance_status_reason_model_dict = InstanceStatusReason.from_dict(instance_status_reason_model_json).__dict__
- instance_status_reason_model2 = InstanceStatusReason(**instance_status_reason_model_dict)
+ load_balancer_listener_policy_rule_reference_model = {} # LoadBalancerListenerPolicyRuleReference
+ load_balancer_listener_policy_rule_reference_model['deleted'] = load_balancer_listener_policy_rule_reference_deleted_model
+ load_balancer_listener_policy_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
+ load_balancer_listener_policy_rule_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
+ load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_listener_policy_target_model = {} # LoadBalancerListenerPolicyTargetLoadBalancerPoolReference
+ load_balancer_listener_policy_target_model['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_listener_policy_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_policy_target_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_policy_target_model['name'] = 'my-load-balancer-pool'
+
+ load_balancer_listener_policy_model = {} # LoadBalancerListenerPolicy
+ load_balancer_listener_policy_model['action'] = 'forward'
+ load_balancer_listener_policy_model['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_listener_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
+ load_balancer_listener_policy_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_policy_model['name'] = 'my-policy'
+ load_balancer_listener_policy_model['priority'] = 5
+ load_balancer_listener_policy_model['provisioning_status'] = 'active'
+ load_balancer_listener_policy_model['rules'] = [load_balancer_listener_policy_rule_reference_model]
+ load_balancer_listener_policy_model['target'] = load_balancer_listener_policy_target_model
+
+ # Construct a json representation of a LoadBalancerListenerPolicyCollection model
+ load_balancer_listener_policy_collection_model_json = {}
+ load_balancer_listener_policy_collection_model_json['policies'] = [load_balancer_listener_policy_model]
+
+ # Construct a model instance of LoadBalancerListenerPolicyCollection by calling from_dict on the json representation
+ load_balancer_listener_policy_collection_model = LoadBalancerListenerPolicyCollection.from_dict(load_balancer_listener_policy_collection_model_json)
+ assert load_balancer_listener_policy_collection_model != False
+
+ # Construct a model instance of LoadBalancerListenerPolicyCollection by calling from_dict on the json representation
+ load_balancer_listener_policy_collection_model_dict = LoadBalancerListenerPolicyCollection.from_dict(load_balancer_listener_policy_collection_model_json).__dict__
+ load_balancer_listener_policy_collection_model2 = LoadBalancerListenerPolicyCollection(**load_balancer_listener_policy_collection_model_dict)
# Verify the model instances are equivalent
- assert instance_status_reason_model == instance_status_reason_model2
+ assert load_balancer_listener_policy_collection_model == load_balancer_listener_policy_collection_model2
# Convert model instance back to dict and verify no loss of data
- instance_status_reason_model_json2 = instance_status_reason_model.to_dict()
- assert instance_status_reason_model_json2 == instance_status_reason_model_json
+ load_balancer_listener_policy_collection_model_json2 = load_balancer_listener_policy_collection_model.to_dict()
+ assert load_balancer_listener_policy_collection_model_json2 == load_balancer_listener_policy_collection_model_json
-class TestModel_InstanceTemplateCollection():
+class TestModel_LoadBalancerListenerPolicyPatch():
"""
- Test Class for InstanceTemplateCollection
+ Test Class for LoadBalancerListenerPolicyPatch
"""
- def test_instance_template_collection_serialization(self):
+ def test_load_balancer_listener_policy_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateCollection
+ Test serialization/deserialization for LoadBalancerListenerPolicyPatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_template_collection_first_model = {} # InstanceTemplateCollectionFirst
- instance_template_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20'
-
- instance_template_collection_next_model = {} # InstanceTemplateCollectionNext
- instance_template_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- key_identity_model = {} # KeyIdentityById
- key_identity_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- network_interface_prototype_model = {} # NetworkInterfacePrototype
- network_interface_prototype_model['allow_ip_spoofing'] = True
- network_interface_prototype_model['name'] = 'my-network-interface'
- network_interface_prototype_model['primary_ipv4_address'] = '10.0.0.5'
- network_interface_prototype_model['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model['subnet'] = subnet_identity_model
-
- instance_placement_target_prototype_model = {} # InstancePlacementTargetPrototypeDedicatedHostIdentityDedicatedHostIdentityById
- instance_placement_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- instance_profile_identity_model = {} # InstanceProfileIdentityByName
- instance_profile_identity_model['name'] = 'cc1-16x32'
-
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ load_balancer_listener_policy_target_patch_model = {} # LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById
+ load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById
- volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ # Construct a json representation of a LoadBalancerListenerPolicyPatch model
+ load_balancer_listener_policy_patch_model_json = {}
+ load_balancer_listener_policy_patch_model_json['name'] = 'my-policy'
+ load_balancer_listener_policy_patch_model_json['priority'] = 5
+ load_balancer_listener_policy_patch_model_json['target'] = load_balancer_listener_policy_target_patch_model
- volume_attachment_prototype_instance_context_model = {} # VolumeAttachmentPrototypeInstanceContext
- volume_attachment_prototype_instance_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_context_model['volume'] = volume_attachment_volume_prototype_instance_context_model
+ # Construct a model instance of LoadBalancerListenerPolicyPatch by calling from_dict on the json representation
+ load_balancer_listener_policy_patch_model = LoadBalancerListenerPolicyPatch.from_dict(load_balancer_listener_policy_patch_model_json)
+ assert load_balancer_listener_policy_patch_model != False
- vpc_identity_model = {} # VPCIdentityById
- vpc_identity_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ # Construct a model instance of LoadBalancerListenerPolicyPatch by calling from_dict on the json representation
+ load_balancer_listener_policy_patch_model_dict = LoadBalancerListenerPolicyPatch.from_dict(load_balancer_listener_policy_patch_model_json).__dict__
+ load_balancer_listener_policy_patch_model2 = LoadBalancerListenerPolicyPatch(**load_balancer_listener_policy_patch_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert load_balancer_listener_policy_patch_model == load_balancer_listener_policy_patch_model2
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_listener_policy_patch_model_json2 = load_balancer_listener_policy_patch_model.to_dict()
+ assert load_balancer_listener_policy_patch_model_json2 == load_balancer_listener_policy_patch_model_json
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 38
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+class TestModel_LoadBalancerListenerPolicyPrototype():
+ """
+ Test Class for LoadBalancerListenerPolicyPrototype
+ """
- volume_attachment_prototype_instance_by_image_context_model = {} # VolumeAttachmentPrototypeInstanceByImageContext
- volume_attachment_prototype_instance_by_image_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_image_context_model['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_image_context_model['volume'] = volume_prototype_instance_by_image_context_model
+ def test_load_balancer_listener_policy_prototype_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerListenerPolicyPrototype
+ """
- image_identity_model = {} # ImageIdentityById
- image_identity_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ # Construct dict forms of any model objects needed in order to build this model.
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ load_balancer_listener_policy_rule_prototype_model = {} # LoadBalancerListenerPolicyRulePrototype
+ load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
+ load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
+ load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
- instance_template_model = {} # InstanceTemplateInstanceByImage
- instance_template_model['created_at'] = "2019-01-01T12:00:00Z"
- instance_template_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- instance_template_model['keys'] = [key_identity_model]
- instance_template_model['name'] = 'my-instance-template'
- instance_template_model['network_interfaces'] = [network_interface_prototype_model]
- instance_template_model['placement_target'] = instance_placement_target_prototype_model
- instance_template_model['profile'] = instance_profile_identity_model
- instance_template_model['resource_group'] = resource_group_reference_model
- instance_template_model['total_volume_bandwidth'] = 500
- instance_template_model['user_data'] = 'testString'
- instance_template_model['volume_attachments'] = [volume_attachment_prototype_instance_context_model]
- instance_template_model['vpc'] = vpc_identity_model
- instance_template_model['boot_volume_attachment'] = volume_attachment_prototype_instance_by_image_context_model
- instance_template_model['image'] = image_identity_model
- instance_template_model['primary_network_interface'] = network_interface_prototype_model
- instance_template_model['zone'] = zone_identity_model
+ load_balancer_listener_policy_target_prototype_model = {} # LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById
+ load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a json representation of a InstanceTemplateCollection model
- instance_template_collection_model_json = {}
- instance_template_collection_model_json['first'] = instance_template_collection_first_model
- instance_template_collection_model_json['limit'] = 20
- instance_template_collection_model_json['next'] = instance_template_collection_next_model
- instance_template_collection_model_json['templates'] = [instance_template_model]
- instance_template_collection_model_json['total_count'] = 132
+ # Construct a json representation of a LoadBalancerListenerPolicyPrototype model
+ load_balancer_listener_policy_prototype_model_json = {}
+ load_balancer_listener_policy_prototype_model_json['action'] = 'forward'
+ load_balancer_listener_policy_prototype_model_json['name'] = 'my-policy'
+ load_balancer_listener_policy_prototype_model_json['priority'] = 5
+ load_balancer_listener_policy_prototype_model_json['rules'] = [load_balancer_listener_policy_rule_prototype_model]
+ load_balancer_listener_policy_prototype_model_json['target'] = load_balancer_listener_policy_target_prototype_model
- # Construct a model instance of InstanceTemplateCollection by calling from_dict on the json representation
- instance_template_collection_model = InstanceTemplateCollection.from_dict(instance_template_collection_model_json)
- assert instance_template_collection_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyPrototype by calling from_dict on the json representation
+ load_balancer_listener_policy_prototype_model = LoadBalancerListenerPolicyPrototype.from_dict(load_balancer_listener_policy_prototype_model_json)
+ assert load_balancer_listener_policy_prototype_model != False
- # Construct a model instance of InstanceTemplateCollection by calling from_dict on the json representation
- instance_template_collection_model_dict = InstanceTemplateCollection.from_dict(instance_template_collection_model_json).__dict__
- instance_template_collection_model2 = InstanceTemplateCollection(**instance_template_collection_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyPrototype by calling from_dict on the json representation
+ load_balancer_listener_policy_prototype_model_dict = LoadBalancerListenerPolicyPrototype.from_dict(load_balancer_listener_policy_prototype_model_json).__dict__
+ load_balancer_listener_policy_prototype_model2 = LoadBalancerListenerPolicyPrototype(**load_balancer_listener_policy_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_template_collection_model == instance_template_collection_model2
+ assert load_balancer_listener_policy_prototype_model == load_balancer_listener_policy_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_collection_model_json2 = instance_template_collection_model.to_dict()
- assert instance_template_collection_model_json2 == instance_template_collection_model_json
+ load_balancer_listener_policy_prototype_model_json2 = load_balancer_listener_policy_prototype_model.to_dict()
+ assert load_balancer_listener_policy_prototype_model_json2 == load_balancer_listener_policy_prototype_model_json
-class TestModel_InstanceTemplateCollectionFirst():
+class TestModel_LoadBalancerListenerPolicyReference():
"""
- Test Class for InstanceTemplateCollectionFirst
+ Test Class for LoadBalancerListenerPolicyReference
"""
- def test_instance_template_collection_first_serialization(self):
+ def test_load_balancer_listener_policy_reference_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateCollectionFirst
+ Test serialization/deserialization for LoadBalancerListenerPolicyReference
"""
- # Construct a json representation of a InstanceTemplateCollectionFirst model
- instance_template_collection_first_model_json = {}
- instance_template_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of InstanceTemplateCollectionFirst by calling from_dict on the json representation
- instance_template_collection_first_model = InstanceTemplateCollectionFirst.from_dict(instance_template_collection_first_model_json)
- assert instance_template_collection_first_model != False
+ load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted
+ load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceTemplateCollectionFirst by calling from_dict on the json representation
- instance_template_collection_first_model_dict = InstanceTemplateCollectionFirst.from_dict(instance_template_collection_first_model_json).__dict__
- instance_template_collection_first_model2 = InstanceTemplateCollectionFirst(**instance_template_collection_first_model_dict)
+ # Construct a json representation of a LoadBalancerListenerPolicyReference model
+ load_balancer_listener_policy_reference_model_json = {}
+ load_balancer_listener_policy_reference_model_json['deleted'] = load_balancer_listener_policy_reference_deleted_model
+ load_balancer_listener_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
+ load_balancer_listener_policy_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a model instance of LoadBalancerListenerPolicyReference by calling from_dict on the json representation
+ load_balancer_listener_policy_reference_model = LoadBalancerListenerPolicyReference.from_dict(load_balancer_listener_policy_reference_model_json)
+ assert load_balancer_listener_policy_reference_model != False
+
+ # Construct a model instance of LoadBalancerListenerPolicyReference by calling from_dict on the json representation
+ load_balancer_listener_policy_reference_model_dict = LoadBalancerListenerPolicyReference.from_dict(load_balancer_listener_policy_reference_model_json).__dict__
+ load_balancer_listener_policy_reference_model2 = LoadBalancerListenerPolicyReference(**load_balancer_listener_policy_reference_model_dict)
# Verify the model instances are equivalent
- assert instance_template_collection_first_model == instance_template_collection_first_model2
+ assert load_balancer_listener_policy_reference_model == load_balancer_listener_policy_reference_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_collection_first_model_json2 = instance_template_collection_first_model.to_dict()
- assert instance_template_collection_first_model_json2 == instance_template_collection_first_model_json
+ load_balancer_listener_policy_reference_model_json2 = load_balancer_listener_policy_reference_model.to_dict()
+ assert load_balancer_listener_policy_reference_model_json2 == load_balancer_listener_policy_reference_model_json
-class TestModel_InstanceTemplateCollectionNext():
+class TestModel_LoadBalancerListenerPolicyReferenceDeleted():
"""
- Test Class for InstanceTemplateCollectionNext
+ Test Class for LoadBalancerListenerPolicyReferenceDeleted
"""
- def test_instance_template_collection_next_serialization(self):
+ def test_load_balancer_listener_policy_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateCollectionNext
+ Test serialization/deserialization for LoadBalancerListenerPolicyReferenceDeleted
"""
- # Construct a json representation of a InstanceTemplateCollectionNext model
- instance_template_collection_next_model_json = {}
- instance_template_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a LoadBalancerListenerPolicyReferenceDeleted model
+ load_balancer_listener_policy_reference_deleted_model_json = {}
+ load_balancer_listener_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of InstanceTemplateCollectionNext by calling from_dict on the json representation
- instance_template_collection_next_model = InstanceTemplateCollectionNext.from_dict(instance_template_collection_next_model_json)
- assert instance_template_collection_next_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyReferenceDeleted by calling from_dict on the json representation
+ load_balancer_listener_policy_reference_deleted_model = LoadBalancerListenerPolicyReferenceDeleted.from_dict(load_balancer_listener_policy_reference_deleted_model_json)
+ assert load_balancer_listener_policy_reference_deleted_model != False
- # Construct a model instance of InstanceTemplateCollectionNext by calling from_dict on the json representation
- instance_template_collection_next_model_dict = InstanceTemplateCollectionNext.from_dict(instance_template_collection_next_model_json).__dict__
- instance_template_collection_next_model2 = InstanceTemplateCollectionNext(**instance_template_collection_next_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyReferenceDeleted by calling from_dict on the json representation
+ load_balancer_listener_policy_reference_deleted_model_dict = LoadBalancerListenerPolicyReferenceDeleted.from_dict(load_balancer_listener_policy_reference_deleted_model_json).__dict__
+ load_balancer_listener_policy_reference_deleted_model2 = LoadBalancerListenerPolicyReferenceDeleted(**load_balancer_listener_policy_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert instance_template_collection_next_model == instance_template_collection_next_model2
+ assert load_balancer_listener_policy_reference_deleted_model == load_balancer_listener_policy_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_collection_next_model_json2 = instance_template_collection_next_model.to_dict()
- assert instance_template_collection_next_model_json2 == instance_template_collection_next_model_json
+ load_balancer_listener_policy_reference_deleted_model_json2 = load_balancer_listener_policy_reference_deleted_model.to_dict()
+ assert load_balancer_listener_policy_reference_deleted_model_json2 == load_balancer_listener_policy_reference_deleted_model_json
-class TestModel_InstanceTemplatePatch():
+class TestModel_LoadBalancerListenerPolicyRule():
"""
- Test Class for InstanceTemplatePatch
+ Test Class for LoadBalancerListenerPolicyRule
"""
- def test_instance_template_patch_serialization(self):
+ def test_load_balancer_listener_policy_rule_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplatePatch
+ Test serialization/deserialization for LoadBalancerListenerPolicyRule
"""
- # Construct a json representation of a InstanceTemplatePatch model
- instance_template_patch_model_json = {}
- instance_template_patch_model_json['name'] = 'my-instance-template'
+ # Construct a json representation of a LoadBalancerListenerPolicyRule model
+ load_balancer_listener_policy_rule_model_json = {}
+ load_balancer_listener_policy_rule_model_json['condition'] = 'contains'
+ load_balancer_listener_policy_rule_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_listener_policy_rule_model_json['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
+ load_balancer_listener_policy_rule_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_policy_rule_model_json['provisioning_status'] = 'active'
+ load_balancer_listener_policy_rule_model_json['type'] = 'body'
+ load_balancer_listener_policy_rule_model_json['value'] = 'testString'
- # Construct a model instance of InstanceTemplatePatch by calling from_dict on the json representation
- instance_template_patch_model = InstanceTemplatePatch.from_dict(instance_template_patch_model_json)
- assert instance_template_patch_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyRule by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_model = LoadBalancerListenerPolicyRule.from_dict(load_balancer_listener_policy_rule_model_json)
+ assert load_balancer_listener_policy_rule_model != False
- # Construct a model instance of InstanceTemplatePatch by calling from_dict on the json representation
- instance_template_patch_model_dict = InstanceTemplatePatch.from_dict(instance_template_patch_model_json).__dict__
- instance_template_patch_model2 = InstanceTemplatePatch(**instance_template_patch_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyRule by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_model_dict = LoadBalancerListenerPolicyRule.from_dict(load_balancer_listener_policy_rule_model_json).__dict__
+ load_balancer_listener_policy_rule_model2 = LoadBalancerListenerPolicyRule(**load_balancer_listener_policy_rule_model_dict)
# Verify the model instances are equivalent
- assert instance_template_patch_model == instance_template_patch_model2
+ assert load_balancer_listener_policy_rule_model == load_balancer_listener_policy_rule_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_patch_model_json2 = instance_template_patch_model.to_dict()
- assert instance_template_patch_model_json2 == instance_template_patch_model_json
+ load_balancer_listener_policy_rule_model_json2 = load_balancer_listener_policy_rule_model.to_dict()
+ assert load_balancer_listener_policy_rule_model_json2 == load_balancer_listener_policy_rule_model_json
-class TestModel_InstanceTemplateReference():
+class TestModel_LoadBalancerListenerPolicyRuleCollection():
"""
- Test Class for InstanceTemplateReference
+ Test Class for LoadBalancerListenerPolicyRuleCollection
"""
- def test_instance_template_reference_serialization(self):
+ def test_load_balancer_listener_policy_rule_collection_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateReference
+ Test serialization/deserialization for LoadBalancerListenerPolicyRuleCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_template_reference_deleted_model = {} # InstanceTemplateReferenceDeleted
- instance_template_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ load_balancer_listener_policy_rule_model = {} # LoadBalancerListenerPolicyRule
+ load_balancer_listener_policy_rule_model['condition'] = 'contains'
+ load_balancer_listener_policy_rule_model['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_listener_policy_rule_model['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
+ load_balancer_listener_policy_rule_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_policy_rule_model['provisioning_status'] = 'active'
+ load_balancer_listener_policy_rule_model['type'] = 'body'
+ load_balancer_listener_policy_rule_model['value'] = 'testString'
- # Construct a json representation of a InstanceTemplateReference model
- instance_template_reference_model_json = {}
- instance_template_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-template:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_reference_model_json['deleted'] = instance_template_reference_deleted_model
- instance_template_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance/templates/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_template_reference_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- instance_template_reference_model_json['name'] = 'my-instance-template'
+ # Construct a json representation of a LoadBalancerListenerPolicyRuleCollection model
+ load_balancer_listener_policy_rule_collection_model_json = {}
+ load_balancer_listener_policy_rule_collection_model_json['rules'] = [load_balancer_listener_policy_rule_model]
- # Construct a model instance of InstanceTemplateReference by calling from_dict on the json representation
- instance_template_reference_model = InstanceTemplateReference.from_dict(instance_template_reference_model_json)
- assert instance_template_reference_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyRuleCollection by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_collection_model = LoadBalancerListenerPolicyRuleCollection.from_dict(load_balancer_listener_policy_rule_collection_model_json)
+ assert load_balancer_listener_policy_rule_collection_model != False
- # Construct a model instance of InstanceTemplateReference by calling from_dict on the json representation
- instance_template_reference_model_dict = InstanceTemplateReference.from_dict(instance_template_reference_model_json).__dict__
- instance_template_reference_model2 = InstanceTemplateReference(**instance_template_reference_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyRuleCollection by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_collection_model_dict = LoadBalancerListenerPolicyRuleCollection.from_dict(load_balancer_listener_policy_rule_collection_model_json).__dict__
+ load_balancer_listener_policy_rule_collection_model2 = LoadBalancerListenerPolicyRuleCollection(**load_balancer_listener_policy_rule_collection_model_dict)
# Verify the model instances are equivalent
- assert instance_template_reference_model == instance_template_reference_model2
+ assert load_balancer_listener_policy_rule_collection_model == load_balancer_listener_policy_rule_collection_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_reference_model_json2 = instance_template_reference_model.to_dict()
- assert instance_template_reference_model_json2 == instance_template_reference_model_json
+ load_balancer_listener_policy_rule_collection_model_json2 = load_balancer_listener_policy_rule_collection_model.to_dict()
+ assert load_balancer_listener_policy_rule_collection_model_json2 == load_balancer_listener_policy_rule_collection_model_json
-class TestModel_InstanceTemplateReferenceDeleted():
+class TestModel_LoadBalancerListenerPolicyRulePatch():
"""
- Test Class for InstanceTemplateReferenceDeleted
+ Test Class for LoadBalancerListenerPolicyRulePatch
"""
- def test_instance_template_reference_deleted_serialization(self):
+ def test_load_balancer_listener_policy_rule_patch_serialization(self):
"""
- Test serialization/deserialization for InstanceTemplateReferenceDeleted
+ Test serialization/deserialization for LoadBalancerListenerPolicyRulePatch
"""
- # Construct a json representation of a InstanceTemplateReferenceDeleted model
- instance_template_reference_deleted_model_json = {}
- instance_template_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a LoadBalancerListenerPolicyRulePatch model
+ load_balancer_listener_policy_rule_patch_model_json = {}
+ load_balancer_listener_policy_rule_patch_model_json['condition'] = 'contains'
+ load_balancer_listener_policy_rule_patch_model_json['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_patch_model_json['type'] = 'body'
+ load_balancer_listener_policy_rule_patch_model_json['value'] = 'testString'
- # Construct a model instance of InstanceTemplateReferenceDeleted by calling from_dict on the json representation
- instance_template_reference_deleted_model = InstanceTemplateReferenceDeleted.from_dict(instance_template_reference_deleted_model_json)
- assert instance_template_reference_deleted_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyRulePatch by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_patch_model = LoadBalancerListenerPolicyRulePatch.from_dict(load_balancer_listener_policy_rule_patch_model_json)
+ assert load_balancer_listener_policy_rule_patch_model != False
- # Construct a model instance of InstanceTemplateReferenceDeleted by calling from_dict on the json representation
- instance_template_reference_deleted_model_dict = InstanceTemplateReferenceDeleted.from_dict(instance_template_reference_deleted_model_json).__dict__
- instance_template_reference_deleted_model2 = InstanceTemplateReferenceDeleted(**instance_template_reference_deleted_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyRulePatch by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_patch_model_dict = LoadBalancerListenerPolicyRulePatch.from_dict(load_balancer_listener_policy_rule_patch_model_json).__dict__
+ load_balancer_listener_policy_rule_patch_model2 = LoadBalancerListenerPolicyRulePatch(**load_balancer_listener_policy_rule_patch_model_dict)
# Verify the model instances are equivalent
- assert instance_template_reference_deleted_model == instance_template_reference_deleted_model2
+ assert load_balancer_listener_policy_rule_patch_model == load_balancer_listener_policy_rule_patch_model2
# Convert model instance back to dict and verify no loss of data
- instance_template_reference_deleted_model_json2 = instance_template_reference_deleted_model.to_dict()
- assert instance_template_reference_deleted_model_json2 == instance_template_reference_deleted_model_json
+ load_balancer_listener_policy_rule_patch_model_json2 = load_balancer_listener_policy_rule_patch_model.to_dict()
+ assert load_balancer_listener_policy_rule_patch_model_json2 == load_balancer_listener_policy_rule_patch_model_json
-class TestModel_InstanceVCPU():
+class TestModel_LoadBalancerListenerPolicyRulePrototype():
"""
- Test Class for InstanceVCPU
+ Test Class for LoadBalancerListenerPolicyRulePrototype
"""
- def test_instance_vcpu_serialization(self):
+ def test_load_balancer_listener_policy_rule_prototype_serialization(self):
"""
- Test serialization/deserialization for InstanceVCPU
+ Test serialization/deserialization for LoadBalancerListenerPolicyRulePrototype
"""
- # Construct a json representation of a InstanceVCPU model
- instance_vcpu_model_json = {}
- instance_vcpu_model_json['architecture'] = 'amd64'
- instance_vcpu_model_json['count'] = 4
+ # Construct a json representation of a LoadBalancerListenerPolicyRulePrototype model
+ load_balancer_listener_policy_rule_prototype_model_json = {}
+ load_balancer_listener_policy_rule_prototype_model_json['condition'] = 'contains'
+ load_balancer_listener_policy_rule_prototype_model_json['field'] = 'MY-APP-HEADER'
+ load_balancer_listener_policy_rule_prototype_model_json['type'] = 'body'
+ load_balancer_listener_policy_rule_prototype_model_json['value'] = 'testString'
- # Construct a model instance of InstanceVCPU by calling from_dict on the json representation
- instance_vcpu_model = InstanceVCPU.from_dict(instance_vcpu_model_json)
- assert instance_vcpu_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyRulePrototype by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_prototype_model = LoadBalancerListenerPolicyRulePrototype.from_dict(load_balancer_listener_policy_rule_prototype_model_json)
+ assert load_balancer_listener_policy_rule_prototype_model != False
- # Construct a model instance of InstanceVCPU by calling from_dict on the json representation
- instance_vcpu_model_dict = InstanceVCPU.from_dict(instance_vcpu_model_json).__dict__
- instance_vcpu_model2 = InstanceVCPU(**instance_vcpu_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyRulePrototype by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_prototype_model_dict = LoadBalancerListenerPolicyRulePrototype.from_dict(load_balancer_listener_policy_rule_prototype_model_json).__dict__
+ load_balancer_listener_policy_rule_prototype_model2 = LoadBalancerListenerPolicyRulePrototype(**load_balancer_listener_policy_rule_prototype_model_dict)
# Verify the model instances are equivalent
- assert instance_vcpu_model == instance_vcpu_model2
+ assert load_balancer_listener_policy_rule_prototype_model == load_balancer_listener_policy_rule_prototype_model2
# Convert model instance back to dict and verify no loss of data
- instance_vcpu_model_json2 = instance_vcpu_model.to_dict()
- assert instance_vcpu_model_json2 == instance_vcpu_model_json
+ load_balancer_listener_policy_rule_prototype_model_json2 = load_balancer_listener_policy_rule_prototype_model.to_dict()
+ assert load_balancer_listener_policy_rule_prototype_model_json2 == load_balancer_listener_policy_rule_prototype_model_json
-class TestModel_Key():
+class TestModel_LoadBalancerListenerPolicyRuleReference():
"""
- Test Class for Key
+ Test Class for LoadBalancerListenerPolicyRuleReference
"""
- def test_key_serialization(self):
+ def test_load_balancer_listener_policy_rule_reference_serialization(self):
"""
- Test serialization/deserialization for Key
+ Test serialization/deserialization for LoadBalancerListenerPolicyRuleReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/resource_groups/3fad3f2204eb4998c3964d254ffcd771'
- resource_group_reference_model['id'] = '3fad3f2204eb4998c3964d254ffcd771'
- resource_group_reference_model['name'] = 'Default'
+ load_balancer_listener_policy_rule_reference_deleted_model = {} # LoadBalancerListenerPolicyRuleReferenceDeleted
+ load_balancer_listener_policy_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a Key model
- key_model_json = {}
- key_model_json['created_at'] = "2019-01-01T12:00:00Z"
- key_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803'
- key_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
- key_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803'
- key_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- key_model_json['length'] = 2048
- key_model_json['name'] = 'my-key'
- key_model_json['public_key'] = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En'
- key_model_json['resource_group'] = resource_group_reference_model
- key_model_json['type'] = 'rsa'
+ # Construct a json representation of a LoadBalancerListenerPolicyRuleReference model
+ load_balancer_listener_policy_rule_reference_model_json = {}
+ load_balancer_listener_policy_rule_reference_model_json['deleted'] = load_balancer_listener_policy_rule_reference_deleted_model
+ load_balancer_listener_policy_rule_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
+ load_balancer_listener_policy_rule_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of Key by calling from_dict on the json representation
- key_model = Key.from_dict(key_model_json)
- assert key_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyRuleReference by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_reference_model = LoadBalancerListenerPolicyRuleReference.from_dict(load_balancer_listener_policy_rule_reference_model_json)
+ assert load_balancer_listener_policy_rule_reference_model != False
- # Construct a model instance of Key by calling from_dict on the json representation
- key_model_dict = Key.from_dict(key_model_json).__dict__
- key_model2 = Key(**key_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyRuleReference by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_reference_model_dict = LoadBalancerListenerPolicyRuleReference.from_dict(load_balancer_listener_policy_rule_reference_model_json).__dict__
+ load_balancer_listener_policy_rule_reference_model2 = LoadBalancerListenerPolicyRuleReference(**load_balancer_listener_policy_rule_reference_model_dict)
# Verify the model instances are equivalent
- assert key_model == key_model2
+ assert load_balancer_listener_policy_rule_reference_model == load_balancer_listener_policy_rule_reference_model2
# Convert model instance back to dict and verify no loss of data
- key_model_json2 = key_model.to_dict()
- assert key_model_json2 == key_model_json
+ load_balancer_listener_policy_rule_reference_model_json2 = load_balancer_listener_policy_rule_reference_model.to_dict()
+ assert load_balancer_listener_policy_rule_reference_model_json2 == load_balancer_listener_policy_rule_reference_model_json
-class TestModel_KeyCollection():
+class TestModel_LoadBalancerListenerPolicyRuleReferenceDeleted():
"""
- Test Class for KeyCollection
+ Test Class for LoadBalancerListenerPolicyRuleReferenceDeleted
"""
- def test_key_collection_serialization(self):
+ def test_load_balancer_listener_policy_rule_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for KeyCollection
+ Test serialization/deserialization for LoadBalancerListenerPolicyRuleReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- key_collection_first_model = {} # KeyCollectionFirst
- key_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?limit=50'
-
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/resource_groups/3fad3f2204eb4998c3964d254ffcd771'
- resource_group_reference_model['id'] = '3fad3f2204eb4998c3964d254ffcd771'
- resource_group_reference_model['name'] = 'Default'
-
- key_model = {} # Key
- key_model['created_at'] = "2019-01-29T03:48:11Z"
- key_model['crn'] = 'crn:[...]'
- key_model['fingerprint'] = 'SHA256:RJ+YWs2kupwFGiJuLqY85twmcdLOUcjIc9cA6IR8n8E'
- key_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/82679077-ac3b-4c10-be16-63e9c21f0f45'
- key_model['id'] = '82679077-ac3b-4c10-be16-63e9c21f0f45'
- key_model['length'] = 2048
- key_model['name'] = 'my-key-1'
- key_model['public_key'] = 'ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDDGe50Bxa5T5NDddrrtbx2Y4/VGbiCgXqnBsYToIUKoFSHTQl5IX3PasGnneKanhcLwWz5M5MoCRvhxTp66NKzIfAz7r+FX9rxgR+ZgcM253YAqOVeIpOU408simDZKriTlN8kYsXL7P34tsWuAJf4MgZtJAQxous/2byetpdCv8ddnT4X3ltOg9w+LqSCPYfNivqH00Eh7S1Ldz7I8aw5WOp5a+sQFP/RbwfpwHp+ny7DfeIOokcuI42tJkoBn7UsLTVpCSmXr2EDRlSWe/1M/iHNRBzaT3CK0+SwZWd2AEjePxSnWKNGIEUJDlUYp7hKhiQcgT5ZAnWU121oc5En'
- key_model['resource_group'] = resource_group_reference_model
- key_model['type'] = 'rsa'
-
- key_collection_next_model = {} # KeyCollectionNext
- key_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- # Construct a json representation of a KeyCollection model
- key_collection_model_json = {}
- key_collection_model_json['first'] = key_collection_first_model
- key_collection_model_json['keys'] = [key_model]
- key_collection_model_json['limit'] = 20
- key_collection_model_json['next'] = key_collection_next_model
- key_collection_model_json['total_count'] = 132
+ # Construct a json representation of a LoadBalancerListenerPolicyRuleReferenceDeleted model
+ load_balancer_listener_policy_rule_reference_deleted_model_json = {}
+ load_balancer_listener_policy_rule_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of KeyCollection by calling from_dict on the json representation
- key_collection_model = KeyCollection.from_dict(key_collection_model_json)
- assert key_collection_model != False
+ # Construct a model instance of LoadBalancerListenerPolicyRuleReferenceDeleted by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_reference_deleted_model = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict(load_balancer_listener_policy_rule_reference_deleted_model_json)
+ assert load_balancer_listener_policy_rule_reference_deleted_model != False
- # Construct a model instance of KeyCollection by calling from_dict on the json representation
- key_collection_model_dict = KeyCollection.from_dict(key_collection_model_json).__dict__
- key_collection_model2 = KeyCollection(**key_collection_model_dict)
+ # Construct a model instance of LoadBalancerListenerPolicyRuleReferenceDeleted by calling from_dict on the json representation
+ load_balancer_listener_policy_rule_reference_deleted_model_dict = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict(load_balancer_listener_policy_rule_reference_deleted_model_json).__dict__
+ load_balancer_listener_policy_rule_reference_deleted_model2 = LoadBalancerListenerPolicyRuleReferenceDeleted(**load_balancer_listener_policy_rule_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert key_collection_model == key_collection_model2
+ assert load_balancer_listener_policy_rule_reference_deleted_model == load_balancer_listener_policy_rule_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- key_collection_model_json2 = key_collection_model.to_dict()
- assert key_collection_model_json2 == key_collection_model_json
+ load_balancer_listener_policy_rule_reference_deleted_model_json2 = load_balancer_listener_policy_rule_reference_deleted_model.to_dict()
+ assert load_balancer_listener_policy_rule_reference_deleted_model_json2 == load_balancer_listener_policy_rule_reference_deleted_model_json
-class TestModel_KeyCollectionFirst():
+class TestModel_LoadBalancerListenerPrototypeLoadBalancerContext():
"""
- Test Class for KeyCollectionFirst
+ Test Class for LoadBalancerListenerPrototypeLoadBalancerContext
"""
- def test_key_collection_first_serialization(self):
+ def test_load_balancer_listener_prototype_load_balancer_context_serialization(self):
"""
- Test serialization/deserialization for KeyCollectionFirst
+ Test serialization/deserialization for LoadBalancerListenerPrototypeLoadBalancerContext
"""
- # Construct a json representation of a KeyCollectionFirst model
- key_collection_first_model_json = {}
- key_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ load_balancer_pool_identity_by_name_model = {} # LoadBalancerPoolIdentityByName
+ load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
+
+ # Construct a json representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
+ load_balancer_listener_prototype_load_balancer_context_model_json = {}
+ load_balancer_listener_prototype_load_balancer_context_model_json['accept_proxy_protocol'] = True
+ load_balancer_listener_prototype_load_balancer_context_model_json['connection_limit'] = 2000
+ load_balancer_listener_prototype_load_balancer_context_model_json['default_pool'] = load_balancer_pool_identity_by_name_model
+ load_balancer_listener_prototype_load_balancer_context_model_json['port'] = 443
+ load_balancer_listener_prototype_load_balancer_context_model_json['port_max'] = 499
+ load_balancer_listener_prototype_load_balancer_context_model_json['port_min'] = 443
+ load_balancer_listener_prototype_load_balancer_context_model_json['protocol'] = 'http'
- # Construct a model instance of KeyCollectionFirst by calling from_dict on the json representation
- key_collection_first_model = KeyCollectionFirst.from_dict(key_collection_first_model_json)
- assert key_collection_first_model != False
+ # Construct a model instance of LoadBalancerListenerPrototypeLoadBalancerContext by calling from_dict on the json representation
+ load_balancer_listener_prototype_load_balancer_context_model = LoadBalancerListenerPrototypeLoadBalancerContext.from_dict(load_balancer_listener_prototype_load_balancer_context_model_json)
+ assert load_balancer_listener_prototype_load_balancer_context_model != False
- # Construct a model instance of KeyCollectionFirst by calling from_dict on the json representation
- key_collection_first_model_dict = KeyCollectionFirst.from_dict(key_collection_first_model_json).__dict__
- key_collection_first_model2 = KeyCollectionFirst(**key_collection_first_model_dict)
+ # Construct a model instance of LoadBalancerListenerPrototypeLoadBalancerContext by calling from_dict on the json representation
+ load_balancer_listener_prototype_load_balancer_context_model_dict = LoadBalancerListenerPrototypeLoadBalancerContext.from_dict(load_balancer_listener_prototype_load_balancer_context_model_json).__dict__
+ load_balancer_listener_prototype_load_balancer_context_model2 = LoadBalancerListenerPrototypeLoadBalancerContext(**load_balancer_listener_prototype_load_balancer_context_model_dict)
# Verify the model instances are equivalent
- assert key_collection_first_model == key_collection_first_model2
+ assert load_balancer_listener_prototype_load_balancer_context_model == load_balancer_listener_prototype_load_balancer_context_model2
# Convert model instance back to dict and verify no loss of data
- key_collection_first_model_json2 = key_collection_first_model.to_dict()
- assert key_collection_first_model_json2 == key_collection_first_model_json
+ load_balancer_listener_prototype_load_balancer_context_model_json2 = load_balancer_listener_prototype_load_balancer_context_model.to_dict()
+ assert load_balancer_listener_prototype_load_balancer_context_model_json2 == load_balancer_listener_prototype_load_balancer_context_model_json
-class TestModel_KeyCollectionNext():
+class TestModel_LoadBalancerListenerReference():
"""
- Test Class for KeyCollectionNext
+ Test Class for LoadBalancerListenerReference
"""
- def test_key_collection_next_serialization(self):
+ def test_load_balancer_listener_reference_serialization(self):
"""
- Test serialization/deserialization for KeyCollectionNext
+ Test serialization/deserialization for LoadBalancerListenerReference
"""
- # Construct a json representation of a KeyCollectionNext model
- key_collection_next_model_json = {}
- key_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of KeyCollectionNext by calling from_dict on the json representation
- key_collection_next_model = KeyCollectionNext.from_dict(key_collection_next_model_json)
- assert key_collection_next_model != False
+ load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
+ load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of KeyCollectionNext by calling from_dict on the json representation
- key_collection_next_model_dict = KeyCollectionNext.from_dict(key_collection_next_model_json).__dict__
- key_collection_next_model2 = KeyCollectionNext(**key_collection_next_model_dict)
+ # Construct a json representation of a LoadBalancerListenerReference model
+ load_balancer_listener_reference_model_json = {}
+ load_balancer_listener_reference_model_json['deleted'] = load_balancer_listener_reference_deleted_model
+ load_balancer_listener_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_listener_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ # Construct a model instance of LoadBalancerListenerReference by calling from_dict on the json representation
+ load_balancer_listener_reference_model = LoadBalancerListenerReference.from_dict(load_balancer_listener_reference_model_json)
+ assert load_balancer_listener_reference_model != False
+
+ # Construct a model instance of LoadBalancerListenerReference by calling from_dict on the json representation
+ load_balancer_listener_reference_model_dict = LoadBalancerListenerReference.from_dict(load_balancer_listener_reference_model_json).__dict__
+ load_balancer_listener_reference_model2 = LoadBalancerListenerReference(**load_balancer_listener_reference_model_dict)
# Verify the model instances are equivalent
- assert key_collection_next_model == key_collection_next_model2
+ assert load_balancer_listener_reference_model == load_balancer_listener_reference_model2
# Convert model instance back to dict and verify no loss of data
- key_collection_next_model_json2 = key_collection_next_model.to_dict()
- assert key_collection_next_model_json2 == key_collection_next_model_json
+ load_balancer_listener_reference_model_json2 = load_balancer_listener_reference_model.to_dict()
+ assert load_balancer_listener_reference_model_json2 == load_balancer_listener_reference_model_json
-class TestModel_KeyPatch():
+class TestModel_LoadBalancerListenerReferenceDeleted():
"""
- Test Class for KeyPatch
+ Test Class for LoadBalancerListenerReferenceDeleted
"""
- def test_key_patch_serialization(self):
+ def test_load_balancer_listener_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for KeyPatch
+ Test serialization/deserialization for LoadBalancerListenerReferenceDeleted
"""
- # Construct a json representation of a KeyPatch model
- key_patch_model_json = {}
- key_patch_model_json['name'] = 'my-key'
+ # Construct a json representation of a LoadBalancerListenerReferenceDeleted model
+ load_balancer_listener_reference_deleted_model_json = {}
+ load_balancer_listener_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of KeyPatch by calling from_dict on the json representation
- key_patch_model = KeyPatch.from_dict(key_patch_model_json)
- assert key_patch_model != False
+ # Construct a model instance of LoadBalancerListenerReferenceDeleted by calling from_dict on the json representation
+ load_balancer_listener_reference_deleted_model = LoadBalancerListenerReferenceDeleted.from_dict(load_balancer_listener_reference_deleted_model_json)
+ assert load_balancer_listener_reference_deleted_model != False
- # Construct a model instance of KeyPatch by calling from_dict on the json representation
- key_patch_model_dict = KeyPatch.from_dict(key_patch_model_json).__dict__
- key_patch_model2 = KeyPatch(**key_patch_model_dict)
+ # Construct a model instance of LoadBalancerListenerReferenceDeleted by calling from_dict on the json representation
+ load_balancer_listener_reference_deleted_model_dict = LoadBalancerListenerReferenceDeleted.from_dict(load_balancer_listener_reference_deleted_model_json).__dict__
+ load_balancer_listener_reference_deleted_model2 = LoadBalancerListenerReferenceDeleted(**load_balancer_listener_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert key_patch_model == key_patch_model2
+ assert load_balancer_listener_reference_deleted_model == load_balancer_listener_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- key_patch_model_json2 = key_patch_model.to_dict()
- assert key_patch_model_json2 == key_patch_model_json
+ load_balancer_listener_reference_deleted_model_json2 = load_balancer_listener_reference_deleted_model.to_dict()
+ assert load_balancer_listener_reference_deleted_model_json2 == load_balancer_listener_reference_deleted_model_json
-class TestModel_KeyReference():
+class TestModel_LoadBalancerLogging():
"""
- Test Class for KeyReference
+ Test Class for LoadBalancerLogging
"""
- def test_key_reference_serialization(self):
+ def test_load_balancer_logging_serialization(self):
"""
- Test serialization/deserialization for KeyReference
+ Test serialization/deserialization for LoadBalancerLogging
"""
# Construct dict forms of any model objects needed in order to build this model.
- key_reference_deleted_model = {} # KeyReferenceDeleted
- key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
+ load_balancer_logging_datapath_model['active'] = True
- # Construct a json representation of a KeyReference model
- key_reference_model_json = {}
- key_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803'
- key_reference_model_json['deleted'] = key_reference_deleted_model
- key_reference_model_json['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
- key_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803'
- key_reference_model_json['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
- key_reference_model_json['name'] = 'my-key'
+ # Construct a json representation of a LoadBalancerLogging model
+ load_balancer_logging_model_json = {}
+ load_balancer_logging_model_json['datapath'] = load_balancer_logging_datapath_model
- # Construct a model instance of KeyReference by calling from_dict on the json representation
- key_reference_model = KeyReference.from_dict(key_reference_model_json)
- assert key_reference_model != False
+ # Construct a model instance of LoadBalancerLogging by calling from_dict on the json representation
+ load_balancer_logging_model = LoadBalancerLogging.from_dict(load_balancer_logging_model_json)
+ assert load_balancer_logging_model != False
- # Construct a model instance of KeyReference by calling from_dict on the json representation
- key_reference_model_dict = KeyReference.from_dict(key_reference_model_json).__dict__
- key_reference_model2 = KeyReference(**key_reference_model_dict)
+ # Construct a model instance of LoadBalancerLogging by calling from_dict on the json representation
+ load_balancer_logging_model_dict = LoadBalancerLogging.from_dict(load_balancer_logging_model_json).__dict__
+ load_balancer_logging_model2 = LoadBalancerLogging(**load_balancer_logging_model_dict)
# Verify the model instances are equivalent
- assert key_reference_model == key_reference_model2
+ assert load_balancer_logging_model == load_balancer_logging_model2
# Convert model instance back to dict and verify no loss of data
- key_reference_model_json2 = key_reference_model.to_dict()
- assert key_reference_model_json2 == key_reference_model_json
+ load_balancer_logging_model_json2 = load_balancer_logging_model.to_dict()
+ assert load_balancer_logging_model_json2 == load_balancer_logging_model_json
-class TestModel_KeyReferenceDeleted():
+class TestModel_LoadBalancerLoggingDatapath():
"""
- Test Class for KeyReferenceDeleted
+ Test Class for LoadBalancerLoggingDatapath
"""
- def test_key_reference_deleted_serialization(self):
+ def test_load_balancer_logging_datapath_serialization(self):
"""
- Test serialization/deserialization for KeyReferenceDeleted
+ Test serialization/deserialization for LoadBalancerLoggingDatapath
"""
- # Construct a json representation of a KeyReferenceDeleted model
- key_reference_deleted_model_json = {}
- key_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a LoadBalancerLoggingDatapath model
+ load_balancer_logging_datapath_model_json = {}
+ load_balancer_logging_datapath_model_json['active'] = True
- # Construct a model instance of KeyReferenceDeleted by calling from_dict on the json representation
- key_reference_deleted_model = KeyReferenceDeleted.from_dict(key_reference_deleted_model_json)
- assert key_reference_deleted_model != False
+ # Construct a model instance of LoadBalancerLoggingDatapath by calling from_dict on the json representation
+ load_balancer_logging_datapath_model = LoadBalancerLoggingDatapath.from_dict(load_balancer_logging_datapath_model_json)
+ assert load_balancer_logging_datapath_model != False
- # Construct a model instance of KeyReferenceDeleted by calling from_dict on the json representation
- key_reference_deleted_model_dict = KeyReferenceDeleted.from_dict(key_reference_deleted_model_json).__dict__
- key_reference_deleted_model2 = KeyReferenceDeleted(**key_reference_deleted_model_dict)
+ # Construct a model instance of LoadBalancerLoggingDatapath by calling from_dict on the json representation
+ load_balancer_logging_datapath_model_dict = LoadBalancerLoggingDatapath.from_dict(load_balancer_logging_datapath_model_json).__dict__
+ load_balancer_logging_datapath_model2 = LoadBalancerLoggingDatapath(**load_balancer_logging_datapath_model_dict)
# Verify the model instances are equivalent
- assert key_reference_deleted_model == key_reference_deleted_model2
+ assert load_balancer_logging_datapath_model == load_balancer_logging_datapath_model2
# Convert model instance back to dict and verify no loss of data
- key_reference_deleted_model_json2 = key_reference_deleted_model.to_dict()
- assert key_reference_deleted_model_json2 == key_reference_deleted_model_json
+ load_balancer_logging_datapath_model_json2 = load_balancer_logging_datapath_model.to_dict()
+ assert load_balancer_logging_datapath_model_json2 == load_balancer_logging_datapath_model_json
-class TestModel_LoadBalancer():
+class TestModel_LoadBalancerPatch():
"""
- Test Class for LoadBalancer
+ Test Class for LoadBalancerPatch
"""
- def test_load_balancer_serialization(self):
+ def test_load_balancer_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancer
+ Test serialization/deserialization for LoadBalancerPatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
- load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
- load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
- load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
load_balancer_logging_datapath_model['active'] = True
load_balancer_logging_model = {} # LoadBalancerLogging
load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a LoadBalancerPatch model
+ load_balancer_patch_model_json = {}
+ load_balancer_patch_model_json['logging'] = load_balancer_logging_model
+ load_balancer_patch_model_json['name'] = 'my-load-balancer'
- load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
- load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+ # Construct a model instance of LoadBalancerPatch by calling from_dict on the json representation
+ load_balancer_patch_model = LoadBalancerPatch.from_dict(load_balancer_patch_model_json)
+ assert load_balancer_patch_model != False
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ # Construct a model instance of LoadBalancerPatch by calling from_dict on the json representation
+ load_balancer_patch_model_dict = LoadBalancerPatch.from_dict(load_balancer_patch_model_json).__dict__
+ load_balancer_patch_model2 = LoadBalancerPatch(**load_balancer_patch_model_dict)
- load_balancer_profile_reference_model = {} # LoadBalancerProfileReference
- load_balancer_profile_reference_model['family'] = 'network'
- load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
- load_balancer_profile_reference_model['name'] = 'network-fixed'
+ # Verify the model instances are equivalent
+ assert load_balancer_patch_model == load_balancer_patch_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_patch_model_json2 = load_balancer_patch_model.to_dict()
+ assert load_balancer_patch_model_json2 == load_balancer_patch_model_json
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_LoadBalancerPool():
+ """
+ Test Class for LoadBalancerPool
+ """
- security_group_reference_model = {} # SecurityGroupReference
- security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['deleted'] = security_group_reference_deleted_model
- security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['name'] = 'my-security-group'
+ def test_load_balancer_pool_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPool
+ """
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- 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'
+ load_balancer_pool_health_monitor_model = {} # LoadBalancerPoolHealthMonitor
+ load_balancer_pool_health_monitor_model['delay'] = 5
+ load_balancer_pool_health_monitor_model['max_retries'] = 2
+ load_balancer_pool_health_monitor_model['port'] = 22
+ load_balancer_pool_health_monitor_model['timeout'] = 2
+ load_balancer_pool_health_monitor_model['type'] = 'http'
+ load_balancer_pool_health_monitor_model['url_path'] = '/'
- # Construct a json representation of a LoadBalancer model
- load_balancer_model_json = {}
- load_balancer_model_json['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model_json['hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net'
- load_balancer_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model_json['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model_json['is_public'] = True
- load_balancer_model_json['listeners'] = [load_balancer_listener_reference_model]
- load_balancer_model_json['logging'] = load_balancer_logging_model
- load_balancer_model_json['name'] = 'my-load-balancer'
- load_balancer_model_json['operating_status'] = 'offline'
- load_balancer_model_json['pools'] = [load_balancer_pool_reference_model]
- load_balancer_model_json['private_ips'] = [ip_model]
- load_balancer_model_json['profile'] = load_balancer_profile_reference_model
- load_balancer_model_json['provisioning_status'] = 'active'
- load_balancer_model_json['public_ips'] = [ip_model]
- load_balancer_model_json['resource_group'] = resource_group_reference_model
- load_balancer_model_json['route_mode'] = True
- load_balancer_model_json['security_groups'] = [security_group_reference_model]
- load_balancer_model_json['security_groups_supported'] = True
- load_balancer_model_json['subnets'] = [subnet_reference_model]
+ instance_group_reference_deleted_model = {} # InstanceGroupReferenceDeleted
+ instance_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancer by calling from_dict on the json representation
- load_balancer_model = LoadBalancer.from_dict(load_balancer_model_json)
- assert load_balancer_model != False
+ instance_group_reference_model = {} # InstanceGroupReference
+ instance_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_reference_model['deleted'] = instance_group_reference_deleted_model
+ instance_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_reference_model['name'] = 'my-instance-group'
- # Construct a model instance of LoadBalancer by calling from_dict on the json representation
- load_balancer_model_dict = LoadBalancer.from_dict(load_balancer_model_json).__dict__
- load_balancer_model2 = LoadBalancer(**load_balancer_model_dict)
+ load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
+ load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference
+ load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model
+ load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+
+ load_balancer_pool_session_persistence_model = {} # LoadBalancerPoolSessionPersistence
+ load_balancer_pool_session_persistence_model['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_model['type'] = 'app_cookie'
+
+ # Construct a json representation of a LoadBalancerPool model
+ load_balancer_pool_model_json = {}
+ load_balancer_pool_model_json['algorithm'] = 'least_connections'
+ load_balancer_pool_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_pool_model_json['health_monitor'] = load_balancer_pool_health_monitor_model
+ load_balancer_pool_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_model_json['instance_group'] = instance_group_reference_model
+ load_balancer_pool_model_json['members'] = [load_balancer_pool_member_reference_model]
+ load_balancer_pool_model_json['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_model_json['protocol'] = 'http'
+ load_balancer_pool_model_json['provisioning_status'] = 'active'
+ load_balancer_pool_model_json['proxy_protocol'] = 'disabled'
+ load_balancer_pool_model_json['session_persistence'] = load_balancer_pool_session_persistence_model
+
+ # Construct a model instance of LoadBalancerPool by calling from_dict on the json representation
+ load_balancer_pool_model = LoadBalancerPool.from_dict(load_balancer_pool_model_json)
+ assert load_balancer_pool_model != False
+
+ # Construct a model instance of LoadBalancerPool by calling from_dict on the json representation
+ load_balancer_pool_model_dict = LoadBalancerPool.from_dict(load_balancer_pool_model_json).__dict__
+ load_balancer_pool_model2 = LoadBalancerPool(**load_balancer_pool_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_model == load_balancer_model2
+ assert load_balancer_pool_model == load_balancer_pool_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_model_json2 = load_balancer_model.to_dict()
- assert load_balancer_model_json2 == load_balancer_model_json
+ load_balancer_pool_model_json2 = load_balancer_pool_model.to_dict()
+ assert load_balancer_pool_model_json2 == load_balancer_pool_model_json
-class TestModel_LoadBalancerCollection():
+class TestModel_LoadBalancerPoolCollection():
"""
- Test Class for LoadBalancerCollection
+ Test Class for LoadBalancerPoolCollection
"""
- def test_load_balancer_collection_serialization(self):
+ def test_load_balancer_pool_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerCollection
+ Test serialization/deserialization for LoadBalancerPoolCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_collection_first_model = {} # LoadBalancerCollectionFirst
- load_balancer_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20'
+ load_balancer_pool_health_monitor_model = {} # LoadBalancerPoolHealthMonitor
+ load_balancer_pool_health_monitor_model['delay'] = 5
+ load_balancer_pool_health_monitor_model['max_retries'] = 2
+ load_balancer_pool_health_monitor_model['port'] = 22
+ load_balancer_pool_health_monitor_model['timeout'] = 2
+ load_balancer_pool_health_monitor_model['type'] = 'http'
+ load_balancer_pool_health_monitor_model['url_path'] = '/'
- load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
- load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ instance_group_reference_deleted_model = {} # InstanceGroupReferenceDeleted
+ instance_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
- load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
- load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ instance_group_reference_model = {} # InstanceGroupReference
+ instance_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_reference_model['deleted'] = instance_group_reference_deleted_model
+ instance_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_group_reference_model['name'] = 'my-instance-group'
- load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
- load_balancer_logging_datapath_model['active'] = True
+ load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
+ load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_logging_model = {} # LoadBalancerLogging
- load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
+ load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference
+ load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model
+ load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ load_balancer_pool_session_persistence_model = {} # LoadBalancerPoolSessionPersistence
+ load_balancer_pool_session_persistence_model['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_model['type'] = 'app_cookie'
- load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
- load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_model = {} # LoadBalancerPool
+ load_balancer_pool_model['algorithm'] = 'least_connections'
+ load_balancer_pool_model['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_pool_model['health_monitor'] = load_balancer_pool_health_monitor_model
+ load_balancer_pool_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_model['instance_group'] = instance_group_reference_model
+ load_balancer_pool_model['members'] = [load_balancer_pool_member_reference_model]
+ load_balancer_pool_model['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_model['protocol'] = 'http'
+ load_balancer_pool_model['provisioning_status'] = 'active'
+ load_balancer_pool_model['proxy_protocol'] = 'disabled'
+ load_balancer_pool_model['session_persistence'] = load_balancer_pool_session_persistence_model
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ # Construct a json representation of a LoadBalancerPoolCollection model
+ load_balancer_pool_collection_model_json = {}
+ load_balancer_pool_collection_model_json['pools'] = [load_balancer_pool_model]
- load_balancer_profile_reference_model = {} # LoadBalancerProfileReference
- load_balancer_profile_reference_model['family'] = 'network'
- load_balancer_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
- load_balancer_profile_reference_model['name'] = 'network-fixed'
+ # Construct a model instance of LoadBalancerPoolCollection by calling from_dict on the json representation
+ load_balancer_pool_collection_model = LoadBalancerPoolCollection.from_dict(load_balancer_pool_collection_model_json)
+ assert load_balancer_pool_collection_model != False
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ # Construct a model instance of LoadBalancerPoolCollection by calling from_dict on the json representation
+ load_balancer_pool_collection_model_dict = LoadBalancerPoolCollection.from_dict(load_balancer_pool_collection_model_json).__dict__
+ load_balancer_pool_collection_model2 = LoadBalancerPoolCollection(**load_balancer_pool_collection_model_dict)
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert load_balancer_pool_collection_model == load_balancer_pool_collection_model2
- security_group_reference_model = {} # SecurityGroupReference
- security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['deleted'] = security_group_reference_deleted_model
- security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['name'] = 'my-security-group'
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_pool_collection_model_json2 = load_balancer_pool_collection_model.to_dict()
+ assert load_balancer_pool_collection_model_json2 == load_balancer_pool_collection_model_json
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_LoadBalancerPoolHealthMonitor():
+ """
+ Test Class for LoadBalancerPoolHealthMonitor
+ """
- 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'
+ def test_load_balancer_pool_health_monitor_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPoolHealthMonitor
+ """
- load_balancer_model = {} # LoadBalancer
- load_balancer_model['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::load-balancer:dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model['hostname'] = 'my-load-balancer-123456-us-south-1.lb.bluemix.net'
- load_balancer_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model['id'] = 'dd754295-e9e0-4c9d-bf6c-58fbc59e5727'
- load_balancer_model['is_public'] = True
- load_balancer_model['listeners'] = [load_balancer_listener_reference_model]
- load_balancer_model['logging'] = load_balancer_logging_model
- load_balancer_model['name'] = 'my-load-balancer'
- load_balancer_model['operating_status'] = 'offline'
- load_balancer_model['pools'] = [load_balancer_pool_reference_model]
- load_balancer_model['private_ips'] = [ip_model]
- load_balancer_model['profile'] = load_balancer_profile_reference_model
- load_balancer_model['provisioning_status'] = 'active'
- load_balancer_model['public_ips'] = [ip_model]
- load_balancer_model['resource_group'] = resource_group_reference_model
- load_balancer_model['route_mode'] = True
- load_balancer_model['security_groups'] = [security_group_reference_model]
- load_balancer_model['security_groups_supported'] = True
- load_balancer_model['subnets'] = [subnet_reference_model]
+ # Construct a json representation of a LoadBalancerPoolHealthMonitor model
+ load_balancer_pool_health_monitor_model_json = {}
+ load_balancer_pool_health_monitor_model_json['delay'] = 5
+ load_balancer_pool_health_monitor_model_json['max_retries'] = 2
+ load_balancer_pool_health_monitor_model_json['port'] = 22
+ load_balancer_pool_health_monitor_model_json['timeout'] = 2
+ load_balancer_pool_health_monitor_model_json['type'] = 'http'
+ load_balancer_pool_health_monitor_model_json['url_path'] = '/'
- load_balancer_collection_next_model = {} # LoadBalancerCollectionNext
- load_balancer_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
+ # Construct a model instance of LoadBalancerPoolHealthMonitor by calling from_dict on the json representation
+ load_balancer_pool_health_monitor_model = LoadBalancerPoolHealthMonitor.from_dict(load_balancer_pool_health_monitor_model_json)
+ assert load_balancer_pool_health_monitor_model != False
- # Construct a json representation of a LoadBalancerCollection model
- load_balancer_collection_model_json = {}
- load_balancer_collection_model_json['first'] = load_balancer_collection_first_model
- load_balancer_collection_model_json['limit'] = 20
- load_balancer_collection_model_json['load_balancers'] = [load_balancer_model]
- load_balancer_collection_model_json['next'] = load_balancer_collection_next_model
- load_balancer_collection_model_json['total_count'] = 132
+ # Construct a model instance of LoadBalancerPoolHealthMonitor by calling from_dict on the json representation
+ load_balancer_pool_health_monitor_model_dict = LoadBalancerPoolHealthMonitor.from_dict(load_balancer_pool_health_monitor_model_json).__dict__
+ load_balancer_pool_health_monitor_model2 = LoadBalancerPoolHealthMonitor(**load_balancer_pool_health_monitor_model_dict)
- # Construct a model instance of LoadBalancerCollection by calling from_dict on the json representation
- load_balancer_collection_model = LoadBalancerCollection.from_dict(load_balancer_collection_model_json)
- assert load_balancer_collection_model != False
+ # Verify the model instances are equivalent
+ assert load_balancer_pool_health_monitor_model == load_balancer_pool_health_monitor_model2
- # Construct a model instance of LoadBalancerCollection by calling from_dict on the json representation
- load_balancer_collection_model_dict = LoadBalancerCollection.from_dict(load_balancer_collection_model_json).__dict__
- load_balancer_collection_model2 = LoadBalancerCollection(**load_balancer_collection_model_dict)
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_pool_health_monitor_model_json2 = load_balancer_pool_health_monitor_model.to_dict()
+ assert load_balancer_pool_health_monitor_model_json2 == load_balancer_pool_health_monitor_model_json
+
+class TestModel_LoadBalancerPoolHealthMonitorPatch():
+ """
+ Test Class for LoadBalancerPoolHealthMonitorPatch
+ """
+
+ def test_load_balancer_pool_health_monitor_patch_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPoolHealthMonitorPatch
+ """
+
+ # Construct a json representation of a LoadBalancerPoolHealthMonitorPatch model
+ load_balancer_pool_health_monitor_patch_model_json = {}
+ load_balancer_pool_health_monitor_patch_model_json['delay'] = 5
+ load_balancer_pool_health_monitor_patch_model_json['max_retries'] = 2
+ load_balancer_pool_health_monitor_patch_model_json['port'] = 22
+ load_balancer_pool_health_monitor_patch_model_json['timeout'] = 2
+ load_balancer_pool_health_monitor_patch_model_json['type'] = 'http'
+ load_balancer_pool_health_monitor_patch_model_json['url_path'] = '/'
+
+ # Construct a model instance of LoadBalancerPoolHealthMonitorPatch by calling from_dict on the json representation
+ load_balancer_pool_health_monitor_patch_model = LoadBalancerPoolHealthMonitorPatch.from_dict(load_balancer_pool_health_monitor_patch_model_json)
+ assert load_balancer_pool_health_monitor_patch_model != False
+
+ # Construct a model instance of LoadBalancerPoolHealthMonitorPatch by calling from_dict on the json representation
+ load_balancer_pool_health_monitor_patch_model_dict = LoadBalancerPoolHealthMonitorPatch.from_dict(load_balancer_pool_health_monitor_patch_model_json).__dict__
+ load_balancer_pool_health_monitor_patch_model2 = LoadBalancerPoolHealthMonitorPatch(**load_balancer_pool_health_monitor_patch_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_collection_model == load_balancer_collection_model2
+ assert load_balancer_pool_health_monitor_patch_model == load_balancer_pool_health_monitor_patch_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_collection_model_json2 = load_balancer_collection_model.to_dict()
- assert load_balancer_collection_model_json2 == load_balancer_collection_model_json
+ load_balancer_pool_health_monitor_patch_model_json2 = load_balancer_pool_health_monitor_patch_model.to_dict()
+ assert load_balancer_pool_health_monitor_patch_model_json2 == load_balancer_pool_health_monitor_patch_model_json
-class TestModel_LoadBalancerCollectionFirst():
+class TestModel_LoadBalancerPoolHealthMonitorPrototype():
"""
- Test Class for LoadBalancerCollectionFirst
+ Test Class for LoadBalancerPoolHealthMonitorPrototype
"""
- def test_load_balancer_collection_first_serialization(self):
+ def test_load_balancer_pool_health_monitor_prototype_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerCollectionFirst
+ Test serialization/deserialization for LoadBalancerPoolHealthMonitorPrototype
"""
- # Construct a json representation of a LoadBalancerCollectionFirst model
- load_balancer_collection_first_model_json = {}
- load_balancer_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?limit=20'
+ # Construct a json representation of a LoadBalancerPoolHealthMonitorPrototype model
+ load_balancer_pool_health_monitor_prototype_model_json = {}
+ load_balancer_pool_health_monitor_prototype_model_json['delay'] = 5
+ load_balancer_pool_health_monitor_prototype_model_json['max_retries'] = 2
+ load_balancer_pool_health_monitor_prototype_model_json['port'] = 22
+ load_balancer_pool_health_monitor_prototype_model_json['timeout'] = 2
+ load_balancer_pool_health_monitor_prototype_model_json['type'] = 'http'
+ load_balancer_pool_health_monitor_prototype_model_json['url_path'] = '/'
- # Construct a model instance of LoadBalancerCollectionFirst by calling from_dict on the json representation
- load_balancer_collection_first_model = LoadBalancerCollectionFirst.from_dict(load_balancer_collection_first_model_json)
- assert load_balancer_collection_first_model != False
+ # Construct a model instance of LoadBalancerPoolHealthMonitorPrototype by calling from_dict on the json representation
+ load_balancer_pool_health_monitor_prototype_model = LoadBalancerPoolHealthMonitorPrototype.from_dict(load_balancer_pool_health_monitor_prototype_model_json)
+ assert load_balancer_pool_health_monitor_prototype_model != False
- # Construct a model instance of LoadBalancerCollectionFirst by calling from_dict on the json representation
- load_balancer_collection_first_model_dict = LoadBalancerCollectionFirst.from_dict(load_balancer_collection_first_model_json).__dict__
- load_balancer_collection_first_model2 = LoadBalancerCollectionFirst(**load_balancer_collection_first_model_dict)
+ # Construct a model instance of LoadBalancerPoolHealthMonitorPrototype by calling from_dict on the json representation
+ load_balancer_pool_health_monitor_prototype_model_dict = LoadBalancerPoolHealthMonitorPrototype.from_dict(load_balancer_pool_health_monitor_prototype_model_json).__dict__
+ load_balancer_pool_health_monitor_prototype_model2 = LoadBalancerPoolHealthMonitorPrototype(**load_balancer_pool_health_monitor_prototype_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_collection_first_model == load_balancer_collection_first_model2
+ assert load_balancer_pool_health_monitor_prototype_model == load_balancer_pool_health_monitor_prototype_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_collection_first_model_json2 = load_balancer_collection_first_model.to_dict()
- assert load_balancer_collection_first_model_json2 == load_balancer_collection_first_model_json
+ load_balancer_pool_health_monitor_prototype_model_json2 = load_balancer_pool_health_monitor_prototype_model.to_dict()
+ assert load_balancer_pool_health_monitor_prototype_model_json2 == load_balancer_pool_health_monitor_prototype_model_json
-class TestModel_LoadBalancerCollectionNext():
+class TestModel_LoadBalancerPoolIdentityByName():
"""
- Test Class for LoadBalancerCollectionNext
+ Test Class for LoadBalancerPoolIdentityByName
"""
- def test_load_balancer_collection_next_serialization(self):
+ def test_load_balancer_pool_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerCollectionNext
+ Test serialization/deserialization for LoadBalancerPoolIdentityByName
"""
- # Construct a json representation of a LoadBalancerCollectionNext model
- load_balancer_collection_next_model_json = {}
- load_balancer_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
+ # Construct a json representation of a LoadBalancerPoolIdentityByName model
+ load_balancer_pool_identity_by_name_model_json = {}
+ load_balancer_pool_identity_by_name_model_json['name'] = 'my-load-balancer-pool'
- # Construct a model instance of LoadBalancerCollectionNext by calling from_dict on the json representation
- load_balancer_collection_next_model = LoadBalancerCollectionNext.from_dict(load_balancer_collection_next_model_json)
- assert load_balancer_collection_next_model != False
+ # Construct a model instance of LoadBalancerPoolIdentityByName by calling from_dict on the json representation
+ load_balancer_pool_identity_by_name_model = LoadBalancerPoolIdentityByName.from_dict(load_balancer_pool_identity_by_name_model_json)
+ assert load_balancer_pool_identity_by_name_model != False
- # Construct a model instance of LoadBalancerCollectionNext by calling from_dict on the json representation
- load_balancer_collection_next_model_dict = LoadBalancerCollectionNext.from_dict(load_balancer_collection_next_model_json).__dict__
- load_balancer_collection_next_model2 = LoadBalancerCollectionNext(**load_balancer_collection_next_model_dict)
+ # Construct a model instance of LoadBalancerPoolIdentityByName by calling from_dict on the json representation
+ load_balancer_pool_identity_by_name_model_dict = LoadBalancerPoolIdentityByName.from_dict(load_balancer_pool_identity_by_name_model_json).__dict__
+ load_balancer_pool_identity_by_name_model2 = LoadBalancerPoolIdentityByName(**load_balancer_pool_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_collection_next_model == load_balancer_collection_next_model2
+ assert load_balancer_pool_identity_by_name_model == load_balancer_pool_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_collection_next_model_json2 = load_balancer_collection_next_model.to_dict()
- assert load_balancer_collection_next_model_json2 == load_balancer_collection_next_model_json
+ load_balancer_pool_identity_by_name_model_json2 = load_balancer_pool_identity_by_name_model.to_dict()
+ assert load_balancer_pool_identity_by_name_model_json2 == load_balancer_pool_identity_by_name_model_json
-class TestModel_LoadBalancerListener():
+class TestModel_LoadBalancerPoolMember():
"""
- Test Class for LoadBalancerListener
+ Test Class for LoadBalancerPoolMember
"""
- def test_load_balancer_listener_serialization(self):
+ def test_load_balancer_pool_member_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListener
+ Test serialization/deserialization for LoadBalancerPoolMember
"""
# Construct dict forms of any model objects needed in order to build this model.
- certificate_instance_reference_model = {} # CertificateInstanceReference
- certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ load_balancer_pool_member_target_model = {} # LoadBalancerPoolMemberTargetInstanceReference
+ load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ load_balancer_pool_member_target_model['deleted'] = instance_reference_deleted_model
+ load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ load_balancer_pool_member_target_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ load_balancer_pool_member_target_model['name'] = 'my-instance'
- load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
- load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+ # Construct a json representation of a LoadBalancerPoolMember model
+ load_balancer_pool_member_model_json = {}
+ load_balancer_pool_member_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_pool_member_model_json['health'] = 'faulted'
+ load_balancer_pool_member_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_model_json['port'] = 80
+ load_balancer_pool_member_model_json['provisioning_status'] = 'active'
+ load_balancer_pool_member_model_json['target'] = load_balancer_pool_member_target_model
+ load_balancer_pool_member_model_json['weight'] = 50
- load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
- load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of LoadBalancerPoolMember by calling from_dict on the json representation
+ load_balancer_pool_member_model = LoadBalancerPoolMember.from_dict(load_balancer_pool_member_model_json)
+ assert load_balancer_pool_member_model != False
- load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
- load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
- load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a model instance of LoadBalancerPoolMember by calling from_dict on the json representation
+ load_balancer_pool_member_model_dict = LoadBalancerPoolMember.from_dict(load_balancer_pool_member_model_json).__dict__
+ load_balancer_pool_member_model2 = LoadBalancerPoolMember(**load_balancer_pool_member_model_dict)
- load_balancer_listener_https_redirect_model = {} # LoadBalancerListenerHTTPSRedirect
- load_balancer_listener_https_redirect_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_model['listener'] = load_balancer_listener_reference_model
- load_balancer_listener_https_redirect_model['uri'] = '/example?doc=get'
+ # Verify the model instances are equivalent
+ assert load_balancer_pool_member_model == load_balancer_pool_member_model2
- load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted
- load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_pool_member_model_json2 = load_balancer_pool_member_model.to_dict()
+ assert load_balancer_pool_member_model_json2 == load_balancer_pool_member_model_json
- load_balancer_listener_policy_reference_model = {} # LoadBalancerListenerPolicyReference
- load_balancer_listener_policy_reference_model['deleted'] = load_balancer_listener_policy_reference_deleted_model
- load_balancer_listener_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
- load_balancer_listener_policy_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+class TestModel_LoadBalancerPoolMemberCollection():
+ """
+ Test Class for LoadBalancerPoolMemberCollection
+ """
- # Construct a json representation of a LoadBalancerListener model
- load_balancer_listener_model_json = {}
- load_balancer_listener_model_json['accept_proxy_protocol'] = True
- load_balancer_listener_model_json['certificate_instance'] = certificate_instance_reference_model
- load_balancer_listener_model_json['connection_limit'] = 2000
- load_balancer_listener_model_json['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_listener_model_json['default_pool'] = load_balancer_pool_reference_model
- load_balancer_listener_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_model_json['https_redirect'] = load_balancer_listener_https_redirect_model
- load_balancer_listener_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_model_json['policies'] = [load_balancer_listener_policy_reference_model]
- load_balancer_listener_model_json['port'] = 443
- load_balancer_listener_model_json['port_max'] = 499
- load_balancer_listener_model_json['port_min'] = 443
- load_balancer_listener_model_json['protocol'] = 'http'
- load_balancer_listener_model_json['provisioning_status'] = 'active'
+ def test_load_balancer_pool_member_collection_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPoolMemberCollection
+ """
- # Construct a model instance of LoadBalancerListener by calling from_dict on the json representation
- load_balancer_listener_model = LoadBalancerListener.from_dict(load_balancer_listener_model_json)
- assert load_balancer_listener_model != False
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerListener by calling from_dict on the json representation
- load_balancer_listener_model_dict = LoadBalancerListener.from_dict(load_balancer_listener_model_json).__dict__
- load_balancer_listener_model2 = LoadBalancerListener(**load_balancer_listener_model_dict)
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ load_balancer_pool_member_target_model = {} # LoadBalancerPoolMemberTargetInstanceReference
+ load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ load_balancer_pool_member_target_model['deleted'] = instance_reference_deleted_model
+ load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ load_balancer_pool_member_target_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ load_balancer_pool_member_target_model['name'] = 'my-instance'
+
+ load_balancer_pool_member_model = {} # LoadBalancerPoolMember
+ load_balancer_pool_member_model['created_at'] = "2019-01-01T12:00:00Z"
+ load_balancer_pool_member_model['health'] = 'faulted'
+ load_balancer_pool_member_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_model['port'] = 80
+ load_balancer_pool_member_model['provisioning_status'] = 'active'
+ load_balancer_pool_member_model['target'] = load_balancer_pool_member_target_model
+ load_balancer_pool_member_model['weight'] = 50
+
+ # Construct a json representation of a LoadBalancerPoolMemberCollection model
+ load_balancer_pool_member_collection_model_json = {}
+ load_balancer_pool_member_collection_model_json['members'] = [load_balancer_pool_member_model]
+
+ # Construct a model instance of LoadBalancerPoolMemberCollection by calling from_dict on the json representation
+ load_balancer_pool_member_collection_model = LoadBalancerPoolMemberCollection.from_dict(load_balancer_pool_member_collection_model_json)
+ assert load_balancer_pool_member_collection_model != False
+
+ # Construct a model instance of LoadBalancerPoolMemberCollection by calling from_dict on the json representation
+ load_balancer_pool_member_collection_model_dict = LoadBalancerPoolMemberCollection.from_dict(load_balancer_pool_member_collection_model_json).__dict__
+ load_balancer_pool_member_collection_model2 = LoadBalancerPoolMemberCollection(**load_balancer_pool_member_collection_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_model == load_balancer_listener_model2
+ assert load_balancer_pool_member_collection_model == load_balancer_pool_member_collection_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_model_json2 = load_balancer_listener_model.to_dict()
- assert load_balancer_listener_model_json2 == load_balancer_listener_model_json
+ load_balancer_pool_member_collection_model_json2 = load_balancer_pool_member_collection_model.to_dict()
+ assert load_balancer_pool_member_collection_model_json2 == load_balancer_pool_member_collection_model_json
-class TestModel_LoadBalancerListenerCollection():
+class TestModel_LoadBalancerPoolMemberPatch():
"""
- Test Class for LoadBalancerListenerCollection
+ Test Class for LoadBalancerPoolMemberPatch
"""
- def test_load_balancer_listener_collection_serialization(self):
+ def test_load_balancer_pool_member_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerCollection
+ Test serialization/deserialization for LoadBalancerPoolMemberPatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- certificate_instance_reference_model = {} # CertificateInstanceReference
- certificate_instance_reference_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
+ load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a LoadBalancerPoolMemberPatch model
+ load_balancer_pool_member_patch_model_json = {}
+ load_balancer_pool_member_patch_model_json['port'] = 80
+ load_balancer_pool_member_patch_model_json['target'] = load_balancer_pool_member_target_prototype_model
+ load_balancer_pool_member_patch_model_json['weight'] = 50
- load_balancer_pool_reference_model = {} # LoadBalancerPoolReference
- load_balancer_pool_reference_model['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_pool_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model['name'] = 'my-load-balancer-pool'
+ # Construct a model instance of LoadBalancerPoolMemberPatch by calling from_dict on the json representation
+ load_balancer_pool_member_patch_model = LoadBalancerPoolMemberPatch.from_dict(load_balancer_pool_member_patch_model_json)
+ assert load_balancer_pool_member_patch_model != False
- load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
- load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of LoadBalancerPoolMemberPatch by calling from_dict on the json representation
+ load_balancer_pool_member_patch_model_dict = LoadBalancerPoolMemberPatch.from_dict(load_balancer_pool_member_patch_model_json).__dict__
+ load_balancer_pool_member_patch_model2 = LoadBalancerPoolMemberPatch(**load_balancer_pool_member_patch_model_dict)
- load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
- load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
- load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Verify the model instances are equivalent
+ assert load_balancer_pool_member_patch_model == load_balancer_pool_member_patch_model2
- load_balancer_listener_https_redirect_model = {} # LoadBalancerListenerHTTPSRedirect
- load_balancer_listener_https_redirect_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_model['listener'] = load_balancer_listener_reference_model
- load_balancer_listener_https_redirect_model['uri'] = '/example?doc=get'
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_pool_member_patch_model_json2 = load_balancer_pool_member_patch_model.to_dict()
+ assert load_balancer_pool_member_patch_model_json2 == load_balancer_pool_member_patch_model_json
- load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted
- load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_LoadBalancerPoolMemberPrototype():
+ """
+ Test Class for LoadBalancerPoolMemberPrototype
+ """
- load_balancer_listener_policy_reference_model = {} # LoadBalancerListenerPolicyReference
- load_balancer_listener_policy_reference_model['deleted'] = load_balancer_listener_policy_reference_deleted_model
- load_balancer_listener_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
- load_balancer_listener_policy_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ def test_load_balancer_pool_member_prototype_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPoolMemberPrototype
+ """
- load_balancer_listener_model = {} # LoadBalancerListener
- load_balancer_listener_model['accept_proxy_protocol'] = True
- load_balancer_listener_model['certificate_instance'] = certificate_instance_reference_model
- load_balancer_listener_model['connection_limit'] = 2000
- load_balancer_listener_model['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_listener_model['default_pool'] = load_balancer_pool_reference_model
- load_balancer_listener_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_model['https_redirect'] = load_balancer_listener_https_redirect_model
- load_balancer_listener_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_model['policies'] = [load_balancer_listener_policy_reference_model]
- load_balancer_listener_model['port'] = 443
- load_balancer_listener_model['port_max'] = 499
- load_balancer_listener_model['port_min'] = 443
- load_balancer_listener_model['protocol'] = 'http'
- load_balancer_listener_model['provisioning_status'] = 'active'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a json representation of a LoadBalancerListenerCollection model
- load_balancer_listener_collection_model_json = {}
- load_balancer_listener_collection_model_json['listeners'] = [load_balancer_listener_model]
+ load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- # Construct a model instance of LoadBalancerListenerCollection by calling from_dict on the json representation
- load_balancer_listener_collection_model = LoadBalancerListenerCollection.from_dict(load_balancer_listener_collection_model_json)
- assert load_balancer_listener_collection_model != False
+ # Construct a json representation of a LoadBalancerPoolMemberPrototype model
+ load_balancer_pool_member_prototype_model_json = {}
+ load_balancer_pool_member_prototype_model_json['port'] = 80
+ load_balancer_pool_member_prototype_model_json['target'] = load_balancer_pool_member_target_prototype_model
+ load_balancer_pool_member_prototype_model_json['weight'] = 50
- # Construct a model instance of LoadBalancerListenerCollection by calling from_dict on the json representation
- load_balancer_listener_collection_model_dict = LoadBalancerListenerCollection.from_dict(load_balancer_listener_collection_model_json).__dict__
- load_balancer_listener_collection_model2 = LoadBalancerListenerCollection(**load_balancer_listener_collection_model_dict)
+ # Construct a model instance of LoadBalancerPoolMemberPrototype by calling from_dict on the json representation
+ load_balancer_pool_member_prototype_model = LoadBalancerPoolMemberPrototype.from_dict(load_balancer_pool_member_prototype_model_json)
+ assert load_balancer_pool_member_prototype_model != False
+
+ # Construct a model instance of LoadBalancerPoolMemberPrototype by calling from_dict on the json representation
+ load_balancer_pool_member_prototype_model_dict = LoadBalancerPoolMemberPrototype.from_dict(load_balancer_pool_member_prototype_model_json).__dict__
+ load_balancer_pool_member_prototype_model2 = LoadBalancerPoolMemberPrototype(**load_balancer_pool_member_prototype_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_collection_model == load_balancer_listener_collection_model2
+ assert load_balancer_pool_member_prototype_model == load_balancer_pool_member_prototype_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_collection_model_json2 = load_balancer_listener_collection_model.to_dict()
- assert load_balancer_listener_collection_model_json2 == load_balancer_listener_collection_model_json
+ load_balancer_pool_member_prototype_model_json2 = load_balancer_pool_member_prototype_model.to_dict()
+ assert load_balancer_pool_member_prototype_model_json2 == load_balancer_pool_member_prototype_model_json
-class TestModel_LoadBalancerListenerHTTPSRedirect():
+class TestModel_LoadBalancerPoolMemberReference():
"""
- Test Class for LoadBalancerListenerHTTPSRedirect
+ Test Class for LoadBalancerPoolMemberReference
"""
- def test_load_balancer_listener_https_redirect_serialization(self):
+ def test_load_balancer_pool_member_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerHTTPSRedirect
+ Test serialization/deserialization for LoadBalancerPoolMemberReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
- load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- load_balancer_listener_reference_model = {} # LoadBalancerListenerReference
- load_balancer_listener_reference_model['deleted'] = load_balancer_listener_reference_deleted_model
- load_balancer_listener_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
+ load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a LoadBalancerListenerHTTPSRedirect model
- load_balancer_listener_https_redirect_model_json = {}
- load_balancer_listener_https_redirect_model_json['http_status_code'] = 301
- load_balancer_listener_https_redirect_model_json['listener'] = load_balancer_listener_reference_model
- load_balancer_listener_https_redirect_model_json['uri'] = '/example?doc=get'
+ # Construct a json representation of a LoadBalancerPoolMemberReference model
+ load_balancer_pool_member_reference_model_json = {}
+ load_balancer_pool_member_reference_model_json['deleted'] = load_balancer_pool_member_reference_deleted_model
+ load_balancer_pool_member_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- # Construct a model instance of LoadBalancerListenerHTTPSRedirect by calling from_dict on the json representation
- load_balancer_listener_https_redirect_model = LoadBalancerListenerHTTPSRedirect.from_dict(load_balancer_listener_https_redirect_model_json)
- assert load_balancer_listener_https_redirect_model != False
+ # Construct a model instance of LoadBalancerPoolMemberReference by calling from_dict on the json representation
+ load_balancer_pool_member_reference_model = LoadBalancerPoolMemberReference.from_dict(load_balancer_pool_member_reference_model_json)
+ assert load_balancer_pool_member_reference_model != False
- # Construct a model instance of LoadBalancerListenerHTTPSRedirect by calling from_dict on the json representation
- load_balancer_listener_https_redirect_model_dict = LoadBalancerListenerHTTPSRedirect.from_dict(load_balancer_listener_https_redirect_model_json).__dict__
- load_balancer_listener_https_redirect_model2 = LoadBalancerListenerHTTPSRedirect(**load_balancer_listener_https_redirect_model_dict)
+ # Construct a model instance of LoadBalancerPoolMemberReference by calling from_dict on the json representation
+ load_balancer_pool_member_reference_model_dict = LoadBalancerPoolMemberReference.from_dict(load_balancer_pool_member_reference_model_json).__dict__
+ load_balancer_pool_member_reference_model2 = LoadBalancerPoolMemberReference(**load_balancer_pool_member_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_https_redirect_model == load_balancer_listener_https_redirect_model2
+ assert load_balancer_pool_member_reference_model == load_balancer_pool_member_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_https_redirect_model_json2 = load_balancer_listener_https_redirect_model.to_dict()
- assert load_balancer_listener_https_redirect_model_json2 == load_balancer_listener_https_redirect_model_json
+ load_balancer_pool_member_reference_model_json2 = load_balancer_pool_member_reference_model.to_dict()
+ assert load_balancer_pool_member_reference_model_json2 == load_balancer_pool_member_reference_model_json
-class TestModel_LoadBalancerListenerHTTPSRedirectPatch():
+class TestModel_LoadBalancerPoolMemberReferenceDeleted():
"""
- Test Class for LoadBalancerListenerHTTPSRedirectPatch
+ Test Class for LoadBalancerPoolMemberReferenceDeleted
"""
- def test_load_balancer_listener_https_redirect_patch_serialization(self):
+ def test_load_balancer_pool_member_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPatch
+ Test serialization/deserialization for LoadBalancerPoolMemberReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- # Construct a json representation of a LoadBalancerListenerHTTPSRedirectPatch model
- load_balancer_listener_https_redirect_patch_model_json = {}
- load_balancer_listener_https_redirect_patch_model_json['http_status_code'] = 301
- load_balancer_listener_https_redirect_patch_model_json['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_patch_model_json['uri'] = '/example?doc=get'
+ # Construct a json representation of a LoadBalancerPoolMemberReferenceDeleted model
+ load_balancer_pool_member_reference_deleted_model_json = {}
+ load_balancer_pool_member_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation
- load_balancer_listener_https_redirect_patch_model = LoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_https_redirect_patch_model_json)
- assert load_balancer_listener_https_redirect_patch_model != False
+ # Construct a model instance of LoadBalancerPoolMemberReferenceDeleted by calling from_dict on the json representation
+ load_balancer_pool_member_reference_deleted_model = LoadBalancerPoolMemberReferenceDeleted.from_dict(load_balancer_pool_member_reference_deleted_model_json)
+ assert load_balancer_pool_member_reference_deleted_model != False
- # Construct a model instance of LoadBalancerListenerHTTPSRedirectPatch by calling from_dict on the json representation
- load_balancer_listener_https_redirect_patch_model_dict = LoadBalancerListenerHTTPSRedirectPatch.from_dict(load_balancer_listener_https_redirect_patch_model_json).__dict__
- load_balancer_listener_https_redirect_patch_model2 = LoadBalancerListenerHTTPSRedirectPatch(**load_balancer_listener_https_redirect_patch_model_dict)
+ # Construct a model instance of LoadBalancerPoolMemberReferenceDeleted by calling from_dict on the json representation
+ load_balancer_pool_member_reference_deleted_model_dict = LoadBalancerPoolMemberReferenceDeleted.from_dict(load_balancer_pool_member_reference_deleted_model_json).__dict__
+ load_balancer_pool_member_reference_deleted_model2 = LoadBalancerPoolMemberReferenceDeleted(**load_balancer_pool_member_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_https_redirect_patch_model == load_balancer_listener_https_redirect_patch_model2
+ assert load_balancer_pool_member_reference_deleted_model == load_balancer_pool_member_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_https_redirect_patch_model_json2 = load_balancer_listener_https_redirect_patch_model.to_dict()
- assert load_balancer_listener_https_redirect_patch_model_json2 == load_balancer_listener_https_redirect_patch_model_json
+ load_balancer_pool_member_reference_deleted_model_json2 = load_balancer_pool_member_reference_deleted_model.to_dict()
+ assert load_balancer_pool_member_reference_deleted_model_json2 == load_balancer_pool_member_reference_deleted_model_json
-class TestModel_LoadBalancerListenerHTTPSRedirectPrototype():
+class TestModel_LoadBalancerPoolPatch():
"""
- Test Class for LoadBalancerListenerHTTPSRedirectPrototype
+ Test Class for LoadBalancerPoolPatch
"""
- def test_load_balancer_listener_https_redirect_prototype_serialization(self):
+ def test_load_balancer_pool_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerHTTPSRedirectPrototype
+ Test serialization/deserialization for LoadBalancerPoolPatch
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_health_monitor_patch_model = {} # LoadBalancerPoolHealthMonitorPatch
+ load_balancer_pool_health_monitor_patch_model['delay'] = 5
+ load_balancer_pool_health_monitor_patch_model['max_retries'] = 2
+ load_balancer_pool_health_monitor_patch_model['port'] = 22
+ load_balancer_pool_health_monitor_patch_model['timeout'] = 2
+ load_balancer_pool_health_monitor_patch_model['type'] = 'http'
+ load_balancer_pool_health_monitor_patch_model['url_path'] = '/'
- # Construct a json representation of a LoadBalancerListenerHTTPSRedirectPrototype model
- load_balancer_listener_https_redirect_prototype_model_json = {}
- load_balancer_listener_https_redirect_prototype_model_json['http_status_code'] = 301
- load_balancer_listener_https_redirect_prototype_model_json['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_prototype_model_json['uri'] = '/example?doc=get'
+ load_balancer_pool_session_persistence_patch_model = {} # LoadBalancerPoolSessionPersistencePatch
+ load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie'
- # Construct a model instance of LoadBalancerListenerHTTPSRedirectPrototype by calling from_dict on the json representation
- load_balancer_listener_https_redirect_prototype_model = LoadBalancerListenerHTTPSRedirectPrototype.from_dict(load_balancer_listener_https_redirect_prototype_model_json)
- assert load_balancer_listener_https_redirect_prototype_model != False
+ # Construct a json representation of a LoadBalancerPoolPatch model
+ load_balancer_pool_patch_model_json = {}
+ load_balancer_pool_patch_model_json['algorithm'] = 'least_connections'
+ load_balancer_pool_patch_model_json['health_monitor'] = load_balancer_pool_health_monitor_patch_model
+ load_balancer_pool_patch_model_json['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_patch_model_json['protocol'] = 'http'
+ load_balancer_pool_patch_model_json['proxy_protocol'] = 'disabled'
+ load_balancer_pool_patch_model_json['session_persistence'] = load_balancer_pool_session_persistence_patch_model
- # Construct a model instance of LoadBalancerListenerHTTPSRedirectPrototype by calling from_dict on the json representation
- load_balancer_listener_https_redirect_prototype_model_dict = LoadBalancerListenerHTTPSRedirectPrototype.from_dict(load_balancer_listener_https_redirect_prototype_model_json).__dict__
- load_balancer_listener_https_redirect_prototype_model2 = LoadBalancerListenerHTTPSRedirectPrototype(**load_balancer_listener_https_redirect_prototype_model_dict)
+ # Construct a model instance of LoadBalancerPoolPatch by calling from_dict on the json representation
+ load_balancer_pool_patch_model = LoadBalancerPoolPatch.from_dict(load_balancer_pool_patch_model_json)
+ assert load_balancer_pool_patch_model != False
+
+ # Construct a model instance of LoadBalancerPoolPatch by calling from_dict on the json representation
+ load_balancer_pool_patch_model_dict = LoadBalancerPoolPatch.from_dict(load_balancer_pool_patch_model_json).__dict__
+ load_balancer_pool_patch_model2 = LoadBalancerPoolPatch(**load_balancer_pool_patch_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_https_redirect_prototype_model == load_balancer_listener_https_redirect_prototype_model2
+ assert load_balancer_pool_patch_model == load_balancer_pool_patch_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_https_redirect_prototype_model_json2 = load_balancer_listener_https_redirect_prototype_model.to_dict()
- assert load_balancer_listener_https_redirect_prototype_model_json2 == load_balancer_listener_https_redirect_prototype_model_json
+ load_balancer_pool_patch_model_json2 = load_balancer_pool_patch_model.to_dict()
+ assert load_balancer_pool_patch_model_json2 == load_balancer_pool_patch_model_json
-class TestModel_LoadBalancerListenerPatch():
+class TestModel_LoadBalancerPoolPrototype():
"""
- Test Class for LoadBalancerListenerPatch
+ Test Class for LoadBalancerPoolPrototype
"""
- def test_load_balancer_listener_patch_serialization(self):
+ def test_load_balancer_pool_prototype_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPatch
+ Test serialization/deserialization for LoadBalancerPoolPrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- certificate_instance_identity_model = {} # CertificateInstanceIdentityByCRN
- certificate_instance_identity_model['crn'] = 'crn:v1:bluemix:public:cloudcerts:us-south:a/123456:b8866ea4-b8df-467e-801a-da1db7e020bf:certificate:78ff9c4c97d013fb2a95b21dddde7758'
+ load_balancer_pool_health_monitor_prototype_model = {} # LoadBalancerPoolHealthMonitorPrototype
+ load_balancer_pool_health_monitor_prototype_model['delay'] = 5
+ load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2
+ load_balancer_pool_health_monitor_prototype_model['port'] = 22
+ load_balancer_pool_health_monitor_prototype_model['timeout'] = 2
+ load_balancer_pool_health_monitor_prototype_model['type'] = 'http'
+ load_balancer_pool_health_monitor_prototype_model['url_path'] = '/'
- load_balancer_pool_identity_model = {} # LoadBalancerPoolIdentityById
- load_balancer_pool_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById
+ load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_listener_identity_model = {} # LoadBalancerListenerIdentityById
- load_balancer_listener_identity_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_member_prototype_model = {} # LoadBalancerPoolMemberPrototype
+ load_balancer_pool_member_prototype_model['port'] = 80
+ load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
+ load_balancer_pool_member_prototype_model['weight'] = 50
- load_balancer_listener_https_redirect_patch_model = {} # LoadBalancerListenerHTTPSRedirectPatch
- load_balancer_listener_https_redirect_patch_model['http_status_code'] = 301
- load_balancer_listener_https_redirect_patch_model['listener'] = load_balancer_listener_identity_model
- load_balancer_listener_https_redirect_patch_model['uri'] = '/example?doc=get'
+ load_balancer_pool_session_persistence_prototype_model = {} # LoadBalancerPoolSessionPersistencePrototype
+ load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie'
- # Construct a json representation of a LoadBalancerListenerPatch model
- load_balancer_listener_patch_model_json = {}
- load_balancer_listener_patch_model_json['accept_proxy_protocol'] = True
- load_balancer_listener_patch_model_json['certificate_instance'] = certificate_instance_identity_model
- load_balancer_listener_patch_model_json['connection_limit'] = 2000
- load_balancer_listener_patch_model_json['default_pool'] = load_balancer_pool_identity_model
- load_balancer_listener_patch_model_json['https_redirect'] = load_balancer_listener_https_redirect_patch_model
- load_balancer_listener_patch_model_json['port'] = 443
- load_balancer_listener_patch_model_json['port_max'] = 499
- load_balancer_listener_patch_model_json['port_min'] = 443
- load_balancer_listener_patch_model_json['protocol'] = 'http'
+ # Construct a json representation of a LoadBalancerPoolPrototype model
+ load_balancer_pool_prototype_model_json = {}
+ load_balancer_pool_prototype_model_json['algorithm'] = 'least_connections'
+ load_balancer_pool_prototype_model_json['health_monitor'] = load_balancer_pool_health_monitor_prototype_model
+ load_balancer_pool_prototype_model_json['members'] = [load_balancer_pool_member_prototype_model]
+ load_balancer_pool_prototype_model_json['name'] = 'my-load-balancer-pool'
+ load_balancer_pool_prototype_model_json['protocol'] = 'http'
+ load_balancer_pool_prototype_model_json['proxy_protocol'] = 'disabled'
+ load_balancer_pool_prototype_model_json['session_persistence'] = load_balancer_pool_session_persistence_prototype_model
- # Construct a model instance of LoadBalancerListenerPatch by calling from_dict on the json representation
- load_balancer_listener_patch_model = LoadBalancerListenerPatch.from_dict(load_balancer_listener_patch_model_json)
- assert load_balancer_listener_patch_model != False
+ # Construct a model instance of LoadBalancerPoolPrototype by calling from_dict on the json representation
+ load_balancer_pool_prototype_model = LoadBalancerPoolPrototype.from_dict(load_balancer_pool_prototype_model_json)
+ assert load_balancer_pool_prototype_model != False
- # Construct a model instance of LoadBalancerListenerPatch by calling from_dict on the json representation
- load_balancer_listener_patch_model_dict = LoadBalancerListenerPatch.from_dict(load_balancer_listener_patch_model_json).__dict__
- load_balancer_listener_patch_model2 = LoadBalancerListenerPatch(**load_balancer_listener_patch_model_dict)
+ # Construct a model instance of LoadBalancerPoolPrototype by calling from_dict on the json representation
+ load_balancer_pool_prototype_model_dict = LoadBalancerPoolPrototype.from_dict(load_balancer_pool_prototype_model_json).__dict__
+ load_balancer_pool_prototype_model2 = LoadBalancerPoolPrototype(**load_balancer_pool_prototype_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_patch_model == load_balancer_listener_patch_model2
+ assert load_balancer_pool_prototype_model == load_balancer_pool_prototype_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_patch_model_json2 = load_balancer_listener_patch_model.to_dict()
- assert load_balancer_listener_patch_model_json2 == load_balancer_listener_patch_model_json
+ load_balancer_pool_prototype_model_json2 = load_balancer_pool_prototype_model.to_dict()
+ assert load_balancer_pool_prototype_model_json2 == load_balancer_pool_prototype_model_json
-class TestModel_LoadBalancerListenerPolicy():
+class TestModel_LoadBalancerPoolReference():
"""
- Test Class for LoadBalancerListenerPolicy
+ Test Class for LoadBalancerPoolReference
"""
- def test_load_balancer_listener_policy_serialization(self):
+ def test_load_balancer_pool_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicy
+ Test serialization/deserialization for LoadBalancerPoolReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_listener_policy_rule_reference_deleted_model = {} # LoadBalancerListenerPolicyRuleReferenceDeleted
- load_balancer_listener_policy_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- load_balancer_listener_policy_rule_reference_model = {} # LoadBalancerListenerPolicyRuleReference
- load_balancer_listener_policy_rule_reference_model['deleted'] = load_balancer_listener_policy_rule_reference_deleted_model
- load_balancer_listener_policy_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
- load_balancer_listener_policy_rule_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_listener_policy_target_model = {} # LoadBalancerListenerPolicyTargetLoadBalancerPoolReference
- load_balancer_listener_policy_target_model['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_listener_policy_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_policy_target_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_policy_target_model['name'] = 'my-load-balancer-pool'
-
- # Construct a json representation of a LoadBalancerListenerPolicy model
- load_balancer_listener_policy_model_json = {}
- load_balancer_listener_policy_model_json['action'] = 'forward'
- load_balancer_listener_policy_model_json['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_listener_policy_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
- load_balancer_listener_policy_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_policy_model_json['name'] = 'my-policy'
- load_balancer_listener_policy_model_json['priority'] = 5
- load_balancer_listener_policy_model_json['provisioning_status'] = 'active'
- load_balancer_listener_policy_model_json['rules'] = [load_balancer_listener_policy_rule_reference_model]
- load_balancer_listener_policy_model_json['target'] = load_balancer_listener_policy_target_model
+ # Construct a json representation of a LoadBalancerPoolReference model
+ load_balancer_pool_reference_model_json = {}
+ load_balancer_pool_reference_model_json['deleted'] = load_balancer_pool_reference_deleted_model
+ load_balancer_pool_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_pool_reference_model_json['name'] = 'my-load-balancer-pool'
- # Construct a model instance of LoadBalancerListenerPolicy by calling from_dict on the json representation
- load_balancer_listener_policy_model = LoadBalancerListenerPolicy.from_dict(load_balancer_listener_policy_model_json)
- assert load_balancer_listener_policy_model != False
+ # Construct a model instance of LoadBalancerPoolReference by calling from_dict on the json representation
+ load_balancer_pool_reference_model = LoadBalancerPoolReference.from_dict(load_balancer_pool_reference_model_json)
+ assert load_balancer_pool_reference_model != False
- # Construct a model instance of LoadBalancerListenerPolicy by calling from_dict on the json representation
- load_balancer_listener_policy_model_dict = LoadBalancerListenerPolicy.from_dict(load_balancer_listener_policy_model_json).__dict__
- load_balancer_listener_policy_model2 = LoadBalancerListenerPolicy(**load_balancer_listener_policy_model_dict)
+ # Construct a model instance of LoadBalancerPoolReference by calling from_dict on the json representation
+ load_balancer_pool_reference_model_dict = LoadBalancerPoolReference.from_dict(load_balancer_pool_reference_model_json).__dict__
+ load_balancer_pool_reference_model2 = LoadBalancerPoolReference(**load_balancer_pool_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_model == load_balancer_listener_policy_model2
+ assert load_balancer_pool_reference_model == load_balancer_pool_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_model_json2 = load_balancer_listener_policy_model.to_dict()
- assert load_balancer_listener_policy_model_json2 == load_balancer_listener_policy_model_json
+ load_balancer_pool_reference_model_json2 = load_balancer_pool_reference_model.to_dict()
+ assert load_balancer_pool_reference_model_json2 == load_balancer_pool_reference_model_json
-class TestModel_LoadBalancerListenerPolicyCollection():
+class TestModel_LoadBalancerPoolReferenceDeleted():
"""
- Test Class for LoadBalancerListenerPolicyCollection
+ Test Class for LoadBalancerPoolReferenceDeleted
"""
- def test_load_balancer_listener_policy_collection_serialization(self):
+ def test_load_balancer_pool_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyCollection
+ Test serialization/deserialization for LoadBalancerPoolReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a LoadBalancerPoolReferenceDeleted model
+ load_balancer_pool_reference_deleted_model_json = {}
+ load_balancer_pool_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_listener_policy_rule_reference_deleted_model = {} # LoadBalancerListenerPolicyRuleReferenceDeleted
- load_balancer_listener_policy_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of LoadBalancerPoolReferenceDeleted by calling from_dict on the json representation
+ load_balancer_pool_reference_deleted_model = LoadBalancerPoolReferenceDeleted.from_dict(load_balancer_pool_reference_deleted_model_json)
+ assert load_balancer_pool_reference_deleted_model != False
- load_balancer_listener_policy_rule_reference_model = {} # LoadBalancerListenerPolicyRuleReference
- load_balancer_listener_policy_rule_reference_model['deleted'] = load_balancer_listener_policy_rule_reference_deleted_model
- load_balancer_listener_policy_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
- load_balancer_listener_policy_rule_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a model instance of LoadBalancerPoolReferenceDeleted by calling from_dict on the json representation
+ load_balancer_pool_reference_deleted_model_dict = LoadBalancerPoolReferenceDeleted.from_dict(load_balancer_pool_reference_deleted_model_json).__dict__
+ load_balancer_pool_reference_deleted_model2 = LoadBalancerPoolReferenceDeleted(**load_balancer_pool_reference_deleted_model_dict)
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert load_balancer_pool_reference_deleted_model == load_balancer_pool_reference_deleted_model2
- load_balancer_listener_policy_target_model = {} # LoadBalancerListenerPolicyTargetLoadBalancerPoolReference
- load_balancer_listener_policy_target_model['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_listener_policy_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_policy_target_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_policy_target_model['name'] = 'my-load-balancer-pool'
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_pool_reference_deleted_model_json2 = load_balancer_pool_reference_deleted_model.to_dict()
+ assert load_balancer_pool_reference_deleted_model_json2 == load_balancer_pool_reference_deleted_model_json
- load_balancer_listener_policy_model = {} # LoadBalancerListenerPolicy
- load_balancer_listener_policy_model['action'] = 'forward'
- load_balancer_listener_policy_model['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_listener_policy_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
- load_balancer_listener_policy_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_policy_model['name'] = 'my-policy'
- load_balancer_listener_policy_model['priority'] = 5
- load_balancer_listener_policy_model['provisioning_status'] = 'active'
- load_balancer_listener_policy_model['rules'] = [load_balancer_listener_policy_rule_reference_model]
- load_balancer_listener_policy_model['target'] = load_balancer_listener_policy_target_model
+class TestModel_LoadBalancerPoolSessionPersistence():
+ """
+ Test Class for LoadBalancerPoolSessionPersistence
+ """
- # Construct a json representation of a LoadBalancerListenerPolicyCollection model
- load_balancer_listener_policy_collection_model_json = {}
- load_balancer_listener_policy_collection_model_json['policies'] = [load_balancer_listener_policy_model]
+ def test_load_balancer_pool_session_persistence_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPoolSessionPersistence
+ """
- # Construct a model instance of LoadBalancerListenerPolicyCollection by calling from_dict on the json representation
- load_balancer_listener_policy_collection_model = LoadBalancerListenerPolicyCollection.from_dict(load_balancer_listener_policy_collection_model_json)
- assert load_balancer_listener_policy_collection_model != False
+ # Construct a json representation of a LoadBalancerPoolSessionPersistence model
+ load_balancer_pool_session_persistence_model_json = {}
+ load_balancer_pool_session_persistence_model_json['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_model_json['type'] = 'app_cookie'
- # Construct a model instance of LoadBalancerListenerPolicyCollection by calling from_dict on the json representation
- load_balancer_listener_policy_collection_model_dict = LoadBalancerListenerPolicyCollection.from_dict(load_balancer_listener_policy_collection_model_json).__dict__
- load_balancer_listener_policy_collection_model2 = LoadBalancerListenerPolicyCollection(**load_balancer_listener_policy_collection_model_dict)
+ # Construct a model instance of LoadBalancerPoolSessionPersistence by calling from_dict on the json representation
+ load_balancer_pool_session_persistence_model = LoadBalancerPoolSessionPersistence.from_dict(load_balancer_pool_session_persistence_model_json)
+ assert load_balancer_pool_session_persistence_model != False
+
+ # Construct a model instance of LoadBalancerPoolSessionPersistence by calling from_dict on the json representation
+ load_balancer_pool_session_persistence_model_dict = LoadBalancerPoolSessionPersistence.from_dict(load_balancer_pool_session_persistence_model_json).__dict__
+ load_balancer_pool_session_persistence_model2 = LoadBalancerPoolSessionPersistence(**load_balancer_pool_session_persistence_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_collection_model == load_balancer_listener_policy_collection_model2
+ assert load_balancer_pool_session_persistence_model == load_balancer_pool_session_persistence_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_collection_model_json2 = load_balancer_listener_policy_collection_model.to_dict()
- assert load_balancer_listener_policy_collection_model_json2 == load_balancer_listener_policy_collection_model_json
+ load_balancer_pool_session_persistence_model_json2 = load_balancer_pool_session_persistence_model.to_dict()
+ assert load_balancer_pool_session_persistence_model_json2 == load_balancer_pool_session_persistence_model_json
-class TestModel_LoadBalancerListenerPolicyPatch():
+class TestModel_LoadBalancerPoolSessionPersistencePatch():
"""
- Test Class for LoadBalancerListenerPolicyPatch
+ Test Class for LoadBalancerPoolSessionPersistencePatch
"""
- def test_load_balancer_listener_policy_patch_serialization(self):
+ def test_load_balancer_pool_session_persistence_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyPatch
+ Test serialization/deserialization for LoadBalancerPoolSessionPersistencePatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a LoadBalancerPoolSessionPersistencePatch model
+ load_balancer_pool_session_persistence_patch_model_json = {}
+ load_balancer_pool_session_persistence_patch_model_json['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_patch_model_json['type'] = 'app_cookie'
- load_balancer_listener_policy_target_patch_model = {} # LoadBalancerListenerPolicyTargetPatchLoadBalancerPoolIdentityLoadBalancerPoolIdentityById
- load_balancer_listener_policy_target_patch_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a model instance of LoadBalancerPoolSessionPersistencePatch by calling from_dict on the json representation
+ load_balancer_pool_session_persistence_patch_model = LoadBalancerPoolSessionPersistencePatch.from_dict(load_balancer_pool_session_persistence_patch_model_json)
+ assert load_balancer_pool_session_persistence_patch_model != False
- # Construct a json representation of a LoadBalancerListenerPolicyPatch model
- load_balancer_listener_policy_patch_model_json = {}
- load_balancer_listener_policy_patch_model_json['name'] = 'my-policy'
- load_balancer_listener_policy_patch_model_json['priority'] = 5
- load_balancer_listener_policy_patch_model_json['target'] = load_balancer_listener_policy_target_patch_model
+ # Construct a model instance of LoadBalancerPoolSessionPersistencePatch by calling from_dict on the json representation
+ load_balancer_pool_session_persistence_patch_model_dict = LoadBalancerPoolSessionPersistencePatch.from_dict(load_balancer_pool_session_persistence_patch_model_json).__dict__
+ load_balancer_pool_session_persistence_patch_model2 = LoadBalancerPoolSessionPersistencePatch(**load_balancer_pool_session_persistence_patch_model_dict)
- # Construct a model instance of LoadBalancerListenerPolicyPatch by calling from_dict on the json representation
- load_balancer_listener_policy_patch_model = LoadBalancerListenerPolicyPatch.from_dict(load_balancer_listener_policy_patch_model_json)
- assert load_balancer_listener_policy_patch_model != False
+ # Verify the model instances are equivalent
+ assert load_balancer_pool_session_persistence_patch_model == load_balancer_pool_session_persistence_patch_model2
- # Construct a model instance of LoadBalancerListenerPolicyPatch by calling from_dict on the json representation
- load_balancer_listener_policy_patch_model_dict = LoadBalancerListenerPolicyPatch.from_dict(load_balancer_listener_policy_patch_model_json).__dict__
- load_balancer_listener_policy_patch_model2 = LoadBalancerListenerPolicyPatch(**load_balancer_listener_policy_patch_model_dict)
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_pool_session_persistence_patch_model_json2 = load_balancer_pool_session_persistence_patch_model.to_dict()
+ assert load_balancer_pool_session_persistence_patch_model_json2 == load_balancer_pool_session_persistence_patch_model_json
+
+class TestModel_LoadBalancerPoolSessionPersistencePrototype():
+ """
+ Test Class for LoadBalancerPoolSessionPersistencePrototype
+ """
+
+ def test_load_balancer_pool_session_persistence_prototype_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerPoolSessionPersistencePrototype
+ """
+
+ # Construct a json representation of a LoadBalancerPoolSessionPersistencePrototype model
+ load_balancer_pool_session_persistence_prototype_model_json = {}
+ load_balancer_pool_session_persistence_prototype_model_json['cookie_name'] = 'my-cookie-name'
+ load_balancer_pool_session_persistence_prototype_model_json['type'] = 'app_cookie'
+
+ # Construct a model instance of LoadBalancerPoolSessionPersistencePrototype by calling from_dict on the json representation
+ load_balancer_pool_session_persistence_prototype_model = LoadBalancerPoolSessionPersistencePrototype.from_dict(load_balancer_pool_session_persistence_prototype_model_json)
+ assert load_balancer_pool_session_persistence_prototype_model != False
+
+ # Construct a model instance of LoadBalancerPoolSessionPersistencePrototype by calling from_dict on the json representation
+ load_balancer_pool_session_persistence_prototype_model_dict = LoadBalancerPoolSessionPersistencePrototype.from_dict(load_balancer_pool_session_persistence_prototype_model_json).__dict__
+ load_balancer_pool_session_persistence_prototype_model2 = LoadBalancerPoolSessionPersistencePrototype(**load_balancer_pool_session_persistence_prototype_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_patch_model == load_balancer_listener_policy_patch_model2
+ assert load_balancer_pool_session_persistence_prototype_model == load_balancer_pool_session_persistence_prototype_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_patch_model_json2 = load_balancer_listener_policy_patch_model.to_dict()
- assert load_balancer_listener_policy_patch_model_json2 == load_balancer_listener_policy_patch_model_json
+ load_balancer_pool_session_persistence_prototype_model_json2 = load_balancer_pool_session_persistence_prototype_model.to_dict()
+ assert load_balancer_pool_session_persistence_prototype_model_json2 == load_balancer_pool_session_persistence_prototype_model_json
-class TestModel_LoadBalancerListenerPolicyPrototype():
+class TestModel_LoadBalancerProfile():
"""
- Test Class for LoadBalancerListenerPolicyPrototype
+ Test Class for LoadBalancerProfile
"""
- def test_load_balancer_listener_policy_prototype_serialization(self):
+ def test_load_balancer_profile_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyPrototype
+ Test serialization/deserialization for LoadBalancerProfile
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_listener_policy_rule_prototype_model = {} # LoadBalancerListenerPolicyRulePrototype
- load_balancer_listener_policy_rule_prototype_model['condition'] = 'contains'
- load_balancer_listener_policy_rule_prototype_model['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_prototype_model['type'] = 'body'
- load_balancer_listener_policy_rule_prototype_model['value'] = 'testString'
+ load_balancer_profile_logging_supported_model = {} # LoadBalancerProfileLoggingSupported
+ load_balancer_profile_logging_supported_model['type'] = 'fixed'
+ load_balancer_profile_logging_supported_model['value'] = ['datapath']
- load_balancer_listener_policy_target_prototype_model = {} # LoadBalancerListenerPolicyTargetPrototypeLoadBalancerPoolIdentityLoadBalancerPoolIdentityById
- load_balancer_listener_policy_target_prototype_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_profile_route_mode_supported_model = {} # LoadBalancerProfileRouteModeSupportedFixed
+ load_balancer_profile_route_mode_supported_model['type'] = 'fixed'
+ load_balancer_profile_route_mode_supported_model['value'] = True
- # Construct a json representation of a LoadBalancerListenerPolicyPrototype model
- load_balancer_listener_policy_prototype_model_json = {}
- load_balancer_listener_policy_prototype_model_json['action'] = 'forward'
- load_balancer_listener_policy_prototype_model_json['name'] = 'my-policy'
- load_balancer_listener_policy_prototype_model_json['priority'] = 5
- load_balancer_listener_policy_prototype_model_json['rules'] = [load_balancer_listener_policy_rule_prototype_model]
- load_balancer_listener_policy_prototype_model_json['target'] = load_balancer_listener_policy_target_prototype_model
+ load_balancer_profile_security_groups_supported_model = {} # LoadBalancerProfileSecurityGroupsSupportedFixed
+ load_balancer_profile_security_groups_supported_model['type'] = 'fixed'
+ load_balancer_profile_security_groups_supported_model['value'] = True
- # Construct a model instance of LoadBalancerListenerPolicyPrototype by calling from_dict on the json representation
- load_balancer_listener_policy_prototype_model = LoadBalancerListenerPolicyPrototype.from_dict(load_balancer_listener_policy_prototype_model_json)
- assert load_balancer_listener_policy_prototype_model != False
+ # Construct a json representation of a LoadBalancerProfile model
+ load_balancer_profile_model_json = {}
+ load_balancer_profile_model_json['family'] = 'network'
+ load_balancer_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
+ load_balancer_profile_model_json['logging_supported'] = load_balancer_profile_logging_supported_model
+ load_balancer_profile_model_json['name'] = 'network-fixed'
+ load_balancer_profile_model_json['route_mode_supported'] = load_balancer_profile_route_mode_supported_model
+ load_balancer_profile_model_json['security_groups_supported'] = load_balancer_profile_security_groups_supported_model
- # Construct a model instance of LoadBalancerListenerPolicyPrototype by calling from_dict on the json representation
- load_balancer_listener_policy_prototype_model_dict = LoadBalancerListenerPolicyPrototype.from_dict(load_balancer_listener_policy_prototype_model_json).__dict__
- load_balancer_listener_policy_prototype_model2 = LoadBalancerListenerPolicyPrototype(**load_balancer_listener_policy_prototype_model_dict)
+ # Construct a model instance of LoadBalancerProfile by calling from_dict on the json representation
+ load_balancer_profile_model = LoadBalancerProfile.from_dict(load_balancer_profile_model_json)
+ assert load_balancer_profile_model != False
+
+ # Construct a model instance of LoadBalancerProfile by calling from_dict on the json representation
+ load_balancer_profile_model_dict = LoadBalancerProfile.from_dict(load_balancer_profile_model_json).__dict__
+ load_balancer_profile_model2 = LoadBalancerProfile(**load_balancer_profile_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_prototype_model == load_balancer_listener_policy_prototype_model2
+ assert load_balancer_profile_model == load_balancer_profile_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_prototype_model_json2 = load_balancer_listener_policy_prototype_model.to_dict()
- assert load_balancer_listener_policy_prototype_model_json2 == load_balancer_listener_policy_prototype_model_json
+ load_balancer_profile_model_json2 = load_balancer_profile_model.to_dict()
+ assert load_balancer_profile_model_json2 == load_balancer_profile_model_json
-class TestModel_LoadBalancerListenerPolicyReference():
+class TestModel_LoadBalancerProfileCollection():
"""
- Test Class for LoadBalancerListenerPolicyReference
+ Test Class for LoadBalancerProfileCollection
"""
- def test_load_balancer_listener_policy_reference_serialization(self):
+ def test_load_balancer_profile_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyReference
+ Test serialization/deserialization for LoadBalancerProfileCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_listener_policy_reference_deleted_model = {} # LoadBalancerListenerPolicyReferenceDeleted
- load_balancer_listener_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ load_balancer_profile_collection_first_model = {} # LoadBalancerProfileCollectionFirst
+ load_balancer_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20'
- # Construct a json representation of a LoadBalancerListenerPolicyReference model
- load_balancer_listener_policy_reference_model_json = {}
- load_balancer_listener_policy_reference_model_json['deleted'] = load_balancer_listener_policy_reference_deleted_model
- load_balancer_listener_policy_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278'
- load_balancer_listener_policy_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ load_balancer_profile_collection_next_model = {} # LoadBalancerProfileCollectionNext
+ load_balancer_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of LoadBalancerListenerPolicyReference by calling from_dict on the json representation
- load_balancer_listener_policy_reference_model = LoadBalancerListenerPolicyReference.from_dict(load_balancer_listener_policy_reference_model_json)
- assert load_balancer_listener_policy_reference_model != False
+ load_balancer_profile_logging_supported_model = {} # LoadBalancerProfileLoggingSupported
+ load_balancer_profile_logging_supported_model['type'] = 'fixed'
+ load_balancer_profile_logging_supported_model['value'] = ['datapath']
- # Construct a model instance of LoadBalancerListenerPolicyReference by calling from_dict on the json representation
- load_balancer_listener_policy_reference_model_dict = LoadBalancerListenerPolicyReference.from_dict(load_balancer_listener_policy_reference_model_json).__dict__
- load_balancer_listener_policy_reference_model2 = LoadBalancerListenerPolicyReference(**load_balancer_listener_policy_reference_model_dict)
+ load_balancer_profile_route_mode_supported_model = {} # LoadBalancerProfileRouteModeSupportedFixed
+ load_balancer_profile_route_mode_supported_model['type'] = 'fixed'
+ load_balancer_profile_route_mode_supported_model['value'] = True
+
+ load_balancer_profile_security_groups_supported_model = {} # LoadBalancerProfileSecurityGroupsSupportedFixed
+ load_balancer_profile_security_groups_supported_model['type'] = 'fixed'
+ load_balancer_profile_security_groups_supported_model['value'] = True
+
+ load_balancer_profile_model = {} # LoadBalancerProfile
+ load_balancer_profile_model['family'] = 'network'
+ load_balancer_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
+ load_balancer_profile_model['logging_supported'] = load_balancer_profile_logging_supported_model
+ load_balancer_profile_model['name'] = 'network-fixed'
+ load_balancer_profile_model['route_mode_supported'] = load_balancer_profile_route_mode_supported_model
+ load_balancer_profile_model['security_groups_supported'] = load_balancer_profile_security_groups_supported_model
+
+ # Construct a json representation of a LoadBalancerProfileCollection model
+ load_balancer_profile_collection_model_json = {}
+ load_balancer_profile_collection_model_json['first'] = load_balancer_profile_collection_first_model
+ load_balancer_profile_collection_model_json['limit'] = 20
+ load_balancer_profile_collection_model_json['next'] = load_balancer_profile_collection_next_model
+ load_balancer_profile_collection_model_json['profiles'] = [load_balancer_profile_model]
+ load_balancer_profile_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of LoadBalancerProfileCollection by calling from_dict on the json representation
+ load_balancer_profile_collection_model = LoadBalancerProfileCollection.from_dict(load_balancer_profile_collection_model_json)
+ assert load_balancer_profile_collection_model != False
+
+ # Construct a model instance of LoadBalancerProfileCollection by calling from_dict on the json representation
+ load_balancer_profile_collection_model_dict = LoadBalancerProfileCollection.from_dict(load_balancer_profile_collection_model_json).__dict__
+ load_balancer_profile_collection_model2 = LoadBalancerProfileCollection(**load_balancer_profile_collection_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_reference_model == load_balancer_listener_policy_reference_model2
+ assert load_balancer_profile_collection_model == load_balancer_profile_collection_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_reference_model_json2 = load_balancer_listener_policy_reference_model.to_dict()
- assert load_balancer_listener_policy_reference_model_json2 == load_balancer_listener_policy_reference_model_json
+ load_balancer_profile_collection_model_json2 = load_balancer_profile_collection_model.to_dict()
+ assert load_balancer_profile_collection_model_json2 == load_balancer_profile_collection_model_json
-class TestModel_LoadBalancerListenerPolicyReferenceDeleted():
+class TestModel_LoadBalancerProfileCollectionFirst():
"""
- Test Class for LoadBalancerListenerPolicyReferenceDeleted
+ Test Class for LoadBalancerProfileCollectionFirst
"""
- def test_load_balancer_listener_policy_reference_deleted_serialization(self):
+ def test_load_balancer_profile_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyReferenceDeleted
+ Test serialization/deserialization for LoadBalancerProfileCollectionFirst
"""
- # Construct a json representation of a LoadBalancerListenerPolicyReferenceDeleted model
- load_balancer_listener_policy_reference_deleted_model_json = {}
- load_balancer_listener_policy_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a LoadBalancerProfileCollectionFirst model
+ load_balancer_profile_collection_first_model_json = {}
+ load_balancer_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20'
- # Construct a model instance of LoadBalancerListenerPolicyReferenceDeleted by calling from_dict on the json representation
- load_balancer_listener_policy_reference_deleted_model = LoadBalancerListenerPolicyReferenceDeleted.from_dict(load_balancer_listener_policy_reference_deleted_model_json)
- assert load_balancer_listener_policy_reference_deleted_model != False
+ # Construct a model instance of LoadBalancerProfileCollectionFirst by calling from_dict on the json representation
+ load_balancer_profile_collection_first_model = LoadBalancerProfileCollectionFirst.from_dict(load_balancer_profile_collection_first_model_json)
+ assert load_balancer_profile_collection_first_model != False
- # Construct a model instance of LoadBalancerListenerPolicyReferenceDeleted by calling from_dict on the json representation
- load_balancer_listener_policy_reference_deleted_model_dict = LoadBalancerListenerPolicyReferenceDeleted.from_dict(load_balancer_listener_policy_reference_deleted_model_json).__dict__
- load_balancer_listener_policy_reference_deleted_model2 = LoadBalancerListenerPolicyReferenceDeleted(**load_balancer_listener_policy_reference_deleted_model_dict)
+ # Construct a model instance of LoadBalancerProfileCollectionFirst by calling from_dict on the json representation
+ load_balancer_profile_collection_first_model_dict = LoadBalancerProfileCollectionFirst.from_dict(load_balancer_profile_collection_first_model_json).__dict__
+ load_balancer_profile_collection_first_model2 = LoadBalancerProfileCollectionFirst(**load_balancer_profile_collection_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_reference_deleted_model == load_balancer_listener_policy_reference_deleted_model2
+ assert load_balancer_profile_collection_first_model == load_balancer_profile_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_reference_deleted_model_json2 = load_balancer_listener_policy_reference_deleted_model.to_dict()
- assert load_balancer_listener_policy_reference_deleted_model_json2 == load_balancer_listener_policy_reference_deleted_model_json
+ load_balancer_profile_collection_first_model_json2 = load_balancer_profile_collection_first_model.to_dict()
+ assert load_balancer_profile_collection_first_model_json2 == load_balancer_profile_collection_first_model_json
-class TestModel_LoadBalancerListenerPolicyRule():
+class TestModel_LoadBalancerProfileCollectionNext():
"""
- Test Class for LoadBalancerListenerPolicyRule
+ Test Class for LoadBalancerProfileCollectionNext
"""
- def test_load_balancer_listener_policy_rule_serialization(self):
+ def test_load_balancer_profile_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRule
+ Test serialization/deserialization for LoadBalancerProfileCollectionNext
"""
- # Construct a json representation of a LoadBalancerListenerPolicyRule model
- load_balancer_listener_policy_rule_model_json = {}
- load_balancer_listener_policy_rule_model_json['condition'] = 'contains'
- load_balancer_listener_policy_rule_model_json['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_listener_policy_rule_model_json['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
- load_balancer_listener_policy_rule_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_policy_rule_model_json['provisioning_status'] = 'active'
- load_balancer_listener_policy_rule_model_json['type'] = 'body'
- load_balancer_listener_policy_rule_model_json['value'] = 'testString'
+ # Construct a json representation of a LoadBalancerProfileCollectionNext model
+ load_balancer_profile_collection_next_model_json = {}
+ load_balancer_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of LoadBalancerListenerPolicyRule by calling from_dict on the json representation
- load_balancer_listener_policy_rule_model = LoadBalancerListenerPolicyRule.from_dict(load_balancer_listener_policy_rule_model_json)
- assert load_balancer_listener_policy_rule_model != False
+ # Construct a model instance of LoadBalancerProfileCollectionNext by calling from_dict on the json representation
+ load_balancer_profile_collection_next_model = LoadBalancerProfileCollectionNext.from_dict(load_balancer_profile_collection_next_model_json)
+ assert load_balancer_profile_collection_next_model != False
- # Construct a model instance of LoadBalancerListenerPolicyRule by calling from_dict on the json representation
- load_balancer_listener_policy_rule_model_dict = LoadBalancerListenerPolicyRule.from_dict(load_balancer_listener_policy_rule_model_json).__dict__
- load_balancer_listener_policy_rule_model2 = LoadBalancerListenerPolicyRule(**load_balancer_listener_policy_rule_model_dict)
+ # Construct a model instance of LoadBalancerProfileCollectionNext by calling from_dict on the json representation
+ load_balancer_profile_collection_next_model_dict = LoadBalancerProfileCollectionNext.from_dict(load_balancer_profile_collection_next_model_json).__dict__
+ load_balancer_profile_collection_next_model2 = LoadBalancerProfileCollectionNext(**load_balancer_profile_collection_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_model == load_balancer_listener_policy_rule_model2
+ assert load_balancer_profile_collection_next_model == load_balancer_profile_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_rule_model_json2 = load_balancer_listener_policy_rule_model.to_dict()
- assert load_balancer_listener_policy_rule_model_json2 == load_balancer_listener_policy_rule_model_json
+ load_balancer_profile_collection_next_model_json2 = load_balancer_profile_collection_next_model.to_dict()
+ assert load_balancer_profile_collection_next_model_json2 == load_balancer_profile_collection_next_model_json
-class TestModel_LoadBalancerListenerPolicyRuleCollection():
+class TestModel_LoadBalancerProfileLoggingSupported():
"""
- Test Class for LoadBalancerListenerPolicyRuleCollection
+ Test Class for LoadBalancerProfileLoggingSupported
"""
- def test_load_balancer_listener_policy_rule_collection_serialization(self):
+ def test_load_balancer_profile_logging_supported_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRuleCollection
+ Test serialization/deserialization for LoadBalancerProfileLoggingSupported
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a LoadBalancerProfileLoggingSupported model
+ load_balancer_profile_logging_supported_model_json = {}
+ load_balancer_profile_logging_supported_model_json['type'] = 'fixed'
+ load_balancer_profile_logging_supported_model_json['value'] = ['datapath']
- load_balancer_listener_policy_rule_model = {} # LoadBalancerListenerPolicyRule
- load_balancer_listener_policy_rule_model['condition'] = 'contains'
- load_balancer_listener_policy_rule_model['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_listener_policy_rule_model['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
- load_balancer_listener_policy_rule_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_policy_rule_model['provisioning_status'] = 'active'
- load_balancer_listener_policy_rule_model['type'] = 'body'
- load_balancer_listener_policy_rule_model['value'] = 'testString'
+ # Construct a model instance of LoadBalancerProfileLoggingSupported by calling from_dict on the json representation
+ load_balancer_profile_logging_supported_model = LoadBalancerProfileLoggingSupported.from_dict(load_balancer_profile_logging_supported_model_json)
+ assert load_balancer_profile_logging_supported_model != False
- # Construct a json representation of a LoadBalancerListenerPolicyRuleCollection model
- load_balancer_listener_policy_rule_collection_model_json = {}
- load_balancer_listener_policy_rule_collection_model_json['rules'] = [load_balancer_listener_policy_rule_model]
+ # Construct a model instance of LoadBalancerProfileLoggingSupported by calling from_dict on the json representation
+ load_balancer_profile_logging_supported_model_dict = LoadBalancerProfileLoggingSupported.from_dict(load_balancer_profile_logging_supported_model_json).__dict__
+ load_balancer_profile_logging_supported_model2 = LoadBalancerProfileLoggingSupported(**load_balancer_profile_logging_supported_model_dict)
- # Construct a model instance of LoadBalancerListenerPolicyRuleCollection by calling from_dict on the json representation
- load_balancer_listener_policy_rule_collection_model = LoadBalancerListenerPolicyRuleCollection.from_dict(load_balancer_listener_policy_rule_collection_model_json)
- assert load_balancer_listener_policy_rule_collection_model != False
+ # Verify the model instances are equivalent
+ assert load_balancer_profile_logging_supported_model == load_balancer_profile_logging_supported_model2
- # Construct a model instance of LoadBalancerListenerPolicyRuleCollection by calling from_dict on the json representation
- load_balancer_listener_policy_rule_collection_model_dict = LoadBalancerListenerPolicyRuleCollection.from_dict(load_balancer_listener_policy_rule_collection_model_json).__dict__
- load_balancer_listener_policy_rule_collection_model2 = LoadBalancerListenerPolicyRuleCollection(**load_balancer_listener_policy_rule_collection_model_dict)
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_profile_logging_supported_model_json2 = load_balancer_profile_logging_supported_model.to_dict()
+ assert load_balancer_profile_logging_supported_model_json2 == load_balancer_profile_logging_supported_model_json
+
+class TestModel_LoadBalancerProfileReference():
+ """
+ Test Class for LoadBalancerProfileReference
+ """
+
+ def test_load_balancer_profile_reference_serialization(self):
+ """
+ Test serialization/deserialization for LoadBalancerProfileReference
+ """
+
+ # Construct a json representation of a LoadBalancerProfileReference model
+ load_balancer_profile_reference_model_json = {}
+ load_balancer_profile_reference_model_json['family'] = 'network'
+ load_balancer_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
+ load_balancer_profile_reference_model_json['name'] = 'network-fixed'
+
+ # Construct a model instance of LoadBalancerProfileReference by calling from_dict on the json representation
+ load_balancer_profile_reference_model = LoadBalancerProfileReference.from_dict(load_balancer_profile_reference_model_json)
+ assert load_balancer_profile_reference_model != False
+
+ # Construct a model instance of LoadBalancerProfileReference by calling from_dict on the json representation
+ load_balancer_profile_reference_model_dict = LoadBalancerProfileReference.from_dict(load_balancer_profile_reference_model_json).__dict__
+ load_balancer_profile_reference_model2 = LoadBalancerProfileReference(**load_balancer_profile_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_collection_model == load_balancer_listener_policy_rule_collection_model2
+ assert load_balancer_profile_reference_model == load_balancer_profile_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_rule_collection_model_json2 = load_balancer_listener_policy_rule_collection_model.to_dict()
- assert load_balancer_listener_policy_rule_collection_model_json2 == load_balancer_listener_policy_rule_collection_model_json
+ load_balancer_profile_reference_model_json2 = load_balancer_profile_reference_model.to_dict()
+ assert load_balancer_profile_reference_model_json2 == load_balancer_profile_reference_model_json
-class TestModel_LoadBalancerListenerPolicyRulePatch():
+class TestModel_LoadBalancerReferenceDeleted():
"""
- Test Class for LoadBalancerListenerPolicyRulePatch
+ Test Class for LoadBalancerReferenceDeleted
"""
- def test_load_balancer_listener_policy_rule_patch_serialization(self):
+ def test_load_balancer_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRulePatch
+ Test serialization/deserialization for LoadBalancerReferenceDeleted
"""
- # Construct a json representation of a LoadBalancerListenerPolicyRulePatch model
- load_balancer_listener_policy_rule_patch_model_json = {}
- load_balancer_listener_policy_rule_patch_model_json['condition'] = 'contains'
- load_balancer_listener_policy_rule_patch_model_json['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_patch_model_json['type'] = 'body'
- load_balancer_listener_policy_rule_patch_model_json['value'] = 'testString'
+ # Construct a json representation of a LoadBalancerReferenceDeleted model
+ load_balancer_reference_deleted_model_json = {}
+ load_balancer_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerListenerPolicyRulePatch by calling from_dict on the json representation
- load_balancer_listener_policy_rule_patch_model = LoadBalancerListenerPolicyRulePatch.from_dict(load_balancer_listener_policy_rule_patch_model_json)
- assert load_balancer_listener_policy_rule_patch_model != False
+ # Construct a model instance of LoadBalancerReferenceDeleted by calling from_dict on the json representation
+ load_balancer_reference_deleted_model = LoadBalancerReferenceDeleted.from_dict(load_balancer_reference_deleted_model_json)
+ assert load_balancer_reference_deleted_model != False
- # Construct a model instance of LoadBalancerListenerPolicyRulePatch by calling from_dict on the json representation
- load_balancer_listener_policy_rule_patch_model_dict = LoadBalancerListenerPolicyRulePatch.from_dict(load_balancer_listener_policy_rule_patch_model_json).__dict__
- load_balancer_listener_policy_rule_patch_model2 = LoadBalancerListenerPolicyRulePatch(**load_balancer_listener_policy_rule_patch_model_dict)
+ # Construct a model instance of LoadBalancerReferenceDeleted by calling from_dict on the json representation
+ load_balancer_reference_deleted_model_dict = LoadBalancerReferenceDeleted.from_dict(load_balancer_reference_deleted_model_json).__dict__
+ load_balancer_reference_deleted_model2 = LoadBalancerReferenceDeleted(**load_balancer_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_patch_model == load_balancer_listener_policy_rule_patch_model2
+ assert load_balancer_reference_deleted_model == load_balancer_reference_deleted_model2
- # Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_rule_patch_model_json2 = load_balancer_listener_policy_rule_patch_model.to_dict()
- assert load_balancer_listener_policy_rule_patch_model_json2 == load_balancer_listener_policy_rule_patch_model_json
+ # Convert model instance back to dict and verify no loss of data
+ load_balancer_reference_deleted_model_json2 = load_balancer_reference_deleted_model.to_dict()
+ assert load_balancer_reference_deleted_model_json2 == load_balancer_reference_deleted_model_json
-class TestModel_LoadBalancerListenerPolicyRulePrototype():
+class TestModel_LoadBalancerStatistics():
"""
- Test Class for LoadBalancerListenerPolicyRulePrototype
+ Test Class for LoadBalancerStatistics
"""
- def test_load_balancer_listener_policy_rule_prototype_serialization(self):
+ def test_load_balancer_statistics_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRulePrototype
+ Test serialization/deserialization for LoadBalancerStatistics
"""
- # Construct a json representation of a LoadBalancerListenerPolicyRulePrototype model
- load_balancer_listener_policy_rule_prototype_model_json = {}
- load_balancer_listener_policy_rule_prototype_model_json['condition'] = 'contains'
- load_balancer_listener_policy_rule_prototype_model_json['field'] = 'MY-APP-HEADER'
- load_balancer_listener_policy_rule_prototype_model_json['type'] = 'body'
- load_balancer_listener_policy_rule_prototype_model_json['value'] = 'testString'
+ # Construct a json representation of a LoadBalancerStatistics model
+ load_balancer_statistics_model_json = {}
+ load_balancer_statistics_model_json['active_connections'] = 797
+ load_balancer_statistics_model_json['connection_rate'] = 91.121
+ load_balancer_statistics_model_json['data_processed_this_month'] = 10093173145
+ load_balancer_statistics_model_json['throughput'] = 167.278
- # Construct a model instance of LoadBalancerListenerPolicyRulePrototype by calling from_dict on the json representation
- load_balancer_listener_policy_rule_prototype_model = LoadBalancerListenerPolicyRulePrototype.from_dict(load_balancer_listener_policy_rule_prototype_model_json)
- assert load_balancer_listener_policy_rule_prototype_model != False
+ # Construct a model instance of LoadBalancerStatistics by calling from_dict on the json representation
+ load_balancer_statistics_model = LoadBalancerStatistics.from_dict(load_balancer_statistics_model_json)
+ assert load_balancer_statistics_model != False
- # Construct a model instance of LoadBalancerListenerPolicyRulePrototype by calling from_dict on the json representation
- load_balancer_listener_policy_rule_prototype_model_dict = LoadBalancerListenerPolicyRulePrototype.from_dict(load_balancer_listener_policy_rule_prototype_model_json).__dict__
- load_balancer_listener_policy_rule_prototype_model2 = LoadBalancerListenerPolicyRulePrototype(**load_balancer_listener_policy_rule_prototype_model_dict)
+ # Construct a model instance of LoadBalancerStatistics by calling from_dict on the json representation
+ load_balancer_statistics_model_dict = LoadBalancerStatistics.from_dict(load_balancer_statistics_model_json).__dict__
+ load_balancer_statistics_model2 = LoadBalancerStatistics(**load_balancer_statistics_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_prototype_model == load_balancer_listener_policy_rule_prototype_model2
+ assert load_balancer_statistics_model == load_balancer_statistics_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_rule_prototype_model_json2 = load_balancer_listener_policy_rule_prototype_model.to_dict()
- assert load_balancer_listener_policy_rule_prototype_model_json2 == load_balancer_listener_policy_rule_prototype_model_json
+ load_balancer_statistics_model_json2 = load_balancer_statistics_model.to_dict()
+ assert load_balancer_statistics_model_json2 == load_balancer_statistics_model_json
-class TestModel_LoadBalancerListenerPolicyRuleReference():
+class TestModel_NetworkACL():
"""
- Test Class for LoadBalancerListenerPolicyRuleReference
+ Test Class for NetworkACL
"""
- def test_load_balancer_listener_policy_rule_reference_serialization(self):
+ def test_network_acl_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPolicyRuleReference
+ Test serialization/deserialization for NetworkACL
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_listener_policy_rule_reference_deleted_model = {} # LoadBalancerListenerPolicyRuleReferenceDeleted
- load_balancer_listener_policy_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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'
- # Construct a json representation of a LoadBalancerListenerPolicyRuleReference model
- load_balancer_listener_policy_rule_reference_model_json = {}
- load_balancer_listener_policy_rule_reference_model_json['deleted'] = load_balancer_listener_policy_rule_reference_deleted_model
- load_balancer_listener_policy_rule_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004/policies/f3187486-7b27-4c79-990c-47d33c0e2278/rules/873a84b0-84d6-49c6-8948-1fa527b25762'
- load_balancer_listener_policy_rule_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
+ network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerListenerPolicyRuleReference by calling from_dict on the json representation
- load_balancer_listener_policy_rule_reference_model = LoadBalancerListenerPolicyRuleReference.from_dict(load_balancer_listener_policy_rule_reference_model_json)
- assert load_balancer_listener_policy_rule_reference_model != False
+ network_acl_rule_reference_model = {} # NetworkACLRuleReference
+ network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model
+ network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model['name'] = 'my-rule-1'
- # Construct a model instance of LoadBalancerListenerPolicyRuleReference by calling from_dict on the json representation
- load_balancer_listener_policy_rule_reference_model_dict = LoadBalancerListenerPolicyRuleReference.from_dict(load_balancer_listener_policy_rule_reference_model_json).__dict__
- load_balancer_listener_policy_rule_reference_model2 = LoadBalancerListenerPolicyRuleReference(**load_balancer_listener_policy_rule_reference_model_dict)
+ network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP
+ network_acl_rule_item_model['action'] = 'allow'
+ network_acl_rule_item_model['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_model['created_at'] = "2019-01-01T12:00:00Z"
+ network_acl_rule_item_model['destination'] = '192.168.3.0/24'
+ network_acl_rule_item_model['direction'] = 'inbound'
+ network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_model['ip_version'] = 'ipv4'
+ network_acl_rule_item_model['name'] = 'my-rule-2'
+ network_acl_rule_item_model['source'] = '192.168.3.0/24'
+ network_acl_rule_item_model['code'] = 0
+ network_acl_rule_item_model['protocol'] = 'icmp'
+ network_acl_rule_item_model['type'] = 8
- # Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_reference_model == load_balancer_listener_policy_rule_reference_model2
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_rule_reference_model_json2 = load_balancer_listener_policy_rule_reference_model.to_dict()
- assert load_balancer_listener_policy_rule_reference_model_json2 == load_balancer_listener_policy_rule_reference_model_json
+ 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'
-class TestModel_LoadBalancerListenerPolicyRuleReferenceDeleted():
- """
- Test Class for LoadBalancerListenerPolicyRuleReferenceDeleted
- """
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_load_balancer_listener_policy_rule_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerListenerPolicyRuleReferenceDeleted
- """
+ 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'
- # Construct a json representation of a LoadBalancerListenerPolicyRuleReferenceDeleted model
- load_balancer_listener_policy_rule_reference_deleted_model_json = {}
- load_balancer_listener_policy_rule_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a NetworkACL model
+ network_acl_model_json = {}
+ network_acl_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ network_acl_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_model_json['name'] = 'my-network-acl'
+ network_acl_model_json['resource_group'] = resource_group_reference_model
+ network_acl_model_json['rules'] = [network_acl_rule_item_model]
+ network_acl_model_json['subnets'] = [subnet_reference_model]
+ network_acl_model_json['vpc'] = vpc_reference_model
- # Construct a model instance of LoadBalancerListenerPolicyRuleReferenceDeleted by calling from_dict on the json representation
- load_balancer_listener_policy_rule_reference_deleted_model = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict(load_balancer_listener_policy_rule_reference_deleted_model_json)
- assert load_balancer_listener_policy_rule_reference_deleted_model != False
+ # Construct a model instance of NetworkACL by calling from_dict on the json representation
+ network_acl_model = NetworkACL.from_dict(network_acl_model_json)
+ assert network_acl_model != False
- # Construct a model instance of LoadBalancerListenerPolicyRuleReferenceDeleted by calling from_dict on the json representation
- load_balancer_listener_policy_rule_reference_deleted_model_dict = LoadBalancerListenerPolicyRuleReferenceDeleted.from_dict(load_balancer_listener_policy_rule_reference_deleted_model_json).__dict__
- load_balancer_listener_policy_rule_reference_deleted_model2 = LoadBalancerListenerPolicyRuleReferenceDeleted(**load_balancer_listener_policy_rule_reference_deleted_model_dict)
+ # Construct a model instance of NetworkACL by calling from_dict on the json representation
+ network_acl_model_dict = NetworkACL.from_dict(network_acl_model_json).__dict__
+ network_acl_model2 = NetworkACL(**network_acl_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_policy_rule_reference_deleted_model == load_balancer_listener_policy_rule_reference_deleted_model2
+ assert network_acl_model == network_acl_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_policy_rule_reference_deleted_model_json2 = load_balancer_listener_policy_rule_reference_deleted_model.to_dict()
- assert load_balancer_listener_policy_rule_reference_deleted_model_json2 == load_balancer_listener_policy_rule_reference_deleted_model_json
+ network_acl_model_json2 = network_acl_model.to_dict()
+ assert network_acl_model_json2 == network_acl_model_json
-class TestModel_LoadBalancerListenerPrototypeLoadBalancerContext():
+class TestModel_NetworkACLCollection():
"""
- Test Class for LoadBalancerListenerPrototypeLoadBalancerContext
+ Test Class for NetworkACLCollection
"""
- def test_load_balancer_listener_prototype_load_balancer_context_serialization(self):
+ def test_network_acl_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerPrototypeLoadBalancerContext
+ Test serialization/deserialization for NetworkACLCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_pool_identity_by_name_model = {} # LoadBalancerPoolIdentityByName
- load_balancer_pool_identity_by_name_model['name'] = 'my-load-balancer-pool'
+ network_acl_collection_first_model = {} # NetworkACLCollectionFirst
+ network_acl_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20'
- # Construct a json representation of a LoadBalancerListenerPrototypeLoadBalancerContext model
- load_balancer_listener_prototype_load_balancer_context_model_json = {}
- load_balancer_listener_prototype_load_balancer_context_model_json['accept_proxy_protocol'] = True
- load_balancer_listener_prototype_load_balancer_context_model_json['connection_limit'] = 2000
- load_balancer_listener_prototype_load_balancer_context_model_json['default_pool'] = load_balancer_pool_identity_by_name_model
- load_balancer_listener_prototype_load_balancer_context_model_json['port'] = 443
- load_balancer_listener_prototype_load_balancer_context_model_json['port_max'] = 499
- load_balancer_listener_prototype_load_balancer_context_model_json['port_min'] = 443
- load_balancer_listener_prototype_load_balancer_context_model_json['protocol'] = 'http'
+ 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'
- # Construct a model instance of LoadBalancerListenerPrototypeLoadBalancerContext by calling from_dict on the json representation
- load_balancer_listener_prototype_load_balancer_context_model = LoadBalancerListenerPrototypeLoadBalancerContext.from_dict(load_balancer_listener_prototype_load_balancer_context_model_json)
- assert load_balancer_listener_prototype_load_balancer_context_model != False
+ network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
+ network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerListenerPrototypeLoadBalancerContext by calling from_dict on the json representation
- load_balancer_listener_prototype_load_balancer_context_model_dict = LoadBalancerListenerPrototypeLoadBalancerContext.from_dict(load_balancer_listener_prototype_load_balancer_context_model_json).__dict__
- load_balancer_listener_prototype_load_balancer_context_model2 = LoadBalancerListenerPrototypeLoadBalancerContext(**load_balancer_listener_prototype_load_balancer_context_model_dict)
+ network_acl_rule_reference_model = {} # NetworkACLRuleReference
+ network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model
+ network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model['name'] = 'my-rule-1'
- # Verify the model instances are equivalent
- assert load_balancer_listener_prototype_load_balancer_context_model == load_balancer_listener_prototype_load_balancer_context_model2
+ network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP
+ network_acl_rule_item_model['action'] = 'allow'
+ network_acl_rule_item_model['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_model['created_at'] = "2019-01-01T12:00:00Z"
+ network_acl_rule_item_model['destination'] = '192.168.3.0/24'
+ network_acl_rule_item_model['direction'] = 'inbound'
+ network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_model['ip_version'] = 'ipv4'
+ network_acl_rule_item_model['name'] = 'my-rule-2'
+ network_acl_rule_item_model['source'] = '192.168.3.0/24'
+ network_acl_rule_item_model['code'] = 0
+ network_acl_rule_item_model['protocol'] = 'icmp'
+ network_acl_rule_item_model['type'] = 8
- # Convert model instance back to dict and verify no loss of data
- load_balancer_listener_prototype_load_balancer_context_model_json2 = load_balancer_listener_prototype_load_balancer_context_model.to_dict()
- assert load_balancer_listener_prototype_load_balancer_context_model_json2 == load_balancer_listener_prototype_load_balancer_context_model_json
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_LoadBalancerListenerReference():
- """
- Test Class for LoadBalancerListenerReference
- """
+ 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'
- def test_load_balancer_listener_reference_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerListenerReference
- """
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct dict forms of any model objects needed in order to build this model.
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/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'
- load_balancer_listener_reference_deleted_model = {} # LoadBalancerListenerReferenceDeleted
- load_balancer_listener_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ network_acl_model = {} # NetworkACL
+ network_acl_model['created_at'] = "2019-01-01T12:00:00Z"
+ network_acl_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_model['name'] = 'my-network-acl'
+ network_acl_model['resource_group'] = resource_group_reference_model
+ network_acl_model['rules'] = [network_acl_rule_item_model]
+ network_acl_model['subnets'] = [subnet_reference_model]
+ network_acl_model['vpc'] = vpc_reference_model
- # Construct a json representation of a LoadBalancerListenerReference model
- load_balancer_listener_reference_model_json = {}
- load_balancer_listener_reference_model_json['deleted'] = load_balancer_listener_reference_deleted_model
- load_balancer_listener_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/listeners/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_listener_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ network_acl_collection_next_model = {} # NetworkACLCollectionNext
+ network_acl_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of LoadBalancerListenerReference by calling from_dict on the json representation
- load_balancer_listener_reference_model = LoadBalancerListenerReference.from_dict(load_balancer_listener_reference_model_json)
- assert load_balancer_listener_reference_model != False
+ # Construct a json representation of a NetworkACLCollection model
+ network_acl_collection_model_json = {}
+ network_acl_collection_model_json['first'] = network_acl_collection_first_model
+ network_acl_collection_model_json['limit'] = 20
+ network_acl_collection_model_json['network_acls'] = [network_acl_model]
+ network_acl_collection_model_json['next'] = network_acl_collection_next_model
+ network_acl_collection_model_json['total_count'] = 132
- # Construct a model instance of LoadBalancerListenerReference by calling from_dict on the json representation
- load_balancer_listener_reference_model_dict = LoadBalancerListenerReference.from_dict(load_balancer_listener_reference_model_json).__dict__
- load_balancer_listener_reference_model2 = LoadBalancerListenerReference(**load_balancer_listener_reference_model_dict)
+ # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation
+ network_acl_collection_model = NetworkACLCollection.from_dict(network_acl_collection_model_json)
+ assert network_acl_collection_model != False
+
+ # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation
+ network_acl_collection_model_dict = NetworkACLCollection.from_dict(network_acl_collection_model_json).__dict__
+ network_acl_collection_model2 = NetworkACLCollection(**network_acl_collection_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_reference_model == load_balancer_listener_reference_model2
+ assert network_acl_collection_model == network_acl_collection_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_reference_model_json2 = load_balancer_listener_reference_model.to_dict()
- assert load_balancer_listener_reference_model_json2 == load_balancer_listener_reference_model_json
+ network_acl_collection_model_json2 = network_acl_collection_model.to_dict()
+ assert network_acl_collection_model_json2 == network_acl_collection_model_json
-class TestModel_LoadBalancerListenerReferenceDeleted():
+class TestModel_NetworkACLCollectionFirst():
"""
- Test Class for LoadBalancerListenerReferenceDeleted
+ Test Class for NetworkACLCollectionFirst
"""
- def test_load_balancer_listener_reference_deleted_serialization(self):
+ def test_network_acl_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerListenerReferenceDeleted
+ Test serialization/deserialization for NetworkACLCollectionFirst
"""
- # Construct a json representation of a LoadBalancerListenerReferenceDeleted model
- load_balancer_listener_reference_deleted_model_json = {}
- load_balancer_listener_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a NetworkACLCollectionFirst model
+ network_acl_collection_first_model_json = {}
+ network_acl_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20'
- # Construct a model instance of LoadBalancerListenerReferenceDeleted by calling from_dict on the json representation
- load_balancer_listener_reference_deleted_model = LoadBalancerListenerReferenceDeleted.from_dict(load_balancer_listener_reference_deleted_model_json)
- assert load_balancer_listener_reference_deleted_model != False
+ # Construct a model instance of NetworkACLCollectionFirst by calling from_dict on the json representation
+ network_acl_collection_first_model = NetworkACLCollectionFirst.from_dict(network_acl_collection_first_model_json)
+ assert network_acl_collection_first_model != False
- # Construct a model instance of LoadBalancerListenerReferenceDeleted by calling from_dict on the json representation
- load_balancer_listener_reference_deleted_model_dict = LoadBalancerListenerReferenceDeleted.from_dict(load_balancer_listener_reference_deleted_model_json).__dict__
- load_balancer_listener_reference_deleted_model2 = LoadBalancerListenerReferenceDeleted(**load_balancer_listener_reference_deleted_model_dict)
+ # Construct a model instance of NetworkACLCollectionFirst by calling from_dict on the json representation
+ network_acl_collection_first_model_dict = NetworkACLCollectionFirst.from_dict(network_acl_collection_first_model_json).__dict__
+ network_acl_collection_first_model2 = NetworkACLCollectionFirst(**network_acl_collection_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_listener_reference_deleted_model == load_balancer_listener_reference_deleted_model2
+ assert network_acl_collection_first_model == network_acl_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_listener_reference_deleted_model_json2 = load_balancer_listener_reference_deleted_model.to_dict()
- assert load_balancer_listener_reference_deleted_model_json2 == load_balancer_listener_reference_deleted_model_json
+ network_acl_collection_first_model_json2 = network_acl_collection_first_model.to_dict()
+ assert network_acl_collection_first_model_json2 == network_acl_collection_first_model_json
-class TestModel_LoadBalancerLogging():
+class TestModel_NetworkACLCollectionNext():
"""
- Test Class for LoadBalancerLogging
+ Test Class for NetworkACLCollectionNext
"""
- def test_load_balancer_logging_serialization(self):
+ def test_network_acl_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerLogging
+ Test serialization/deserialization for NetworkACLCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
- load_balancer_logging_datapath_model['active'] = True
-
- # Construct a json representation of a LoadBalancerLogging model
- load_balancer_logging_model_json = {}
- load_balancer_logging_model_json['datapath'] = load_balancer_logging_datapath_model
+ # Construct a json representation of a NetworkACLCollectionNext model
+ network_acl_collection_next_model_json = {}
+ network_acl_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of LoadBalancerLogging by calling from_dict on the json representation
- load_balancer_logging_model = LoadBalancerLogging.from_dict(load_balancer_logging_model_json)
- assert load_balancer_logging_model != False
+ # Construct a model instance of NetworkACLCollectionNext by calling from_dict on the json representation
+ network_acl_collection_next_model = NetworkACLCollectionNext.from_dict(network_acl_collection_next_model_json)
+ assert network_acl_collection_next_model != False
- # Construct a model instance of LoadBalancerLogging by calling from_dict on the json representation
- load_balancer_logging_model_dict = LoadBalancerLogging.from_dict(load_balancer_logging_model_json).__dict__
- load_balancer_logging_model2 = LoadBalancerLogging(**load_balancer_logging_model_dict)
+ # Construct a model instance of NetworkACLCollectionNext by calling from_dict on the json representation
+ network_acl_collection_next_model_dict = NetworkACLCollectionNext.from_dict(network_acl_collection_next_model_json).__dict__
+ network_acl_collection_next_model2 = NetworkACLCollectionNext(**network_acl_collection_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_logging_model == load_balancer_logging_model2
+ assert network_acl_collection_next_model == network_acl_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_logging_model_json2 = load_balancer_logging_model.to_dict()
- assert load_balancer_logging_model_json2 == load_balancer_logging_model_json
+ network_acl_collection_next_model_json2 = network_acl_collection_next_model.to_dict()
+ assert network_acl_collection_next_model_json2 == network_acl_collection_next_model_json
-class TestModel_LoadBalancerLoggingDatapath():
+class TestModel_NetworkACLPatch():
"""
- Test Class for LoadBalancerLoggingDatapath
+ Test Class for NetworkACLPatch
"""
- def test_load_balancer_logging_datapath_serialization(self):
+ def test_network_acl_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerLoggingDatapath
+ Test serialization/deserialization for NetworkACLPatch
"""
- # Construct a json representation of a LoadBalancerLoggingDatapath model
- load_balancer_logging_datapath_model_json = {}
- load_balancer_logging_datapath_model_json['active'] = True
+ # Construct a json representation of a NetworkACLPatch model
+ network_acl_patch_model_json = {}
+ network_acl_patch_model_json['name'] = 'my-network-acl'
- # Construct a model instance of LoadBalancerLoggingDatapath by calling from_dict on the json representation
- load_balancer_logging_datapath_model = LoadBalancerLoggingDatapath.from_dict(load_balancer_logging_datapath_model_json)
- assert load_balancer_logging_datapath_model != False
+ # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation
+ network_acl_patch_model = NetworkACLPatch.from_dict(network_acl_patch_model_json)
+ assert network_acl_patch_model != False
- # Construct a model instance of LoadBalancerLoggingDatapath by calling from_dict on the json representation
- load_balancer_logging_datapath_model_dict = LoadBalancerLoggingDatapath.from_dict(load_balancer_logging_datapath_model_json).__dict__
- load_balancer_logging_datapath_model2 = LoadBalancerLoggingDatapath(**load_balancer_logging_datapath_model_dict)
+ # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation
+ network_acl_patch_model_dict = NetworkACLPatch.from_dict(network_acl_patch_model_json).__dict__
+ network_acl_patch_model2 = NetworkACLPatch(**network_acl_patch_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_logging_datapath_model == load_balancer_logging_datapath_model2
+ assert network_acl_patch_model == network_acl_patch_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_logging_datapath_model_json2 = load_balancer_logging_datapath_model.to_dict()
- assert load_balancer_logging_datapath_model_json2 == load_balancer_logging_datapath_model_json
+ network_acl_patch_model_json2 = network_acl_patch_model.to_dict()
+ assert network_acl_patch_model_json2 == network_acl_patch_model_json
-class TestModel_LoadBalancerPatch():
+class TestModel_NetworkACLReference():
"""
- Test Class for LoadBalancerPatch
+ Test Class for NetworkACLReference
"""
- def test_load_balancer_patch_serialization(self):
+ def test_network_acl_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPatch
+ Test serialization/deserialization for NetworkACLReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_logging_datapath_model = {} # LoadBalancerLoggingDatapath
- load_balancer_logging_datapath_model['active'] = True
-
- load_balancer_logging_model = {} # LoadBalancerLogging
- load_balancer_logging_model['datapath'] = load_balancer_logging_datapath_model
+ network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
+ network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a LoadBalancerPatch model
- load_balancer_patch_model_json = {}
- load_balancer_patch_model_json['logging'] = load_balancer_logging_model
- load_balancer_patch_model_json['name'] = 'my-load-balancer'
+ # Construct a json representation of a NetworkACLReference model
+ network_acl_reference_model_json = {}
+ network_acl_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model_json['deleted'] = network_acl_reference_deleted_model
+ network_acl_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model_json['name'] = 'my-network-acl'
- # Construct a model instance of LoadBalancerPatch by calling from_dict on the json representation
- load_balancer_patch_model = LoadBalancerPatch.from_dict(load_balancer_patch_model_json)
- assert load_balancer_patch_model != False
+ # Construct a model instance of NetworkACLReference by calling from_dict on the json representation
+ network_acl_reference_model = NetworkACLReference.from_dict(network_acl_reference_model_json)
+ assert network_acl_reference_model != False
- # Construct a model instance of LoadBalancerPatch by calling from_dict on the json representation
- load_balancer_patch_model_dict = LoadBalancerPatch.from_dict(load_balancer_patch_model_json).__dict__
- load_balancer_patch_model2 = LoadBalancerPatch(**load_balancer_patch_model_dict)
+ # Construct a model instance of NetworkACLReference by calling from_dict on the json representation
+ network_acl_reference_model_dict = NetworkACLReference.from_dict(network_acl_reference_model_json).__dict__
+ network_acl_reference_model2 = NetworkACLReference(**network_acl_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_patch_model == load_balancer_patch_model2
+ assert network_acl_reference_model == network_acl_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_patch_model_json2 = load_balancer_patch_model.to_dict()
- assert load_balancer_patch_model_json2 == load_balancer_patch_model_json
+ network_acl_reference_model_json2 = network_acl_reference_model.to_dict()
+ assert network_acl_reference_model_json2 == network_acl_reference_model_json
-class TestModel_LoadBalancerPool():
+class TestModel_NetworkACLReferenceDeleted():
"""
- Test Class for LoadBalancerPool
+ Test Class for NetworkACLReferenceDeleted
"""
- def test_load_balancer_pool_serialization(self):
+ def test_network_acl_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPool
+ Test serialization/deserialization for NetworkACLReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a NetworkACLReferenceDeleted model
+ network_acl_reference_deleted_model_json = {}
+ network_acl_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_pool_health_monitor_model = {} # LoadBalancerPoolHealthMonitor
- load_balancer_pool_health_monitor_model['delay'] = 5
- load_balancer_pool_health_monitor_model['max_retries'] = 2
- load_balancer_pool_health_monitor_model['port'] = 22
- load_balancer_pool_health_monitor_model['timeout'] = 2
- load_balancer_pool_health_monitor_model['type'] = 'http'
- load_balancer_pool_health_monitor_model['url_path'] = '/'
+ # Construct a model instance of NetworkACLReferenceDeleted by calling from_dict on the json representation
+ network_acl_reference_deleted_model = NetworkACLReferenceDeleted.from_dict(network_acl_reference_deleted_model_json)
+ assert network_acl_reference_deleted_model != False
- instance_group_reference_deleted_model = {} # InstanceGroupReferenceDeleted
- instance_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of NetworkACLReferenceDeleted by calling from_dict on the json representation
+ network_acl_reference_deleted_model_dict = NetworkACLReferenceDeleted.from_dict(network_acl_reference_deleted_model_json).__dict__
+ network_acl_reference_deleted_model2 = NetworkACLReferenceDeleted(**network_acl_reference_deleted_model_dict)
- instance_group_reference_model = {} # InstanceGroupReference
- instance_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_reference_model['deleted'] = instance_group_reference_deleted_model
- instance_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_reference_model['name'] = 'my-instance-group'
+ # Verify the model instances are equivalent
+ assert network_acl_reference_deleted_model == network_acl_reference_deleted_model2
- load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
- load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ network_acl_reference_deleted_model_json2 = network_acl_reference_deleted_model.to_dict()
+ assert network_acl_reference_deleted_model_json2 == network_acl_reference_deleted_model_json
- load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference
- load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model
- load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+class TestModel_NetworkACLRuleCollection():
+ """
+ Test Class for NetworkACLRuleCollection
+ """
- load_balancer_pool_session_persistence_model = {} # LoadBalancerPoolSessionPersistence
- load_balancer_pool_session_persistence_model['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_model['type'] = 'app_cookie'
+ def test_network_acl_rule_collection_serialization(self):
+ """
+ Test serialization/deserialization for NetworkACLRuleCollection
+ """
- # Construct a json representation of a LoadBalancerPool model
- load_balancer_pool_model_json = {}
- load_balancer_pool_model_json['algorithm'] = 'least_connections'
- load_balancer_pool_model_json['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_pool_model_json['health_monitor'] = load_balancer_pool_health_monitor_model
- load_balancer_pool_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_model_json['instance_group'] = instance_group_reference_model
- load_balancer_pool_model_json['members'] = [load_balancer_pool_member_reference_model]
- load_balancer_pool_model_json['name'] = 'my-load-balancer-pool'
- load_balancer_pool_model_json['protocol'] = 'http'
- load_balancer_pool_model_json['provisioning_status'] = 'active'
- load_balancer_pool_model_json['proxy_protocol'] = 'disabled'
- load_balancer_pool_model_json['session_persistence'] = load_balancer_pool_session_persistence_model
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ network_acl_rule_collection_first_model = {} # NetworkACLRuleCollectionFirst
+ network_acl_rule_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20'
+
+ network_acl_rule_collection_next_model = {} # NetworkACLRuleCollectionNext
+ network_acl_rule_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
+ network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ network_acl_rule_reference_model = {} # NetworkACLRuleReference
+ network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model
+ network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model['name'] = 'my-rule-1'
+
+ network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP
+ network_acl_rule_item_model['action'] = 'allow'
+ network_acl_rule_item_model['before'] = network_acl_rule_reference_model
+ network_acl_rule_item_model['created_at'] = "2019-01-01T12:00:00Z"
+ network_acl_rule_item_model['destination'] = '192.168.3.0/24'
+ network_acl_rule_item_model['direction'] = 'inbound'
+ network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_item_model['ip_version'] = 'ipv4'
+ network_acl_rule_item_model['name'] = 'my-rule-2'
+ network_acl_rule_item_model['source'] = '192.168.3.0/24'
+ network_acl_rule_item_model['code'] = 0
+ network_acl_rule_item_model['protocol'] = 'icmp'
+ network_acl_rule_item_model['type'] = 8
- # Construct a model instance of LoadBalancerPool by calling from_dict on the json representation
- load_balancer_pool_model = LoadBalancerPool.from_dict(load_balancer_pool_model_json)
- assert load_balancer_pool_model != False
+ # Construct a json representation of a NetworkACLRuleCollection model
+ network_acl_rule_collection_model_json = {}
+ network_acl_rule_collection_model_json['first'] = network_acl_rule_collection_first_model
+ network_acl_rule_collection_model_json['limit'] = 20
+ network_acl_rule_collection_model_json['next'] = network_acl_rule_collection_next_model
+ network_acl_rule_collection_model_json['rules'] = [network_acl_rule_item_model]
+ network_acl_rule_collection_model_json['total_count'] = 132
- # Construct a model instance of LoadBalancerPool by calling from_dict on the json representation
- load_balancer_pool_model_dict = LoadBalancerPool.from_dict(load_balancer_pool_model_json).__dict__
- load_balancer_pool_model2 = LoadBalancerPool(**load_balancer_pool_model_dict)
+ # Construct a model instance of NetworkACLRuleCollection by calling from_dict on the json representation
+ network_acl_rule_collection_model = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json)
+ assert network_acl_rule_collection_model != False
+
+ # Construct a model instance of NetworkACLRuleCollection by calling from_dict on the json representation
+ network_acl_rule_collection_model_dict = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json).__dict__
+ network_acl_rule_collection_model2 = NetworkACLRuleCollection(**network_acl_rule_collection_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_model == load_balancer_pool_model2
+ assert network_acl_rule_collection_model == network_acl_rule_collection_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_model_json2 = load_balancer_pool_model.to_dict()
- assert load_balancer_pool_model_json2 == load_balancer_pool_model_json
+ network_acl_rule_collection_model_json2 = network_acl_rule_collection_model.to_dict()
+ assert network_acl_rule_collection_model_json2 == network_acl_rule_collection_model_json
-class TestModel_LoadBalancerPoolCollection():
+class TestModel_NetworkACLRuleCollectionFirst():
"""
- Test Class for LoadBalancerPoolCollection
+ Test Class for NetworkACLRuleCollectionFirst
"""
- def test_load_balancer_pool_collection_serialization(self):
+ def test_network_acl_rule_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolCollection
+ Test serialization/deserialization for NetworkACLRuleCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_pool_health_monitor_model = {} # LoadBalancerPoolHealthMonitor
- load_balancer_pool_health_monitor_model['delay'] = 5
- load_balancer_pool_health_monitor_model['max_retries'] = 2
- load_balancer_pool_health_monitor_model['port'] = 22
- load_balancer_pool_health_monitor_model['timeout'] = 2
- load_balancer_pool_health_monitor_model['type'] = 'http'
- load_balancer_pool_health_monitor_model['url_path'] = '/'
-
- instance_group_reference_deleted_model = {} # InstanceGroupReferenceDeleted
- instance_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- instance_group_reference_model = {} # InstanceGroupReference
- instance_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance-group:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_reference_model['deleted'] = instance_group_reference_deleted_model
- instance_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instance_groups/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_group_reference_model['name'] = 'my-instance-group'
-
- load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
- load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- load_balancer_pool_member_reference_model = {} # LoadBalancerPoolMemberReference
- load_balancer_pool_member_reference_model['deleted'] = load_balancer_pool_member_reference_deleted_model
- load_balancer_pool_member_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_member_reference_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
-
- load_balancer_pool_session_persistence_model = {} # LoadBalancerPoolSessionPersistence
- load_balancer_pool_session_persistence_model['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_model['type'] = 'app_cookie'
-
- load_balancer_pool_model = {} # LoadBalancerPool
- load_balancer_pool_model['algorithm'] = 'least_connections'
- load_balancer_pool_model['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_pool_model['health_monitor'] = load_balancer_pool_health_monitor_model
- load_balancer_pool_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_model['instance_group'] = instance_group_reference_model
- load_balancer_pool_model['members'] = [load_balancer_pool_member_reference_model]
- load_balancer_pool_model['name'] = 'my-load-balancer-pool'
- load_balancer_pool_model['protocol'] = 'http'
- load_balancer_pool_model['provisioning_status'] = 'active'
- load_balancer_pool_model['proxy_protocol'] = 'disabled'
- load_balancer_pool_model['session_persistence'] = load_balancer_pool_session_persistence_model
-
- # Construct a json representation of a LoadBalancerPoolCollection model
- load_balancer_pool_collection_model_json = {}
- load_balancer_pool_collection_model_json['pools'] = [load_balancer_pool_model]
+ # Construct a json representation of a NetworkACLRuleCollectionFirst model
+ network_acl_rule_collection_first_model_json = {}
+ network_acl_rule_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20'
- # Construct a model instance of LoadBalancerPoolCollection by calling from_dict on the json representation
- load_balancer_pool_collection_model = LoadBalancerPoolCollection.from_dict(load_balancer_pool_collection_model_json)
- assert load_balancer_pool_collection_model != False
+ # Construct a model instance of NetworkACLRuleCollectionFirst by calling from_dict on the json representation
+ network_acl_rule_collection_first_model = NetworkACLRuleCollectionFirst.from_dict(network_acl_rule_collection_first_model_json)
+ assert network_acl_rule_collection_first_model != False
- # Construct a model instance of LoadBalancerPoolCollection by calling from_dict on the json representation
- load_balancer_pool_collection_model_dict = LoadBalancerPoolCollection.from_dict(load_balancer_pool_collection_model_json).__dict__
- load_balancer_pool_collection_model2 = LoadBalancerPoolCollection(**load_balancer_pool_collection_model_dict)
+ # Construct a model instance of NetworkACLRuleCollectionFirst by calling from_dict on the json representation
+ network_acl_rule_collection_first_model_dict = NetworkACLRuleCollectionFirst.from_dict(network_acl_rule_collection_first_model_json).__dict__
+ network_acl_rule_collection_first_model2 = NetworkACLRuleCollectionFirst(**network_acl_rule_collection_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_collection_model == load_balancer_pool_collection_model2
+ assert network_acl_rule_collection_first_model == network_acl_rule_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_collection_model_json2 = load_balancer_pool_collection_model.to_dict()
- assert load_balancer_pool_collection_model_json2 == load_balancer_pool_collection_model_json
+ network_acl_rule_collection_first_model_json2 = network_acl_rule_collection_first_model.to_dict()
+ assert network_acl_rule_collection_first_model_json2 == network_acl_rule_collection_first_model_json
-class TestModel_LoadBalancerPoolHealthMonitor():
+class TestModel_NetworkACLRuleCollectionNext():
"""
- Test Class for LoadBalancerPoolHealthMonitor
+ Test Class for NetworkACLRuleCollectionNext
"""
- def test_load_balancer_pool_health_monitor_serialization(self):
+ def test_network_acl_rule_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolHealthMonitor
+ Test serialization/deserialization for NetworkACLRuleCollectionNext
"""
- # Construct a json representation of a LoadBalancerPoolHealthMonitor model
- load_balancer_pool_health_monitor_model_json = {}
- load_balancer_pool_health_monitor_model_json['delay'] = 5
- load_balancer_pool_health_monitor_model_json['max_retries'] = 2
- load_balancer_pool_health_monitor_model_json['port'] = 22
- load_balancer_pool_health_monitor_model_json['timeout'] = 2
- load_balancer_pool_health_monitor_model_json['type'] = 'http'
- load_balancer_pool_health_monitor_model_json['url_path'] = '/'
+ # Construct a json representation of a NetworkACLRuleCollectionNext model
+ network_acl_rule_collection_next_model_json = {}
+ network_acl_rule_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of LoadBalancerPoolHealthMonitor by calling from_dict on the json representation
- load_balancer_pool_health_monitor_model = LoadBalancerPoolHealthMonitor.from_dict(load_balancer_pool_health_monitor_model_json)
- assert load_balancer_pool_health_monitor_model != False
+ # Construct a model instance of NetworkACLRuleCollectionNext by calling from_dict on the json representation
+ network_acl_rule_collection_next_model = NetworkACLRuleCollectionNext.from_dict(network_acl_rule_collection_next_model_json)
+ assert network_acl_rule_collection_next_model != False
- # Construct a model instance of LoadBalancerPoolHealthMonitor by calling from_dict on the json representation
- load_balancer_pool_health_monitor_model_dict = LoadBalancerPoolHealthMonitor.from_dict(load_balancer_pool_health_monitor_model_json).__dict__
- load_balancer_pool_health_monitor_model2 = LoadBalancerPoolHealthMonitor(**load_balancer_pool_health_monitor_model_dict)
+ # Construct a model instance of NetworkACLRuleCollectionNext by calling from_dict on the json representation
+ network_acl_rule_collection_next_model_dict = NetworkACLRuleCollectionNext.from_dict(network_acl_rule_collection_next_model_json).__dict__
+ network_acl_rule_collection_next_model2 = NetworkACLRuleCollectionNext(**network_acl_rule_collection_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_health_monitor_model == load_balancer_pool_health_monitor_model2
+ assert network_acl_rule_collection_next_model == network_acl_rule_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_health_monitor_model_json2 = load_balancer_pool_health_monitor_model.to_dict()
- assert load_balancer_pool_health_monitor_model_json2 == load_balancer_pool_health_monitor_model_json
+ network_acl_rule_collection_next_model_json2 = network_acl_rule_collection_next_model.to_dict()
+ assert network_acl_rule_collection_next_model_json2 == network_acl_rule_collection_next_model_json
-class TestModel_LoadBalancerPoolHealthMonitorPatch():
+class TestModel_NetworkACLRulePatch():
"""
- Test Class for LoadBalancerPoolHealthMonitorPatch
+ Test Class for NetworkACLRulePatch
"""
- def test_load_balancer_pool_health_monitor_patch_serialization(self):
+ def test_network_acl_rule_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolHealthMonitorPatch
+ Test serialization/deserialization for NetworkACLRulePatch
"""
- # Construct a json representation of a LoadBalancerPoolHealthMonitorPatch model
- load_balancer_pool_health_monitor_patch_model_json = {}
- load_balancer_pool_health_monitor_patch_model_json['delay'] = 5
- load_balancer_pool_health_monitor_patch_model_json['max_retries'] = 2
- load_balancer_pool_health_monitor_patch_model_json['port'] = 22
- load_balancer_pool_health_monitor_patch_model_json['timeout'] = 2
- load_balancer_pool_health_monitor_patch_model_json['type'] = 'http'
- load_balancer_pool_health_monitor_patch_model_json['url_path'] = '/'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerPoolHealthMonitorPatch by calling from_dict on the json representation
- load_balancer_pool_health_monitor_patch_model = LoadBalancerPoolHealthMonitorPatch.from_dict(load_balancer_pool_health_monitor_patch_model_json)
- assert load_balancer_pool_health_monitor_patch_model != False
+ network_acl_rule_before_patch_model = {} # NetworkACLRuleBeforePatchNetworkACLRuleIdentityById
+ network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- # Construct a model instance of LoadBalancerPoolHealthMonitorPatch by calling from_dict on the json representation
- load_balancer_pool_health_monitor_patch_model_dict = LoadBalancerPoolHealthMonitorPatch.from_dict(load_balancer_pool_health_monitor_patch_model_json).__dict__
- load_balancer_pool_health_monitor_patch_model2 = LoadBalancerPoolHealthMonitorPatch(**load_balancer_pool_health_monitor_patch_model_dict)
+ # Construct a json representation of a NetworkACLRulePatch model
+ network_acl_rule_patch_model_json = {}
+ network_acl_rule_patch_model_json['action'] = 'allow'
+ network_acl_rule_patch_model_json['before'] = network_acl_rule_before_patch_model
+ network_acl_rule_patch_model_json['code'] = 0
+ network_acl_rule_patch_model_json['destination'] = '192.168.3.2/32'
+ network_acl_rule_patch_model_json['destination_port_max'] = 22
+ network_acl_rule_patch_model_json['destination_port_min'] = 22
+ network_acl_rule_patch_model_json['direction'] = 'inbound'
+ network_acl_rule_patch_model_json['name'] = 'my-rule-2'
+ network_acl_rule_patch_model_json['source'] = '192.168.3.2/32'
+ network_acl_rule_patch_model_json['source_port_max'] = 65535
+ network_acl_rule_patch_model_json['source_port_min'] = 49152
+ network_acl_rule_patch_model_json['type'] = 8
+
+ # Construct a model instance of NetworkACLRulePatch by calling from_dict on the json representation
+ network_acl_rule_patch_model = NetworkACLRulePatch.from_dict(network_acl_rule_patch_model_json)
+ assert network_acl_rule_patch_model != False
+
+ # Construct a model instance of NetworkACLRulePatch by calling from_dict on the json representation
+ network_acl_rule_patch_model_dict = NetworkACLRulePatch.from_dict(network_acl_rule_patch_model_json).__dict__
+ network_acl_rule_patch_model2 = NetworkACLRulePatch(**network_acl_rule_patch_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_health_monitor_patch_model == load_balancer_pool_health_monitor_patch_model2
+ assert network_acl_rule_patch_model == network_acl_rule_patch_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_health_monitor_patch_model_json2 = load_balancer_pool_health_monitor_patch_model.to_dict()
- assert load_balancer_pool_health_monitor_patch_model_json2 == load_balancer_pool_health_monitor_patch_model_json
+ network_acl_rule_patch_model_json2 = network_acl_rule_patch_model.to_dict()
+ assert network_acl_rule_patch_model_json2 == network_acl_rule_patch_model_json
-class TestModel_LoadBalancerPoolHealthMonitorPrototype():
+class TestModel_NetworkACLRuleReference():
"""
- Test Class for LoadBalancerPoolHealthMonitorPrototype
+ Test Class for NetworkACLRuleReference
"""
- def test_load_balancer_pool_health_monitor_prototype_serialization(self):
+ def test_network_acl_rule_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolHealthMonitorPrototype
+ Test serialization/deserialization for NetworkACLRuleReference
"""
- # Construct a json representation of a LoadBalancerPoolHealthMonitorPrototype model
- load_balancer_pool_health_monitor_prototype_model_json = {}
- load_balancer_pool_health_monitor_prototype_model_json['delay'] = 5
- load_balancer_pool_health_monitor_prototype_model_json['max_retries'] = 2
- load_balancer_pool_health_monitor_prototype_model_json['port'] = 22
- load_balancer_pool_health_monitor_prototype_model_json['timeout'] = 2
- load_balancer_pool_health_monitor_prototype_model_json['type'] = 'http'
- load_balancer_pool_health_monitor_prototype_model_json['url_path'] = '/'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerPoolHealthMonitorPrototype by calling from_dict on the json representation
- load_balancer_pool_health_monitor_prototype_model = LoadBalancerPoolHealthMonitorPrototype.from_dict(load_balancer_pool_health_monitor_prototype_model_json)
- assert load_balancer_pool_health_monitor_prototype_model != False
+ network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
+ network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerPoolHealthMonitorPrototype by calling from_dict on the json representation
- load_balancer_pool_health_monitor_prototype_model_dict = LoadBalancerPoolHealthMonitorPrototype.from_dict(load_balancer_pool_health_monitor_prototype_model_json).__dict__
- load_balancer_pool_health_monitor_prototype_model2 = LoadBalancerPoolHealthMonitorPrototype(**load_balancer_pool_health_monitor_prototype_model_dict)
+ # Construct a json representation of a NetworkACLRuleReference model
+ network_acl_rule_reference_model_json = {}
+ network_acl_rule_reference_model_json['deleted'] = network_acl_rule_reference_deleted_model
+ network_acl_rule_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
+ network_acl_rule_reference_model_json['name'] = 'my-rule-1'
+
+ # Construct a model instance of NetworkACLRuleReference by calling from_dict on the json representation
+ network_acl_rule_reference_model = NetworkACLRuleReference.from_dict(network_acl_rule_reference_model_json)
+ assert network_acl_rule_reference_model != False
+
+ # Construct a model instance of NetworkACLRuleReference by calling from_dict on the json representation
+ network_acl_rule_reference_model_dict = NetworkACLRuleReference.from_dict(network_acl_rule_reference_model_json).__dict__
+ network_acl_rule_reference_model2 = NetworkACLRuleReference(**network_acl_rule_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_health_monitor_prototype_model == load_balancer_pool_health_monitor_prototype_model2
+ assert network_acl_rule_reference_model == network_acl_rule_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_health_monitor_prototype_model_json2 = load_balancer_pool_health_monitor_prototype_model.to_dict()
- assert load_balancer_pool_health_monitor_prototype_model_json2 == load_balancer_pool_health_monitor_prototype_model_json
+ network_acl_rule_reference_model_json2 = network_acl_rule_reference_model.to_dict()
+ assert network_acl_rule_reference_model_json2 == network_acl_rule_reference_model_json
-class TestModel_LoadBalancerPoolIdentityByName():
+class TestModel_NetworkACLRuleReferenceDeleted():
"""
- Test Class for LoadBalancerPoolIdentityByName
+ Test Class for NetworkACLRuleReferenceDeleted
"""
- def test_load_balancer_pool_identity_by_name_serialization(self):
+ def test_network_acl_rule_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolIdentityByName
+ Test serialization/deserialization for NetworkACLRuleReferenceDeleted
"""
- # Construct a json representation of a LoadBalancerPoolIdentityByName model
- load_balancer_pool_identity_by_name_model_json = {}
- load_balancer_pool_identity_by_name_model_json['name'] = 'my-load-balancer-pool'
+ # Construct a json representation of a NetworkACLRuleReferenceDeleted model
+ network_acl_rule_reference_deleted_model_json = {}
+ network_acl_rule_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerPoolIdentityByName by calling from_dict on the json representation
- load_balancer_pool_identity_by_name_model = LoadBalancerPoolIdentityByName.from_dict(load_balancer_pool_identity_by_name_model_json)
- assert load_balancer_pool_identity_by_name_model != False
+ # Construct a model instance of NetworkACLRuleReferenceDeleted by calling from_dict on the json representation
+ network_acl_rule_reference_deleted_model = NetworkACLRuleReferenceDeleted.from_dict(network_acl_rule_reference_deleted_model_json)
+ assert network_acl_rule_reference_deleted_model != False
- # Construct a model instance of LoadBalancerPoolIdentityByName by calling from_dict on the json representation
- load_balancer_pool_identity_by_name_model_dict = LoadBalancerPoolIdentityByName.from_dict(load_balancer_pool_identity_by_name_model_json).__dict__
- load_balancer_pool_identity_by_name_model2 = LoadBalancerPoolIdentityByName(**load_balancer_pool_identity_by_name_model_dict)
+ # Construct a model instance of NetworkACLRuleReferenceDeleted by calling from_dict on the json representation
+ network_acl_rule_reference_deleted_model_dict = NetworkACLRuleReferenceDeleted.from_dict(network_acl_rule_reference_deleted_model_json).__dict__
+ network_acl_rule_reference_deleted_model2 = NetworkACLRuleReferenceDeleted(**network_acl_rule_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_identity_by_name_model == load_balancer_pool_identity_by_name_model2
+ assert network_acl_rule_reference_deleted_model == network_acl_rule_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_identity_by_name_model_json2 = load_balancer_pool_identity_by_name_model.to_dict()
- assert load_balancer_pool_identity_by_name_model_json2 == load_balancer_pool_identity_by_name_model_json
+ network_acl_rule_reference_deleted_model_json2 = network_acl_rule_reference_deleted_model.to_dict()
+ assert network_acl_rule_reference_deleted_model_json2 == network_acl_rule_reference_deleted_model_json
-class TestModel_LoadBalancerPoolMember():
+class TestModel_NetworkInterface():
"""
- Test Class for LoadBalancerPoolMember
+ Test Class for NetworkInterface
"""
- def test_load_balancer_pool_member_serialization(self):
+ def test_network_interface_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMember
+ Test serialization/deserialization for NetworkInterface
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_pool_member_target_model = {} # LoadBalancerPoolMemberTargetInstanceReference
- load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_member_target_model['deleted'] = instance_reference_deleted_model
- load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_member_target_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_member_target_model['name'] = 'my-instance'
+ floating_ip_reference_model = {} # FloatingIPReference
+ floating_ip_reference_model['address'] = '192.0.2.2'
+ floating_ip_reference_model['crn'] = 'crn:[...]'
+ floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
+ floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/181b8670-52bf-47af-a5ca-7aff7f3824d1'
+ floating_ip_reference_model['id'] = '181b8670-52bf-47af-a5ca-7aff7f3824d1'
+ floating_ip_reference_model['name'] = 'my-floating-ip'
- # Construct a json representation of a LoadBalancerPoolMember model
- load_balancer_pool_member_model_json = {}
- load_balancer_pool_member_model_json['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_pool_member_model_json['health'] = 'faulted'
- load_balancer_pool_member_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_member_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_member_model_json['port'] = 80
- load_balancer_pool_member_model_json['provisioning_status'] = 'active'
- load_balancer_pool_member_model_json['target'] = load_balancer_pool_member_target_model
- load_balancer_pool_member_model_json['weight'] = 50
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerPoolMember by calling from_dict on the json representation
- load_balancer_pool_member_model = LoadBalancerPoolMember.from_dict(load_balancer_pool_member_model_json)
- assert load_balancer_pool_member_model != False
+ 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'] = 'before-entrance-mountain-paralegal-photo-uninstall'
- # Construct a model instance of LoadBalancerPoolMember by calling from_dict on the json representation
- load_balancer_pool_member_model_dict = LoadBalancerPoolMember.from_dict(load_balancer_pool_member_model_json).__dict__
- load_balancer_pool_member_model2 = LoadBalancerPoolMember(**load_balancer_pool_member_model_dict)
+ 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'
+
+ # Construct a json representation of a NetworkInterface model
+ network_interface_model_json = {}
+ network_interface_model_json['allow_ip_spoofing'] = True
+ network_interface_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ network_interface_model_json['floating_ips'] = [floating_ip_reference_model]
+ network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/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['port_speed'] = 1000
+ network_interface_model_json['primary_ipv4_address'] = '192.168.3.4'
+ network_interface_model_json['resource_type'] = 'network_interface'
+ network_interface_model_json['security_groups'] = [security_group_reference_model]
+ network_interface_model_json['status'] = 'available'
+ network_interface_model_json['subnet'] = subnet_reference_model
+ network_interface_model_json['type'] = 'primary'
+
+ # Construct a model instance of NetworkInterface by calling from_dict on the json representation
+ network_interface_model = NetworkInterface.from_dict(network_interface_model_json)
+ assert network_interface_model != False
+
+ # Construct a model instance of NetworkInterface by calling from_dict on the json representation
+ network_interface_model_dict = NetworkInterface.from_dict(network_interface_model_json).__dict__
+ network_interface_model2 = NetworkInterface(**network_interface_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_model == load_balancer_pool_member_model2
+ assert network_interface_model == network_interface_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_member_model_json2 = load_balancer_pool_member_model.to_dict()
- assert load_balancer_pool_member_model_json2 == load_balancer_pool_member_model_json
+ network_interface_model_json2 = network_interface_model.to_dict()
+ assert network_interface_model_json2 == network_interface_model_json
-class TestModel_LoadBalancerPoolMemberCollection():
+class TestModel_NetworkInterfaceBareMetalServerContextReference():
"""
- Test Class for LoadBalancerPoolMemberCollection
+ Test Class for NetworkInterfaceBareMetalServerContextReference
"""
- def test_load_balancer_pool_member_collection_serialization(self):
+ def test_network_interface_bare_metal_server_context_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberCollection
+ Test serialization/deserialization for NetworkInterfaceBareMetalServerContextReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ network_interface_bare_metal_server_context_reference_deleted_model = {} # NetworkInterfaceBareMetalServerContextReferenceDeleted
+ network_interface_bare_metal_server_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_pool_member_target_model = {} # LoadBalancerPoolMemberTargetInstanceReference
- load_balancer_pool_member_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_member_target_model['deleted'] = instance_reference_deleted_model
- load_balancer_pool_member_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_member_target_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- load_balancer_pool_member_target_model['name'] = 'my-instance'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_pool_member_model = {} # LoadBalancerPoolMember
- load_balancer_pool_member_model['created_at'] = "2019-01-01T12:00:00Z"
- load_balancer_pool_member_model['health'] = 'faulted'
- load_balancer_pool_member_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_member_model['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_member_model['port'] = 80
- load_balancer_pool_member_model['provisioning_status'] = 'active'
- load_balancer_pool_member_model['target'] = load_balancer_pool_member_target_model
- load_balancer_pool_member_model['weight'] = 50
+ 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'
- # Construct a json representation of a LoadBalancerPoolMemberCollection model
- load_balancer_pool_member_collection_model_json = {}
- load_balancer_pool_member_collection_model_json['members'] = [load_balancer_pool_member_model]
+ # Construct a json representation of a NetworkInterfaceBareMetalServerContextReference model
+ network_interface_bare_metal_server_context_reference_model_json = {}
+ network_interface_bare_metal_server_context_reference_model_json['deleted'] = 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['primary_ipv4_address'] = '192.168.3.4'
+ 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
- # Construct a model instance of LoadBalancerPoolMemberCollection by calling from_dict on the json representation
- load_balancer_pool_member_collection_model = LoadBalancerPoolMemberCollection.from_dict(load_balancer_pool_member_collection_model_json)
- assert load_balancer_pool_member_collection_model != False
+ # Construct a model instance of NetworkInterfaceBareMetalServerContextReference by calling from_dict on the json representation
+ network_interface_bare_metal_server_context_reference_model = NetworkInterfaceBareMetalServerContextReference.from_dict(network_interface_bare_metal_server_context_reference_model_json)
+ assert network_interface_bare_metal_server_context_reference_model != False
- # Construct a model instance of LoadBalancerPoolMemberCollection by calling from_dict on the json representation
- load_balancer_pool_member_collection_model_dict = LoadBalancerPoolMemberCollection.from_dict(load_balancer_pool_member_collection_model_json).__dict__
- load_balancer_pool_member_collection_model2 = LoadBalancerPoolMemberCollection(**load_balancer_pool_member_collection_model_dict)
+ # Construct a model instance of NetworkInterfaceBareMetalServerContextReference by calling from_dict on the json representation
+ network_interface_bare_metal_server_context_reference_model_dict = NetworkInterfaceBareMetalServerContextReference.from_dict(network_interface_bare_metal_server_context_reference_model_json).__dict__
+ network_interface_bare_metal_server_context_reference_model2 = NetworkInterfaceBareMetalServerContextReference(**network_interface_bare_metal_server_context_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_collection_model == load_balancer_pool_member_collection_model2
+ assert network_interface_bare_metal_server_context_reference_model == network_interface_bare_metal_server_context_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_member_collection_model_json2 = load_balancer_pool_member_collection_model.to_dict()
- assert load_balancer_pool_member_collection_model_json2 == load_balancer_pool_member_collection_model_json
+ network_interface_bare_metal_server_context_reference_model_json2 = network_interface_bare_metal_server_context_reference_model.to_dict()
+ assert network_interface_bare_metal_server_context_reference_model_json2 == network_interface_bare_metal_server_context_reference_model_json
-class TestModel_LoadBalancerPoolMemberPatch():
+class TestModel_NetworkInterfaceBareMetalServerContextReferenceDeleted():
"""
- Test Class for LoadBalancerPoolMemberPatch
+ Test Class for NetworkInterfaceBareMetalServerContextReferenceDeleted
"""
- def test_load_balancer_pool_member_patch_serialization(self):
+ def test_network_interface_bare_metal_server_context_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberPatch
+ Test serialization/deserialization for NetworkInterfaceBareMetalServerContextReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- # Construct a json representation of a LoadBalancerPoolMemberPatch model
- load_balancer_pool_member_patch_model_json = {}
- load_balancer_pool_member_patch_model_json['port'] = 80
- load_balancer_pool_member_patch_model_json['target'] = load_balancer_pool_member_target_prototype_model
- load_balancer_pool_member_patch_model_json['weight'] = 50
+ # Construct a json representation of a NetworkInterfaceBareMetalServerContextReferenceDeleted model
+ network_interface_bare_metal_server_context_reference_deleted_model_json = {}
+ network_interface_bare_metal_server_context_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerPoolMemberPatch by calling from_dict on the json representation
- load_balancer_pool_member_patch_model = LoadBalancerPoolMemberPatch.from_dict(load_balancer_pool_member_patch_model_json)
- assert load_balancer_pool_member_patch_model != False
+ # Construct a model instance of NetworkInterfaceBareMetalServerContextReferenceDeleted by calling from_dict on the json representation
+ network_interface_bare_metal_server_context_reference_deleted_model = NetworkInterfaceBareMetalServerContextReferenceDeleted.from_dict(network_interface_bare_metal_server_context_reference_deleted_model_json)
+ assert network_interface_bare_metal_server_context_reference_deleted_model != False
- # Construct a model instance of LoadBalancerPoolMemberPatch by calling from_dict on the json representation
- load_balancer_pool_member_patch_model_dict = LoadBalancerPoolMemberPatch.from_dict(load_balancer_pool_member_patch_model_json).__dict__
- load_balancer_pool_member_patch_model2 = LoadBalancerPoolMemberPatch(**load_balancer_pool_member_patch_model_dict)
+ # Construct a model instance of NetworkInterfaceBareMetalServerContextReferenceDeleted by calling from_dict on the json representation
+ network_interface_bare_metal_server_context_reference_deleted_model_dict = NetworkInterfaceBareMetalServerContextReferenceDeleted.from_dict(network_interface_bare_metal_server_context_reference_deleted_model_json).__dict__
+ network_interface_bare_metal_server_context_reference_deleted_model2 = NetworkInterfaceBareMetalServerContextReferenceDeleted(**network_interface_bare_metal_server_context_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_patch_model == load_balancer_pool_member_patch_model2
+ assert network_interface_bare_metal_server_context_reference_deleted_model == network_interface_bare_metal_server_context_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_member_patch_model_json2 = load_balancer_pool_member_patch_model.to_dict()
- assert load_balancer_pool_member_patch_model_json2 == load_balancer_pool_member_patch_model_json
+ network_interface_bare_metal_server_context_reference_deleted_model_json2 = network_interface_bare_metal_server_context_reference_deleted_model.to_dict()
+ assert network_interface_bare_metal_server_context_reference_deleted_model_json2 == network_interface_bare_metal_server_context_reference_deleted_model_json
-class TestModel_LoadBalancerPoolMemberPrototype():
+class TestModel_NetworkInterfaceCollection():
"""
- Test Class for LoadBalancerPoolMemberPrototype
+ Test Class for NetworkInterfaceCollection
"""
- def test_load_balancer_pool_member_prototype_serialization(self):
+ def test_network_interface_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberPrototype
+ Test serialization/deserialization for NetworkInterfaceCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
-
- # Construct a json representation of a LoadBalancerPoolMemberPrototype model
- load_balancer_pool_member_prototype_model_json = {}
- load_balancer_pool_member_prototype_model_json['port'] = 80
- load_balancer_pool_member_prototype_model_json['target'] = load_balancer_pool_member_target_prototype_model
- load_balancer_pool_member_prototype_model_json['weight'] = 50
+ network_interface_collection_first_model = {} # NetworkInterfaceCollectionFirst
+ network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20'
- # Construct a model instance of LoadBalancerPoolMemberPrototype by calling from_dict on the json representation
- load_balancer_pool_member_prototype_model = LoadBalancerPoolMemberPrototype.from_dict(load_balancer_pool_member_prototype_model_json)
- assert load_balancer_pool_member_prototype_model != False
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerPoolMemberPrototype by calling from_dict on the json representation
- load_balancer_pool_member_prototype_model_dict = LoadBalancerPoolMemberPrototype.from_dict(load_balancer_pool_member_prototype_model_json).__dict__
- load_balancer_pool_member_prototype_model2 = LoadBalancerPoolMemberPrototype(**load_balancer_pool_member_prototype_model_dict)
+ floating_ip_reference_model = {} # FloatingIPReference
+ floating_ip_reference_model['address'] = '203.0.113.1'
+ floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
+ floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['name'] = 'my-floating-ip'
- # Verify the model instances are equivalent
- assert load_balancer_pool_member_prototype_model == load_balancer_pool_member_prototype_model2
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- load_balancer_pool_member_prototype_model_json2 = load_balancer_pool_member_prototype_model.to_dict()
- assert load_balancer_pool_member_prototype_model_json2 == load_balancer_pool_member_prototype_model_json
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
-class TestModel_LoadBalancerPoolMemberReference():
- """
- Test Class for LoadBalancerPoolMemberReference
- """
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_load_balancer_pool_member_reference_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerPoolMemberReference
- """
+ 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'
- # Construct dict forms of any model objects needed in order to build this model.
+ network_interface_model = {} # NetworkInterface
+ network_interface_model['allow_ip_spoofing'] = True
+ network_interface_model['created_at'] = "2019-01-01T12:00:00Z"
+ network_interface_model['floating_ips'] = [floating_ip_reference_model]
+ network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ network_interface_model['name'] = 'my-network-interface'
+ network_interface_model['port_speed'] = 1000
+ network_interface_model['primary_ipv4_address'] = '192.168.3.4'
+ network_interface_model['resource_type'] = 'network_interface'
+ network_interface_model['security_groups'] = [security_group_reference_model]
+ network_interface_model['status'] = 'available'
+ network_interface_model['subnet'] = subnet_reference_model
+ network_interface_model['type'] = 'primary'
- load_balancer_pool_member_reference_deleted_model = {} # LoadBalancerPoolMemberReferenceDeleted
- load_balancer_pool_member_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ network_interface_collection_next_model = {} # NetworkInterfaceCollectionNext
+ network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
- # Construct a json representation of a LoadBalancerPoolMemberReference model
- load_balancer_pool_member_reference_model_json = {}
- load_balancer_pool_member_reference_model_json['deleted'] = load_balancer_pool_member_reference_deleted_model
- load_balancer_pool_member_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004/members/80294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_member_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
+ # Construct a json representation of a NetworkInterfaceCollection model
+ network_interface_collection_model_json = {}
+ network_interface_collection_model_json['first'] = network_interface_collection_first_model
+ network_interface_collection_model_json['limit'] = 20
+ network_interface_collection_model_json['network_interfaces'] = [network_interface_model]
+ network_interface_collection_model_json['next'] = network_interface_collection_next_model
+ network_interface_collection_model_json['total_count'] = 132
- # Construct a model instance of LoadBalancerPoolMemberReference by calling from_dict on the json representation
- load_balancer_pool_member_reference_model = LoadBalancerPoolMemberReference.from_dict(load_balancer_pool_member_reference_model_json)
- assert load_balancer_pool_member_reference_model != False
+ # Construct a model instance of NetworkInterfaceCollection by calling from_dict on the json representation
+ network_interface_collection_model = NetworkInterfaceCollection.from_dict(network_interface_collection_model_json)
+ assert network_interface_collection_model != False
- # Construct a model instance of LoadBalancerPoolMemberReference by calling from_dict on the json representation
- load_balancer_pool_member_reference_model_dict = LoadBalancerPoolMemberReference.from_dict(load_balancer_pool_member_reference_model_json).__dict__
- load_balancer_pool_member_reference_model2 = LoadBalancerPoolMemberReference(**load_balancer_pool_member_reference_model_dict)
+ # Construct a model instance of NetworkInterfaceCollection by calling from_dict on the json representation
+ network_interface_collection_model_dict = NetworkInterfaceCollection.from_dict(network_interface_collection_model_json).__dict__
+ network_interface_collection_model2 = NetworkInterfaceCollection(**network_interface_collection_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_reference_model == load_balancer_pool_member_reference_model2
+ assert network_interface_collection_model == network_interface_collection_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_member_reference_model_json2 = load_balancer_pool_member_reference_model.to_dict()
- assert load_balancer_pool_member_reference_model_json2 == load_balancer_pool_member_reference_model_json
+ network_interface_collection_model_json2 = network_interface_collection_model.to_dict()
+ assert network_interface_collection_model_json2 == network_interface_collection_model_json
-class TestModel_LoadBalancerPoolMemberReferenceDeleted():
+class TestModel_NetworkInterfaceCollectionFirst():
"""
- Test Class for LoadBalancerPoolMemberReferenceDeleted
+ Test Class for NetworkInterfaceCollectionFirst
"""
- def test_load_balancer_pool_member_reference_deleted_serialization(self):
+ def test_network_interface_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolMemberReferenceDeleted
+ Test serialization/deserialization for NetworkInterfaceCollectionFirst
"""
- # Construct a json representation of a LoadBalancerPoolMemberReferenceDeleted model
- load_balancer_pool_member_reference_deleted_model_json = {}
- load_balancer_pool_member_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a NetworkInterfaceCollectionFirst model
+ network_interface_collection_first_model_json = {}
+ network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20'
- # Construct a model instance of LoadBalancerPoolMemberReferenceDeleted by calling from_dict on the json representation
- load_balancer_pool_member_reference_deleted_model = LoadBalancerPoolMemberReferenceDeleted.from_dict(load_balancer_pool_member_reference_deleted_model_json)
- assert load_balancer_pool_member_reference_deleted_model != False
+ # Construct a model instance of NetworkInterfaceCollectionFirst by calling from_dict on the json representation
+ network_interface_collection_first_model = NetworkInterfaceCollectionFirst.from_dict(network_interface_collection_first_model_json)
+ assert network_interface_collection_first_model != False
- # Construct a model instance of LoadBalancerPoolMemberReferenceDeleted by calling from_dict on the json representation
- load_balancer_pool_member_reference_deleted_model_dict = LoadBalancerPoolMemberReferenceDeleted.from_dict(load_balancer_pool_member_reference_deleted_model_json).__dict__
- load_balancer_pool_member_reference_deleted_model2 = LoadBalancerPoolMemberReferenceDeleted(**load_balancer_pool_member_reference_deleted_model_dict)
+ # Construct a model instance of NetworkInterfaceCollectionFirst by calling from_dict on the json representation
+ network_interface_collection_first_model_dict = NetworkInterfaceCollectionFirst.from_dict(network_interface_collection_first_model_json).__dict__
+ network_interface_collection_first_model2 = NetworkInterfaceCollectionFirst(**network_interface_collection_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_member_reference_deleted_model == load_balancer_pool_member_reference_deleted_model2
+ assert network_interface_collection_first_model == network_interface_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_member_reference_deleted_model_json2 = load_balancer_pool_member_reference_deleted_model.to_dict()
- assert load_balancer_pool_member_reference_deleted_model_json2 == load_balancer_pool_member_reference_deleted_model_json
+ network_interface_collection_first_model_json2 = network_interface_collection_first_model.to_dict()
+ assert network_interface_collection_first_model_json2 == network_interface_collection_first_model_json
-class TestModel_LoadBalancerPoolPatch():
+class TestModel_NetworkInterfaceCollectionNext():
"""
- Test Class for LoadBalancerPoolPatch
+ Test Class for NetworkInterfaceCollectionNext
"""
- def test_load_balancer_pool_patch_serialization(self):
+ def test_network_interface_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolPatch
+ Test serialization/deserialization for NetworkInterfaceCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_pool_health_monitor_patch_model = {} # LoadBalancerPoolHealthMonitorPatch
- load_balancer_pool_health_monitor_patch_model['delay'] = 5
- load_balancer_pool_health_monitor_patch_model['max_retries'] = 2
- load_balancer_pool_health_monitor_patch_model['port'] = 22
- load_balancer_pool_health_monitor_patch_model['timeout'] = 2
- load_balancer_pool_health_monitor_patch_model['type'] = 'http'
- load_balancer_pool_health_monitor_patch_model['url_path'] = '/'
-
- load_balancer_pool_session_persistence_patch_model = {} # LoadBalancerPoolSessionPersistencePatch
- load_balancer_pool_session_persistence_patch_model['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_patch_model['type'] = 'app_cookie'
-
- # Construct a json representation of a LoadBalancerPoolPatch model
- load_balancer_pool_patch_model_json = {}
- load_balancer_pool_patch_model_json['algorithm'] = 'least_connections'
- load_balancer_pool_patch_model_json['health_monitor'] = load_balancer_pool_health_monitor_patch_model
- load_balancer_pool_patch_model_json['name'] = 'my-load-balancer-pool'
- load_balancer_pool_patch_model_json['protocol'] = 'http'
- load_balancer_pool_patch_model_json['proxy_protocol'] = 'disabled'
- load_balancer_pool_patch_model_json['session_persistence'] = load_balancer_pool_session_persistence_patch_model
+ # Construct a json representation of a NetworkInterfaceCollectionNext model
+ network_interface_collection_next_model_json = {}
+ network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
- # Construct a model instance of LoadBalancerPoolPatch by calling from_dict on the json representation
- load_balancer_pool_patch_model = LoadBalancerPoolPatch.from_dict(load_balancer_pool_patch_model_json)
- assert load_balancer_pool_patch_model != False
+ # Construct a model instance of NetworkInterfaceCollectionNext by calling from_dict on the json representation
+ network_interface_collection_next_model = NetworkInterfaceCollectionNext.from_dict(network_interface_collection_next_model_json)
+ assert network_interface_collection_next_model != False
- # Construct a model instance of LoadBalancerPoolPatch by calling from_dict on the json representation
- load_balancer_pool_patch_model_dict = LoadBalancerPoolPatch.from_dict(load_balancer_pool_patch_model_json).__dict__
- load_balancer_pool_patch_model2 = LoadBalancerPoolPatch(**load_balancer_pool_patch_model_dict)
+ # Construct a model instance of NetworkInterfaceCollectionNext by calling from_dict on the json representation
+ network_interface_collection_next_model_dict = NetworkInterfaceCollectionNext.from_dict(network_interface_collection_next_model_json).__dict__
+ network_interface_collection_next_model2 = NetworkInterfaceCollectionNext(**network_interface_collection_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_patch_model == load_balancer_pool_patch_model2
+ assert network_interface_collection_next_model == network_interface_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_patch_model_json2 = load_balancer_pool_patch_model.to_dict()
- assert load_balancer_pool_patch_model_json2 == load_balancer_pool_patch_model_json
+ network_interface_collection_next_model_json2 = network_interface_collection_next_model.to_dict()
+ assert network_interface_collection_next_model_json2 == network_interface_collection_next_model_json
-class TestModel_LoadBalancerPoolPrototype():
+class TestModel_NetworkInterfaceInstanceContextReference():
"""
- Test Class for LoadBalancerPoolPrototype
+ Test Class for NetworkInterfaceInstanceContextReference
"""
- def test_load_balancer_pool_prototype_serialization(self):
+ def test_network_interface_instance_context_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolPrototype
+ Test serialization/deserialization for NetworkInterfaceInstanceContextReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_pool_health_monitor_prototype_model = {} # LoadBalancerPoolHealthMonitorPrototype
- load_balancer_pool_health_monitor_prototype_model['delay'] = 5
- load_balancer_pool_health_monitor_prototype_model['max_retries'] = 2
- load_balancer_pool_health_monitor_prototype_model['port'] = 22
- load_balancer_pool_health_monitor_prototype_model['timeout'] = 2
- load_balancer_pool_health_monitor_prototype_model['type'] = 'http'
- load_balancer_pool_health_monitor_prototype_model['url_path'] = '/'
-
- load_balancer_pool_member_target_prototype_model = {} # LoadBalancerPoolMemberTargetPrototypeInstanceIdentityInstanceIdentityById
- load_balancer_pool_member_target_prototype_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted
+ network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_pool_member_prototype_model = {} # LoadBalancerPoolMemberPrototype
- load_balancer_pool_member_prototype_model['port'] = 80
- load_balancer_pool_member_prototype_model['target'] = load_balancer_pool_member_target_prototype_model
- load_balancer_pool_member_prototype_model['weight'] = 50
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_pool_session_persistence_prototype_model = {} # LoadBalancerPoolSessionPersistencePrototype
- load_balancer_pool_session_persistence_prototype_model['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_prototype_model['type'] = 'app_cookie'
+ 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'
- # Construct a json representation of a LoadBalancerPoolPrototype model
- load_balancer_pool_prototype_model_json = {}
- load_balancer_pool_prototype_model_json['algorithm'] = 'least_connections'
- load_balancer_pool_prototype_model_json['health_monitor'] = load_balancer_pool_health_monitor_prototype_model
- load_balancer_pool_prototype_model_json['members'] = [load_balancer_pool_member_prototype_model]
- load_balancer_pool_prototype_model_json['name'] = 'my-load-balancer-pool'
- load_balancer_pool_prototype_model_json['protocol'] = 'http'
- load_balancer_pool_prototype_model_json['proxy_protocol'] = 'disabled'
- load_balancer_pool_prototype_model_json['session_persistence'] = load_balancer_pool_session_persistence_prototype_model
+ # Construct a json representation of a NetworkInterfaceInstanceContextReference model
+ network_interface_instance_context_reference_model_json = {}
+ 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['primary_ipv4_address'] = '192.168.3.4'
+ network_interface_instance_context_reference_model_json['resource_type'] = 'network_interface'
+ network_interface_instance_context_reference_model_json['subnet'] = subnet_reference_model
- # Construct a model instance of LoadBalancerPoolPrototype by calling from_dict on the json representation
- load_balancer_pool_prototype_model = LoadBalancerPoolPrototype.from_dict(load_balancer_pool_prototype_model_json)
- assert load_balancer_pool_prototype_model != False
+ # Construct a model instance of NetworkInterfaceInstanceContextReference by calling from_dict on the json representation
+ network_interface_instance_context_reference_model = NetworkInterfaceInstanceContextReference.from_dict(network_interface_instance_context_reference_model_json)
+ assert network_interface_instance_context_reference_model != False
- # Construct a model instance of LoadBalancerPoolPrototype by calling from_dict on the json representation
- load_balancer_pool_prototype_model_dict = LoadBalancerPoolPrototype.from_dict(load_balancer_pool_prototype_model_json).__dict__
- load_balancer_pool_prototype_model2 = LoadBalancerPoolPrototype(**load_balancer_pool_prototype_model_dict)
+ # Construct a model instance of NetworkInterfaceInstanceContextReference by calling from_dict on the json representation
+ network_interface_instance_context_reference_model_dict = NetworkInterfaceInstanceContextReference.from_dict(network_interface_instance_context_reference_model_json).__dict__
+ network_interface_instance_context_reference_model2 = NetworkInterfaceInstanceContextReference(**network_interface_instance_context_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_prototype_model == load_balancer_pool_prototype_model2
+ assert network_interface_instance_context_reference_model == network_interface_instance_context_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_prototype_model_json2 = load_balancer_pool_prototype_model.to_dict()
- assert load_balancer_pool_prototype_model_json2 == load_balancer_pool_prototype_model_json
+ network_interface_instance_context_reference_model_json2 = network_interface_instance_context_reference_model.to_dict()
+ assert network_interface_instance_context_reference_model_json2 == network_interface_instance_context_reference_model_json
-class TestModel_LoadBalancerPoolReference():
+class TestModel_NetworkInterfaceInstanceContextReferenceDeleted():
"""
- Test Class for LoadBalancerPoolReference
+ Test Class for NetworkInterfaceInstanceContextReferenceDeleted
"""
- def test_load_balancer_pool_reference_serialization(self):
+ def test_network_interface_instance_context_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolReference
+ Test serialization/deserialization for NetworkInterfaceInstanceContextReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_pool_reference_deleted_model = {} # LoadBalancerPoolReferenceDeleted
- load_balancer_pool_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a LoadBalancerPoolReference model
- load_balancer_pool_reference_model_json = {}
- load_balancer_pool_reference_model_json['deleted'] = load_balancer_pool_reference_deleted_model
- load_balancer_pool_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancers/dd754295-e9e0-4c9d-bf6c-58fbc59e5727/pools/70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model_json['id'] = '70294e14-4e61-11e8-bcf4-0242ac110004'
- load_balancer_pool_reference_model_json['name'] = 'my-load-balancer-pool'
+ # Construct a json representation of a NetworkInterfaceInstanceContextReferenceDeleted model
+ network_interface_instance_context_reference_deleted_model_json = {}
+ network_interface_instance_context_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerPoolReference by calling from_dict on the json representation
- load_balancer_pool_reference_model = LoadBalancerPoolReference.from_dict(load_balancer_pool_reference_model_json)
- assert load_balancer_pool_reference_model != False
+ # Construct a model instance of NetworkInterfaceInstanceContextReferenceDeleted by calling from_dict on the json representation
+ network_interface_instance_context_reference_deleted_model = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(network_interface_instance_context_reference_deleted_model_json)
+ assert network_interface_instance_context_reference_deleted_model != False
- # Construct a model instance of LoadBalancerPoolReference by calling from_dict on the json representation
- load_balancer_pool_reference_model_dict = LoadBalancerPoolReference.from_dict(load_balancer_pool_reference_model_json).__dict__
- load_balancer_pool_reference_model2 = LoadBalancerPoolReference(**load_balancer_pool_reference_model_dict)
+ # Construct a model instance of NetworkInterfaceInstanceContextReferenceDeleted by calling from_dict on the json representation
+ network_interface_instance_context_reference_deleted_model_dict = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(network_interface_instance_context_reference_deleted_model_json).__dict__
+ network_interface_instance_context_reference_deleted_model2 = NetworkInterfaceInstanceContextReferenceDeleted(**network_interface_instance_context_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_reference_model == load_balancer_pool_reference_model2
+ assert network_interface_instance_context_reference_deleted_model == network_interface_instance_context_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_reference_model_json2 = load_balancer_pool_reference_model.to_dict()
- assert load_balancer_pool_reference_model_json2 == load_balancer_pool_reference_model_json
+ network_interface_instance_context_reference_deleted_model_json2 = network_interface_instance_context_reference_deleted_model.to_dict()
+ assert network_interface_instance_context_reference_deleted_model_json2 == network_interface_instance_context_reference_deleted_model_json
-class TestModel_LoadBalancerPoolReferenceDeleted():
+class TestModel_NetworkInterfacePatch():
"""
- Test Class for LoadBalancerPoolReferenceDeleted
+ Test Class for NetworkInterfacePatch
"""
- def test_load_balancer_pool_reference_deleted_serialization(self):
+ def test_network_interface_patch_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolReferenceDeleted
+ Test serialization/deserialization for NetworkInterfacePatch
"""
- # Construct a json representation of a LoadBalancerPoolReferenceDeleted model
- load_balancer_pool_reference_deleted_model_json = {}
- load_balancer_pool_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # 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'
- # Construct a model instance of LoadBalancerPoolReferenceDeleted by calling from_dict on the json representation
- load_balancer_pool_reference_deleted_model = LoadBalancerPoolReferenceDeleted.from_dict(load_balancer_pool_reference_deleted_model_json)
- assert load_balancer_pool_reference_deleted_model != False
+ # 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)
+ assert network_interface_patch_model != False
- # Construct a model instance of LoadBalancerPoolReferenceDeleted by calling from_dict on the json representation
- load_balancer_pool_reference_deleted_model_dict = LoadBalancerPoolReferenceDeleted.from_dict(load_balancer_pool_reference_deleted_model_json).__dict__
- load_balancer_pool_reference_deleted_model2 = LoadBalancerPoolReferenceDeleted(**load_balancer_pool_reference_deleted_model_dict)
+ # Construct a model instance of NetworkInterfacePatch by calling from_dict on the json representation
+ network_interface_patch_model_dict = NetworkInterfacePatch.from_dict(network_interface_patch_model_json).__dict__
+ network_interface_patch_model2 = NetworkInterfacePatch(**network_interface_patch_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_reference_deleted_model == load_balancer_pool_reference_deleted_model2
+ assert network_interface_patch_model == network_interface_patch_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_reference_deleted_model_json2 = load_balancer_pool_reference_deleted_model.to_dict()
- assert load_balancer_pool_reference_deleted_model_json2 == load_balancer_pool_reference_deleted_model_json
+ network_interface_patch_model_json2 = network_interface_patch_model.to_dict()
+ assert network_interface_patch_model_json2 == network_interface_patch_model_json
-class TestModel_LoadBalancerPoolSessionPersistence():
+class TestModel_NetworkInterfacePrototype():
"""
- Test Class for LoadBalancerPoolSessionPersistence
+ Test Class for NetworkInterfacePrototype
"""
- def test_load_balancer_pool_session_persistence_serialization(self):
+ def test_network_interface_prototype_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolSessionPersistence
+ Test serialization/deserialization for NetworkInterfacePrototype
"""
- # Construct a json representation of a LoadBalancerPoolSessionPersistence model
- load_balancer_pool_session_persistence_model_json = {}
- load_balancer_pool_session_persistence_model_json['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_model_json['type'] = 'app_cookie'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerPoolSessionPersistence by calling from_dict on the json representation
- load_balancer_pool_session_persistence_model = LoadBalancerPoolSessionPersistence.from_dict(load_balancer_pool_session_persistence_model_json)
- assert load_balancer_pool_session_persistence_model != False
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Construct a model instance of LoadBalancerPoolSessionPersistence by calling from_dict on the json representation
- load_balancer_pool_session_persistence_model_dict = LoadBalancerPoolSessionPersistence.from_dict(load_balancer_pool_session_persistence_model_json).__dict__
- load_balancer_pool_session_persistence_model2 = LoadBalancerPoolSessionPersistence(**load_balancer_pool_session_persistence_model_dict)
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+
+ # 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['primary_ipv4_address'] = '10.0.0.5'
+ network_interface_prototype_model_json['security_groups'] = [security_group_identity_model]
+ network_interface_prototype_model_json['subnet'] = subnet_identity_model
+
+ # Construct a model instance of NetworkInterfacePrototype by calling from_dict on the json representation
+ network_interface_prototype_model = NetworkInterfacePrototype.from_dict(network_interface_prototype_model_json)
+ assert network_interface_prototype_model != False
+
+ # Construct a model instance of NetworkInterfacePrototype by calling from_dict on the json representation
+ network_interface_prototype_model_dict = NetworkInterfacePrototype.from_dict(network_interface_prototype_model_json).__dict__
+ network_interface_prototype_model2 = NetworkInterfacePrototype(**network_interface_prototype_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_session_persistence_model == load_balancer_pool_session_persistence_model2
+ assert network_interface_prototype_model == network_interface_prototype_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_session_persistence_model_json2 = load_balancer_pool_session_persistence_model.to_dict()
- assert load_balancer_pool_session_persistence_model_json2 == load_balancer_pool_session_persistence_model_json
+ network_interface_prototype_model_json2 = network_interface_prototype_model.to_dict()
+ assert network_interface_prototype_model_json2 == network_interface_prototype_model_json
-class TestModel_LoadBalancerPoolSessionPersistencePatch():
+class TestModel_NetworkInterfaceReference():
"""
- Test Class for LoadBalancerPoolSessionPersistencePatch
+ Test Class for NetworkInterfaceReference
"""
- def test_load_balancer_pool_session_persistence_patch_serialization(self):
+ def test_network_interface_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolSessionPersistencePatch
+ Test serialization/deserialization for NetworkInterfaceReference
"""
- # Construct a json representation of a LoadBalancerPoolSessionPersistencePatch model
- load_balancer_pool_session_persistence_patch_model_json = {}
- load_balancer_pool_session_persistence_patch_model_json['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_patch_model_json['type'] = 'app_cookie'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of LoadBalancerPoolSessionPersistencePatch by calling from_dict on the json representation
- load_balancer_pool_session_persistence_patch_model = LoadBalancerPoolSessionPersistencePatch.from_dict(load_balancer_pool_session_persistence_patch_model_json)
- assert load_balancer_pool_session_persistence_patch_model != False
+ network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
+ network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerPoolSessionPersistencePatch by calling from_dict on the json representation
- load_balancer_pool_session_persistence_patch_model_dict = LoadBalancerPoolSessionPersistencePatch.from_dict(load_balancer_pool_session_persistence_patch_model_json).__dict__
- load_balancer_pool_session_persistence_patch_model2 = LoadBalancerPoolSessionPersistencePatch(**load_balancer_pool_session_persistence_patch_model_dict)
+ # Construct a json representation of a NetworkInterfaceReference model
+ network_interface_reference_model_json = {}
+ network_interface_reference_model_json['deleted'] = network_interface_reference_deleted_model
+ network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ network_interface_reference_model_json['name'] = 'my-network-interface'
+ network_interface_reference_model_json['primary_ipv4_address'] = '192.168.3.4'
+ network_interface_reference_model_json['resource_type'] = 'network_interface'
+
+ # Construct a model instance of NetworkInterfaceReference by calling from_dict on the json representation
+ network_interface_reference_model = NetworkInterfaceReference.from_dict(network_interface_reference_model_json)
+ assert network_interface_reference_model != False
+
+ # Construct a model instance of NetworkInterfaceReference by calling from_dict on the json representation
+ network_interface_reference_model_dict = NetworkInterfaceReference.from_dict(network_interface_reference_model_json).__dict__
+ network_interface_reference_model2 = NetworkInterfaceReference(**network_interface_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_session_persistence_patch_model == load_balancer_pool_session_persistence_patch_model2
+ assert network_interface_reference_model == network_interface_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_session_persistence_patch_model_json2 = load_balancer_pool_session_persistence_patch_model.to_dict()
- assert load_balancer_pool_session_persistence_patch_model_json2 == load_balancer_pool_session_persistence_patch_model_json
+ network_interface_reference_model_json2 = network_interface_reference_model.to_dict()
+ assert network_interface_reference_model_json2 == network_interface_reference_model_json
-class TestModel_LoadBalancerPoolSessionPersistencePrototype():
+class TestModel_NetworkInterfaceReferenceDeleted():
"""
- Test Class for LoadBalancerPoolSessionPersistencePrototype
+ Test Class for NetworkInterfaceReferenceDeleted
"""
- def test_load_balancer_pool_session_persistence_prototype_serialization(self):
+ def test_network_interface_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerPoolSessionPersistencePrototype
+ Test serialization/deserialization for NetworkInterfaceReferenceDeleted
"""
- # Construct a json representation of a LoadBalancerPoolSessionPersistencePrototype model
- load_balancer_pool_session_persistence_prototype_model_json = {}
- load_balancer_pool_session_persistence_prototype_model_json['cookie_name'] = 'my-cookie-name'
- load_balancer_pool_session_persistence_prototype_model_json['type'] = 'app_cookie'
+ # Construct a json representation of a NetworkInterfaceReferenceDeleted model
+ network_interface_reference_deleted_model_json = {}
+ network_interface_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerPoolSessionPersistencePrototype by calling from_dict on the json representation
- load_balancer_pool_session_persistence_prototype_model = LoadBalancerPoolSessionPersistencePrototype.from_dict(load_balancer_pool_session_persistence_prototype_model_json)
- assert load_balancer_pool_session_persistence_prototype_model != False
+ # Construct a model instance of NetworkInterfaceReferenceDeleted by calling from_dict on the json representation
+ network_interface_reference_deleted_model = NetworkInterfaceReferenceDeleted.from_dict(network_interface_reference_deleted_model_json)
+ assert network_interface_reference_deleted_model != False
- # Construct a model instance of LoadBalancerPoolSessionPersistencePrototype by calling from_dict on the json representation
- load_balancer_pool_session_persistence_prototype_model_dict = LoadBalancerPoolSessionPersistencePrototype.from_dict(load_balancer_pool_session_persistence_prototype_model_json).__dict__
- load_balancer_pool_session_persistence_prototype_model2 = LoadBalancerPoolSessionPersistencePrototype(**load_balancer_pool_session_persistence_prototype_model_dict)
+ # Construct a model instance of NetworkInterfaceReferenceDeleted by calling from_dict on the json representation
+ network_interface_reference_deleted_model_dict = NetworkInterfaceReferenceDeleted.from_dict(network_interface_reference_deleted_model_json).__dict__
+ network_interface_reference_deleted_model2 = NetworkInterfaceReferenceDeleted(**network_interface_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_pool_session_persistence_prototype_model == load_balancer_pool_session_persistence_prototype_model2
+ assert network_interface_reference_deleted_model == network_interface_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_pool_session_persistence_prototype_model_json2 = load_balancer_pool_session_persistence_prototype_model.to_dict()
- assert load_balancer_pool_session_persistence_prototype_model_json2 == load_balancer_pool_session_persistence_prototype_model_json
+ network_interface_reference_deleted_model_json2 = network_interface_reference_deleted_model.to_dict()
+ assert network_interface_reference_deleted_model_json2 == network_interface_reference_deleted_model_json
-class TestModel_LoadBalancerProfile():
+class TestModel_NetworkInterfaceReferenceTargetContextDeleted():
"""
- Test Class for LoadBalancerProfile
+ Test Class for NetworkInterfaceReferenceTargetContextDeleted
"""
- def test_load_balancer_profile_serialization(self):
+ def test_network_interface_reference_target_context_deleted_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfile
+ Test serialization/deserialization for NetworkInterfaceReferenceTargetContextDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- load_balancer_profile_logging_supported_model = {} # LoadBalancerProfileLoggingSupported
- load_balancer_profile_logging_supported_model['type'] = 'fixed'
- load_balancer_profile_logging_supported_model['value'] = ['datapath']
-
- load_balancer_profile_route_mode_supported_model = {} # LoadBalancerProfileRouteModeSupportedFixed
- load_balancer_profile_route_mode_supported_model['type'] = 'fixed'
- load_balancer_profile_route_mode_supported_model['value'] = True
-
- load_balancer_profile_security_groups_supported_model = {} # LoadBalancerProfileSecurityGroupsSupportedFixed
- load_balancer_profile_security_groups_supported_model['type'] = 'fixed'
- load_balancer_profile_security_groups_supported_model['value'] = True
-
- # Construct a json representation of a LoadBalancerProfile model
- load_balancer_profile_model_json = {}
- load_balancer_profile_model_json['family'] = 'network'
- load_balancer_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
- load_balancer_profile_model_json['logging_supported'] = load_balancer_profile_logging_supported_model
- load_balancer_profile_model_json['name'] = 'network-fixed'
- load_balancer_profile_model_json['route_mode_supported'] = load_balancer_profile_route_mode_supported_model
- load_balancer_profile_model_json['security_groups_supported'] = load_balancer_profile_security_groups_supported_model
+ # Construct a json representation of a NetworkInterfaceReferenceTargetContextDeleted model
+ network_interface_reference_target_context_deleted_model_json = {}
+ network_interface_reference_target_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of LoadBalancerProfile by calling from_dict on the json representation
- load_balancer_profile_model = LoadBalancerProfile.from_dict(load_balancer_profile_model_json)
- assert load_balancer_profile_model != False
+ # Construct a model instance of NetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation
+ network_interface_reference_target_context_deleted_model = NetworkInterfaceReferenceTargetContextDeleted.from_dict(network_interface_reference_target_context_deleted_model_json)
+ assert network_interface_reference_target_context_deleted_model != False
- # Construct a model instance of LoadBalancerProfile by calling from_dict on the json representation
- load_balancer_profile_model_dict = LoadBalancerProfile.from_dict(load_balancer_profile_model_json).__dict__
- load_balancer_profile_model2 = LoadBalancerProfile(**load_balancer_profile_model_dict)
+ # Construct a model instance of NetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation
+ network_interface_reference_target_context_deleted_model_dict = NetworkInterfaceReferenceTargetContextDeleted.from_dict(network_interface_reference_target_context_deleted_model_json).__dict__
+ network_interface_reference_target_context_deleted_model2 = NetworkInterfaceReferenceTargetContextDeleted(**network_interface_reference_target_context_deleted_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_model == load_balancer_profile_model2
+ assert network_interface_reference_target_context_deleted_model == network_interface_reference_target_context_deleted_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_model_json2 = load_balancer_profile_model.to_dict()
- assert load_balancer_profile_model_json2 == load_balancer_profile_model_json
+ network_interface_reference_target_context_deleted_model_json2 = network_interface_reference_target_context_deleted_model.to_dict()
+ assert network_interface_reference_target_context_deleted_model_json2 == network_interface_reference_target_context_deleted_model_json
-class TestModel_LoadBalancerProfileCollection():
+class TestModel_NetworkInterfaceUnpaginatedCollection():
"""
- Test Class for LoadBalancerProfileCollection
+ Test Class for NetworkInterfaceUnpaginatedCollection
"""
- def test_load_balancer_profile_collection_serialization(self):
+ def test_network_interface_unpaginated_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileCollection
+ Test serialization/deserialization for NetworkInterfaceUnpaginatedCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- load_balancer_profile_collection_first_model = {} # LoadBalancerProfileCollectionFirst
- load_balancer_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20'
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_profile_collection_next_model = {} # LoadBalancerProfileCollectionNext
- load_balancer_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ floating_ip_reference_model = {} # FloatingIPReference
+ floating_ip_reference_model['address'] = '192.0.2.2'
+ floating_ip_reference_model['crn'] = 'crn:[...]'
+ floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
+ floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/181b8670-52bf-47af-a5ca-7aff7f3824d1'
+ floating_ip_reference_model['id'] = '181b8670-52bf-47af-a5ca-7aff7f3824d1'
+ floating_ip_reference_model['name'] = 'my-floating-ip'
- load_balancer_profile_logging_supported_model = {} # LoadBalancerProfileLoggingSupported
- load_balancer_profile_logging_supported_model['type'] = 'fixed'
- load_balancer_profile_logging_supported_model['value'] = ['datapath']
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_profile_route_mode_supported_model = {} # LoadBalancerProfileRouteModeSupportedFixed
- load_balancer_profile_route_mode_supported_model['type'] = 'fixed'
- load_balancer_profile_route_mode_supported_model['value'] = True
+ 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'] = 'before-entrance-mountain-paralegal-photo-uninstall'
- load_balancer_profile_security_groups_supported_model = {} # LoadBalancerProfileSecurityGroupsSupportedFixed
- load_balancer_profile_security_groups_supported_model['type'] = 'fixed'
- load_balancer_profile_security_groups_supported_model['value'] = True
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- load_balancer_profile_model = {} # LoadBalancerProfile
- load_balancer_profile_model['family'] = 'network'
- load_balancer_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
- load_balancer_profile_model['logging_supported'] = load_balancer_profile_logging_supported_model
- load_balancer_profile_model['name'] = 'network-fixed'
- load_balancer_profile_model['route_mode_supported'] = load_balancer_profile_route_mode_supported_model
- load_balancer_profile_model['security_groups_supported'] = load_balancer_profile_security_groups_supported_model
+ 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'
- # Construct a json representation of a LoadBalancerProfileCollection model
- load_balancer_profile_collection_model_json = {}
- load_balancer_profile_collection_model_json['first'] = load_balancer_profile_collection_first_model
- load_balancer_profile_collection_model_json['limit'] = 20
- load_balancer_profile_collection_model_json['next'] = load_balancer_profile_collection_next_model
- load_balancer_profile_collection_model_json['profiles'] = [load_balancer_profile_model]
- load_balancer_profile_collection_model_json['total_count'] = 132
+ network_interface_model = {} # NetworkInterface
+ network_interface_model['allow_ip_spoofing'] = False
+ network_interface_model['created_at'] = "2019-01-31T03:42:32.993000Z"
+ network_interface_model['floating_ips'] = [floating_ip_reference_model]
+ network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/123a490a-9e64-4254-a93b-9a3af3ede270/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20'
+ network_interface_model['id'] = '35bd3f19-bdd4-434b-ad6a-5e9358d65e20'
+ network_interface_model['name'] = 'molecule-find-wild-name-dictionary-trench'
+ network_interface_model['port_speed'] = 1000
+ network_interface_model['primary_ipv4_address'] = '10.0.0.32'
+ network_interface_model['resource_type'] = 'network_interface'
+ network_interface_model['security_groups'] = [security_group_reference_model]
+ network_interface_model['status'] = 'available'
+ network_interface_model['subnet'] = subnet_reference_model
+ network_interface_model['type'] = 'primary'
- # Construct a model instance of LoadBalancerProfileCollection by calling from_dict on the json representation
- load_balancer_profile_collection_model = LoadBalancerProfileCollection.from_dict(load_balancer_profile_collection_model_json)
- assert load_balancer_profile_collection_model != False
+ # Construct a json representation of a NetworkInterfaceUnpaginatedCollection model
+ network_interface_unpaginated_collection_model_json = {}
+ network_interface_unpaginated_collection_model_json['network_interfaces'] = [network_interface_model]
+
+ # Construct a model instance of NetworkInterfaceUnpaginatedCollection by calling from_dict on the json representation
+ network_interface_unpaginated_collection_model = NetworkInterfaceUnpaginatedCollection.from_dict(network_interface_unpaginated_collection_model_json)
+ assert network_interface_unpaginated_collection_model != False
- # Construct a model instance of LoadBalancerProfileCollection by calling from_dict on the json representation
- load_balancer_profile_collection_model_dict = LoadBalancerProfileCollection.from_dict(load_balancer_profile_collection_model_json).__dict__
- load_balancer_profile_collection_model2 = LoadBalancerProfileCollection(**load_balancer_profile_collection_model_dict)
+ # Construct a model instance of NetworkInterfaceUnpaginatedCollection by calling from_dict on the json representation
+ network_interface_unpaginated_collection_model_dict = NetworkInterfaceUnpaginatedCollection.from_dict(network_interface_unpaginated_collection_model_json).__dict__
+ network_interface_unpaginated_collection_model2 = NetworkInterfaceUnpaginatedCollection(**network_interface_unpaginated_collection_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_collection_model == load_balancer_profile_collection_model2
+ assert network_interface_unpaginated_collection_model == network_interface_unpaginated_collection_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_collection_model_json2 = load_balancer_profile_collection_model.to_dict()
- assert load_balancer_profile_collection_model_json2 == load_balancer_profile_collection_model_json
+ network_interface_unpaginated_collection_model_json2 = network_interface_unpaginated_collection_model.to_dict()
+ assert network_interface_unpaginated_collection_model_json2 == network_interface_unpaginated_collection_model_json
-class TestModel_LoadBalancerProfileCollectionFirst():
+class TestModel_OperatingSystem():
"""
- Test Class for LoadBalancerProfileCollectionFirst
+ Test Class for OperatingSystem
"""
- def test_load_balancer_profile_collection_first_serialization(self):
+ def test_operating_system_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileCollectionFirst
+ Test serialization/deserialization for OperatingSystem
"""
- # Construct a json representation of a LoadBalancerProfileCollectionFirst model
- load_balancer_profile_collection_first_model_json = {}
- load_balancer_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?limit=20'
+ # Construct a json representation of a OperatingSystem model
+ operating_system_model_json = {}
+ operating_system_model_json['architecture'] = 'amd64'
+ operating_system_model_json['dedicated_host_only'] = False
+ operating_system_model_json['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
+ operating_system_model_json['family'] = 'Ubuntu Server'
+ operating_system_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ operating_system_model_json['name'] = 'ubuntu-16-amd64'
+ operating_system_model_json['vendor'] = 'Canonical'
+ operating_system_model_json['version'] = '16.04 LTS'
- # Construct a model instance of LoadBalancerProfileCollectionFirst by calling from_dict on the json representation
- load_balancer_profile_collection_first_model = LoadBalancerProfileCollectionFirst.from_dict(load_balancer_profile_collection_first_model_json)
- assert load_balancer_profile_collection_first_model != False
+ # Construct a model instance of OperatingSystem by calling from_dict on the json representation
+ operating_system_model = OperatingSystem.from_dict(operating_system_model_json)
+ assert operating_system_model != False
- # Construct a model instance of LoadBalancerProfileCollectionFirst by calling from_dict on the json representation
- load_balancer_profile_collection_first_model_dict = LoadBalancerProfileCollectionFirst.from_dict(load_balancer_profile_collection_first_model_json).__dict__
- load_balancer_profile_collection_first_model2 = LoadBalancerProfileCollectionFirst(**load_balancer_profile_collection_first_model_dict)
+ # Construct a model instance of OperatingSystem by calling from_dict on the json representation
+ operating_system_model_dict = OperatingSystem.from_dict(operating_system_model_json).__dict__
+ operating_system_model2 = OperatingSystem(**operating_system_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_collection_first_model == load_balancer_profile_collection_first_model2
+ assert operating_system_model == operating_system_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_collection_first_model_json2 = load_balancer_profile_collection_first_model.to_dict()
- assert load_balancer_profile_collection_first_model_json2 == load_balancer_profile_collection_first_model_json
+ operating_system_model_json2 = operating_system_model.to_dict()
+ assert operating_system_model_json2 == operating_system_model_json
-class TestModel_LoadBalancerProfileCollectionNext():
+class TestModel_OperatingSystemCollection():
"""
- Test Class for LoadBalancerProfileCollectionNext
+ Test Class for OperatingSystemCollection
"""
- def test_load_balancer_profile_collection_next_serialization(self):
+ def test_operating_system_collection_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileCollectionNext
+ Test serialization/deserialization for OperatingSystemCollection
"""
- # Construct a json representation of a LoadBalancerProfileCollectionNext model
- load_balancer_profile_collection_next_model_json = {}
- load_balancer_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- # Construct a model instance of LoadBalancerProfileCollectionNext by calling from_dict on the json representation
- load_balancer_profile_collection_next_model = LoadBalancerProfileCollectionNext.from_dict(load_balancer_profile_collection_next_model_json)
- assert load_balancer_profile_collection_next_model != False
-
- # Construct a model instance of LoadBalancerProfileCollectionNext by calling from_dict on the json representation
- load_balancer_profile_collection_next_model_dict = LoadBalancerProfileCollectionNext.from_dict(load_balancer_profile_collection_next_model_json).__dict__
- load_balancer_profile_collection_next_model2 = LoadBalancerProfileCollectionNext(**load_balancer_profile_collection_next_model_dict)
-
- # Verify the model instances are equivalent
- assert load_balancer_profile_collection_next_model == load_balancer_profile_collection_next_model2
+ # Construct dict forms of any model objects needed in order to build this model.
- # Convert model instance back to dict and verify no loss of data
- load_balancer_profile_collection_next_model_json2 = load_balancer_profile_collection_next_model.to_dict()
- assert load_balancer_profile_collection_next_model_json2 == load_balancer_profile_collection_next_model_json
+ operating_system_collection_first_model = {} # OperatingSystemCollectionFirst
+ operating_system_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20'
-class TestModel_LoadBalancerProfileLoggingSupported():
- """
- Test Class for LoadBalancerProfileLoggingSupported
- """
+ operating_system_collection_next_model = {} # OperatingSystemCollectionNext
+ operating_system_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- def test_load_balancer_profile_logging_supported_serialization(self):
- """
- Test serialization/deserialization for LoadBalancerProfileLoggingSupported
- """
+ operating_system_model = {} # OperatingSystem
+ operating_system_model['architecture'] = 'amd64'
+ operating_system_model['dedicated_host_only'] = False
+ operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
+ operating_system_model['family'] = 'Ubuntu Server'
+ operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ operating_system_model['name'] = 'ubuntu-16-amd64'
+ operating_system_model['vendor'] = 'Canonical'
+ operating_system_model['version'] = '16.04 LTS'
- # Construct a json representation of a LoadBalancerProfileLoggingSupported model
- load_balancer_profile_logging_supported_model_json = {}
- load_balancer_profile_logging_supported_model_json['type'] = 'fixed'
- load_balancer_profile_logging_supported_model_json['value'] = ['datapath']
+ # Construct a json representation of a OperatingSystemCollection model
+ operating_system_collection_model_json = {}
+ operating_system_collection_model_json['first'] = operating_system_collection_first_model
+ operating_system_collection_model_json['limit'] = 20
+ operating_system_collection_model_json['next'] = operating_system_collection_next_model
+ operating_system_collection_model_json['operating_systems'] = [operating_system_model]
- # Construct a model instance of LoadBalancerProfileLoggingSupported by calling from_dict on the json representation
- load_balancer_profile_logging_supported_model = LoadBalancerProfileLoggingSupported.from_dict(load_balancer_profile_logging_supported_model_json)
- assert load_balancer_profile_logging_supported_model != False
+ # Construct a model instance of OperatingSystemCollection by calling from_dict on the json representation
+ operating_system_collection_model = OperatingSystemCollection.from_dict(operating_system_collection_model_json)
+ assert operating_system_collection_model != False
- # Construct a model instance of LoadBalancerProfileLoggingSupported by calling from_dict on the json representation
- load_balancer_profile_logging_supported_model_dict = LoadBalancerProfileLoggingSupported.from_dict(load_balancer_profile_logging_supported_model_json).__dict__
- load_balancer_profile_logging_supported_model2 = LoadBalancerProfileLoggingSupported(**load_balancer_profile_logging_supported_model_dict)
+ # Construct a model instance of OperatingSystemCollection by calling from_dict on the json representation
+ operating_system_collection_model_dict = OperatingSystemCollection.from_dict(operating_system_collection_model_json).__dict__
+ operating_system_collection_model2 = OperatingSystemCollection(**operating_system_collection_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_logging_supported_model == load_balancer_profile_logging_supported_model2
+ assert operating_system_collection_model == operating_system_collection_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_logging_supported_model_json2 = load_balancer_profile_logging_supported_model.to_dict()
- assert load_balancer_profile_logging_supported_model_json2 == load_balancer_profile_logging_supported_model_json
+ operating_system_collection_model_json2 = operating_system_collection_model.to_dict()
+ assert operating_system_collection_model_json2 == operating_system_collection_model_json
-class TestModel_LoadBalancerProfileReference():
+class TestModel_OperatingSystemCollectionFirst():
"""
- Test Class for LoadBalancerProfileReference
+ Test Class for OperatingSystemCollectionFirst
"""
- def test_load_balancer_profile_reference_serialization(self):
+ def test_operating_system_collection_first_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerProfileReference
+ Test serialization/deserialization for OperatingSystemCollectionFirst
"""
- # Construct a json representation of a LoadBalancerProfileReference model
- load_balancer_profile_reference_model_json = {}
- load_balancer_profile_reference_model_json['family'] = 'network'
- load_balancer_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/load_balancer/profiles/network-fixed'
- load_balancer_profile_reference_model_json['name'] = 'network-fixed'
+ # Construct a json representation of a OperatingSystemCollectionFirst model
+ operating_system_collection_first_model_json = {}
+ operating_system_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20'
- # Construct a model instance of LoadBalancerProfileReference by calling from_dict on the json representation
- load_balancer_profile_reference_model = LoadBalancerProfileReference.from_dict(load_balancer_profile_reference_model_json)
- assert load_balancer_profile_reference_model != False
+ # Construct a model instance of OperatingSystemCollectionFirst by calling from_dict on the json representation
+ operating_system_collection_first_model = OperatingSystemCollectionFirst.from_dict(operating_system_collection_first_model_json)
+ assert operating_system_collection_first_model != False
- # Construct a model instance of LoadBalancerProfileReference by calling from_dict on the json representation
- load_balancer_profile_reference_model_dict = LoadBalancerProfileReference.from_dict(load_balancer_profile_reference_model_json).__dict__
- load_balancer_profile_reference_model2 = LoadBalancerProfileReference(**load_balancer_profile_reference_model_dict)
+ # Construct a model instance of OperatingSystemCollectionFirst by calling from_dict on the json representation
+ operating_system_collection_first_model_dict = OperatingSystemCollectionFirst.from_dict(operating_system_collection_first_model_json).__dict__
+ operating_system_collection_first_model2 = OperatingSystemCollectionFirst(**operating_system_collection_first_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_profile_reference_model == load_balancer_profile_reference_model2
+ assert operating_system_collection_first_model == operating_system_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_profile_reference_model_json2 = load_balancer_profile_reference_model.to_dict()
- assert load_balancer_profile_reference_model_json2 == load_balancer_profile_reference_model_json
+ operating_system_collection_first_model_json2 = operating_system_collection_first_model.to_dict()
+ assert operating_system_collection_first_model_json2 == operating_system_collection_first_model_json
-class TestModel_LoadBalancerReferenceDeleted():
+class TestModel_OperatingSystemCollectionNext():
"""
- Test Class for LoadBalancerReferenceDeleted
+ Test Class for OperatingSystemCollectionNext
"""
- def test_load_balancer_reference_deleted_serialization(self):
+ def test_operating_system_collection_next_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerReferenceDeleted
+ Test serialization/deserialization for OperatingSystemCollectionNext
"""
- # Construct a json representation of a LoadBalancerReferenceDeleted model
- load_balancer_reference_deleted_model_json = {}
- load_balancer_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a OperatingSystemCollectionNext model
+ operating_system_collection_next_model_json = {}
+ operating_system_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of LoadBalancerReferenceDeleted by calling from_dict on the json representation
- load_balancer_reference_deleted_model = LoadBalancerReferenceDeleted.from_dict(load_balancer_reference_deleted_model_json)
- assert load_balancer_reference_deleted_model != False
+ # Construct a model instance of OperatingSystemCollectionNext by calling from_dict on the json representation
+ operating_system_collection_next_model = OperatingSystemCollectionNext.from_dict(operating_system_collection_next_model_json)
+ assert operating_system_collection_next_model != False
- # Construct a model instance of LoadBalancerReferenceDeleted by calling from_dict on the json representation
- load_balancer_reference_deleted_model_dict = LoadBalancerReferenceDeleted.from_dict(load_balancer_reference_deleted_model_json).__dict__
- load_balancer_reference_deleted_model2 = LoadBalancerReferenceDeleted(**load_balancer_reference_deleted_model_dict)
+ # Construct a model instance of OperatingSystemCollectionNext by calling from_dict on the json representation
+ operating_system_collection_next_model_dict = OperatingSystemCollectionNext.from_dict(operating_system_collection_next_model_json).__dict__
+ operating_system_collection_next_model2 = OperatingSystemCollectionNext(**operating_system_collection_next_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_reference_deleted_model == load_balancer_reference_deleted_model2
+ assert operating_system_collection_next_model == operating_system_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_reference_deleted_model_json2 = load_balancer_reference_deleted_model.to_dict()
- assert load_balancer_reference_deleted_model_json2 == load_balancer_reference_deleted_model_json
+ operating_system_collection_next_model_json2 = operating_system_collection_next_model.to_dict()
+ assert operating_system_collection_next_model_json2 == operating_system_collection_next_model_json
-class TestModel_LoadBalancerStatistics():
+class TestModel_OperatingSystemReference():
"""
- Test Class for LoadBalancerStatistics
+ Test Class for OperatingSystemReference
"""
- def test_load_balancer_statistics_serialization(self):
+ def test_operating_system_reference_serialization(self):
"""
- Test serialization/deserialization for LoadBalancerStatistics
+ Test serialization/deserialization for OperatingSystemReference
"""
- # Construct a json representation of a LoadBalancerStatistics model
- load_balancer_statistics_model_json = {}
- load_balancer_statistics_model_json['active_connections'] = 797
- load_balancer_statistics_model_json['connection_rate'] = 91.121
- load_balancer_statistics_model_json['data_processed_this_month'] = 10093173145
- load_balancer_statistics_model_json['throughput'] = 167.278
+ # Construct a json representation of a OperatingSystemReference model
+ operating_system_reference_model_json = {}
+ operating_system_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ operating_system_reference_model_json['name'] = 'ubuntu-16-amd64'
- # Construct a model instance of LoadBalancerStatistics by calling from_dict on the json representation
- load_balancer_statistics_model = LoadBalancerStatistics.from_dict(load_balancer_statistics_model_json)
- assert load_balancer_statistics_model != False
+ # Construct a model instance of OperatingSystemReference by calling from_dict on the json representation
+ operating_system_reference_model = OperatingSystemReference.from_dict(operating_system_reference_model_json)
+ assert operating_system_reference_model != False
- # Construct a model instance of LoadBalancerStatistics by calling from_dict on the json representation
- load_balancer_statistics_model_dict = LoadBalancerStatistics.from_dict(load_balancer_statistics_model_json).__dict__
- load_balancer_statistics_model2 = LoadBalancerStatistics(**load_balancer_statistics_model_dict)
+ # Construct a model instance of OperatingSystemReference by calling from_dict on the json representation
+ operating_system_reference_model_dict = OperatingSystemReference.from_dict(operating_system_reference_model_json).__dict__
+ operating_system_reference_model2 = OperatingSystemReference(**operating_system_reference_model_dict)
# Verify the model instances are equivalent
- assert load_balancer_statistics_model == load_balancer_statistics_model2
+ assert operating_system_reference_model == operating_system_reference_model2
# Convert model instance back to dict and verify no loss of data
- load_balancer_statistics_model_json2 = load_balancer_statistics_model.to_dict()
- assert load_balancer_statistics_model_json2 == load_balancer_statistics_model_json
+ operating_system_reference_model_json2 = operating_system_reference_model.to_dict()
+ assert operating_system_reference_model_json2 == operating_system_reference_model_json
-class TestModel_NetworkACL():
+class TestModel_PlacementGroup():
"""
- Test Class for NetworkACL
+ Test Class for PlacementGroup
"""
- def test_network_acl_serialization(self):
+ def test_placement_group_serialization(self):
"""
- Test serialization/deserialization for NetworkACL
+ Test serialization/deserialization for PlacementGroup
"""
# Construct dict forms of any model objects needed in order to build this model.
resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
-
- network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
- network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- network_acl_rule_reference_model = {} # NetworkACLRuleReference
- network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model
- network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model['name'] = 'my-rule-1'
-
- network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP
- network_acl_rule_item_model['action'] = 'allow'
- network_acl_rule_item_model['before'] = network_acl_rule_reference_model
- network_acl_rule_item_model['created_at'] = "2019-01-01T12:00:00Z"
- network_acl_rule_item_model['destination'] = '192.168.3.0/24'
- network_acl_rule_item_model['direction'] = 'inbound'
- network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_model['ip_version'] = 'ipv4'
- network_acl_rule_item_model['name'] = 'my-rule-2'
- network_acl_rule_item_model['source'] = '192.168.3.0/24'
- network_acl_rule_item_model['code'] = 0
- network_acl_rule_item_model['protocol'] = 'icmp'
- network_acl_rule_item_model['type'] = 8
-
- 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'
-
- 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'
+ 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'
- # Construct a json representation of a NetworkACL model
- network_acl_model_json = {}
- network_acl_model_json['created_at'] = "2019-01-01T12:00:00Z"
- network_acl_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_model_json['name'] = 'my-network-acl'
- network_acl_model_json['resource_group'] = resource_group_reference_model
- network_acl_model_json['rules'] = [network_acl_rule_item_model]
- network_acl_model_json['subnets'] = [subnet_reference_model]
- network_acl_model_json['vpc'] = vpc_reference_model
+ # Construct a json representation of a PlacementGroup model
+ placement_group_model_json = {}
+ placement_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ placement_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ placement_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ placement_group_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ placement_group_model_json['lifecycle_state'] = 'stable'
+ placement_group_model_json['name'] = 'my-placement-group'
+ placement_group_model_json['resource_group'] = resource_group_reference_model
+ placement_group_model_json['resource_type'] = 'placement_group'
+ placement_group_model_json['strategy'] = 'host_spread'
- # Construct a model instance of NetworkACL by calling from_dict on the json representation
- network_acl_model = NetworkACL.from_dict(network_acl_model_json)
- assert network_acl_model != False
+ # Construct a model instance of PlacementGroup by calling from_dict on the json representation
+ placement_group_model = PlacementGroup.from_dict(placement_group_model_json)
+ assert placement_group_model != False
- # Construct a model instance of NetworkACL by calling from_dict on the json representation
- network_acl_model_dict = NetworkACL.from_dict(network_acl_model_json).__dict__
- network_acl_model2 = NetworkACL(**network_acl_model_dict)
+ # Construct a model instance of PlacementGroup by calling from_dict on the json representation
+ placement_group_model_dict = PlacementGroup.from_dict(placement_group_model_json).__dict__
+ placement_group_model2 = PlacementGroup(**placement_group_model_dict)
# Verify the model instances are equivalent
- assert network_acl_model == network_acl_model2
+ assert placement_group_model == placement_group_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_model_json2 = network_acl_model.to_dict()
- assert network_acl_model_json2 == network_acl_model_json
+ placement_group_model_json2 = placement_group_model.to_dict()
+ assert placement_group_model_json2 == placement_group_model_json
-class TestModel_NetworkACLCollection():
+class TestModel_PlacementGroupCollection():
"""
- Test Class for NetworkACLCollection
+ Test Class for PlacementGroupCollection
"""
- def test_network_acl_collection_serialization(self):
+ def test_placement_group_collection_serialization(self):
"""
- Test serialization/deserialization for NetworkACLCollection
+ Test serialization/deserialization for PlacementGroupCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_acl_collection_first_model = {} # NetworkACLCollectionFirst
- network_acl_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20'
-
- 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'
-
- network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
- network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- network_acl_rule_reference_model = {} # NetworkACLRuleReference
- network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model
- network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model['name'] = 'my-rule-1'
-
- network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP
- network_acl_rule_item_model['action'] = 'allow'
- network_acl_rule_item_model['before'] = network_acl_rule_reference_model
- network_acl_rule_item_model['created_at'] = "2019-01-01T12:00:00Z"
- network_acl_rule_item_model['destination'] = '192.168.3.0/24'
- network_acl_rule_item_model['direction'] = 'inbound'
- network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_model['ip_version'] = 'ipv4'
- network_acl_rule_item_model['name'] = 'my-rule-2'
- network_acl_rule_item_model['source'] = '192.168.3.0/24'
- network_acl_rule_item_model['code'] = 0
- network_acl_rule_item_model['protocol'] = 'icmp'
- network_acl_rule_item_model['type'] = 8
-
- 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'
-
- 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'
-
- network_acl_model = {} # NetworkACL
- network_acl_model['created_at'] = "2019-01-01T12:00:00Z"
- network_acl_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_model['name'] = 'my-network-acl'
- network_acl_model['resource_group'] = resource_group_reference_model
- network_acl_model['rules'] = [network_acl_rule_item_model]
- network_acl_model['subnets'] = [subnet_reference_model]
- network_acl_model['vpc'] = vpc_reference_model
-
- network_acl_collection_next_model = {} # NetworkACLCollectionNext
- network_acl_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- # Construct a json representation of a NetworkACLCollection model
- network_acl_collection_model_json = {}
- network_acl_collection_model_json['first'] = network_acl_collection_first_model
- network_acl_collection_model_json['limit'] = 20
- network_acl_collection_model_json['network_acls'] = [network_acl_model]
- network_acl_collection_model_json['next'] = network_acl_collection_next_model
- network_acl_collection_model_json['total_count'] = 132
-
- # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation
- network_acl_collection_model = NetworkACLCollection.from_dict(network_acl_collection_model_json)
- assert network_acl_collection_model != False
-
- # Construct a model instance of NetworkACLCollection by calling from_dict on the json representation
- network_acl_collection_model_dict = NetworkACLCollection.from_dict(network_acl_collection_model_json).__dict__
- network_acl_collection_model2 = NetworkACLCollection(**network_acl_collection_model_dict)
-
- # Verify the model instances are equivalent
- assert network_acl_collection_model == network_acl_collection_model2
+ placement_group_collection_first_model = {} # PlacementGroupCollectionFirst
+ placement_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=50'
- # Convert model instance back to dict and verify no loss of data
- network_acl_collection_model_json2 = network_acl_collection_model.to_dict()
- assert network_acl_collection_model_json2 == network_acl_collection_model_json
+ placement_group_collection_next_model = {} # PlacementGroupCollectionNext
+ placement_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-class TestModel_NetworkACLCollectionFirst():
- """
- Test Class for NetworkACLCollectionFirst
- """
+ 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'
- def test_network_acl_collection_first_serialization(self):
- """
- Test serialization/deserialization for NetworkACLCollectionFirst
- """
+ placement_group_model = {} # PlacementGroup
+ placement_group_model['created_at'] = "2020-12-29T19:55:00Z"
+ placement_group_model['crn'] = 'crn:[...]'
+ placement_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ placement_group_model['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
+ placement_group_model['lifecycle_state'] = 'stable'
+ placement_group_model['name'] = 'my-updated-placement-group'
+ placement_group_model['resource_group'] = resource_group_reference_model
+ placement_group_model['resource_type'] = 'placement_group'
+ placement_group_model['strategy'] = 'host_spread'
- # Construct a json representation of a NetworkACLCollectionFirst model
- network_acl_collection_first_model_json = {}
- network_acl_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?limit=20'
+ # Construct a json representation of a PlacementGroupCollection model
+ placement_group_collection_model_json = {}
+ placement_group_collection_model_json['first'] = placement_group_collection_first_model
+ placement_group_collection_model_json['limit'] = 20
+ placement_group_collection_model_json['next'] = placement_group_collection_next_model
+ placement_group_collection_model_json['placement_groups'] = [placement_group_model]
+ placement_group_collection_model_json['total_count'] = 132
- # Construct a model instance of NetworkACLCollectionFirst by calling from_dict on the json representation
- network_acl_collection_first_model = NetworkACLCollectionFirst.from_dict(network_acl_collection_first_model_json)
- assert network_acl_collection_first_model != False
+ # Construct a model instance of PlacementGroupCollection by calling from_dict on the json representation
+ placement_group_collection_model = PlacementGroupCollection.from_dict(placement_group_collection_model_json)
+ assert placement_group_collection_model != False
- # Construct a model instance of NetworkACLCollectionFirst by calling from_dict on the json representation
- network_acl_collection_first_model_dict = NetworkACLCollectionFirst.from_dict(network_acl_collection_first_model_json).__dict__
- network_acl_collection_first_model2 = NetworkACLCollectionFirst(**network_acl_collection_first_model_dict)
+ # Construct a model instance of PlacementGroupCollection by calling from_dict on the json representation
+ placement_group_collection_model_dict = PlacementGroupCollection.from_dict(placement_group_collection_model_json).__dict__
+ placement_group_collection_model2 = PlacementGroupCollection(**placement_group_collection_model_dict)
# Verify the model instances are equivalent
- assert network_acl_collection_first_model == network_acl_collection_first_model2
+ assert placement_group_collection_model == placement_group_collection_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_collection_first_model_json2 = network_acl_collection_first_model.to_dict()
- assert network_acl_collection_first_model_json2 == network_acl_collection_first_model_json
+ placement_group_collection_model_json2 = placement_group_collection_model.to_dict()
+ assert placement_group_collection_model_json2 == placement_group_collection_model_json
-class TestModel_NetworkACLCollectionNext():
+class TestModel_PlacementGroupCollectionFirst():
"""
- Test Class for NetworkACLCollectionNext
+ Test Class for PlacementGroupCollectionFirst
"""
- def test_network_acl_collection_next_serialization(self):
+ def test_placement_group_collection_first_serialization(self):
"""
- Test serialization/deserialization for NetworkACLCollectionNext
+ Test serialization/deserialization for PlacementGroupCollectionFirst
"""
- # Construct a json representation of a NetworkACLCollectionNext model
- network_acl_collection_next_model_json = {}
- network_acl_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a PlacementGroupCollectionFirst model
+ placement_group_collection_first_model_json = {}
+ placement_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=20'
- # Construct a model instance of NetworkACLCollectionNext by calling from_dict on the json representation
- network_acl_collection_next_model = NetworkACLCollectionNext.from_dict(network_acl_collection_next_model_json)
- assert network_acl_collection_next_model != False
+ # Construct a model instance of PlacementGroupCollectionFirst by calling from_dict on the json representation
+ placement_group_collection_first_model = PlacementGroupCollectionFirst.from_dict(placement_group_collection_first_model_json)
+ assert placement_group_collection_first_model != False
- # Construct a model instance of NetworkACLCollectionNext by calling from_dict on the json representation
- network_acl_collection_next_model_dict = NetworkACLCollectionNext.from_dict(network_acl_collection_next_model_json).__dict__
- network_acl_collection_next_model2 = NetworkACLCollectionNext(**network_acl_collection_next_model_dict)
+ # Construct a model instance of PlacementGroupCollectionFirst by calling from_dict on the json representation
+ placement_group_collection_first_model_dict = PlacementGroupCollectionFirst.from_dict(placement_group_collection_first_model_json).__dict__
+ placement_group_collection_first_model2 = PlacementGroupCollectionFirst(**placement_group_collection_first_model_dict)
# Verify the model instances are equivalent
- assert network_acl_collection_next_model == network_acl_collection_next_model2
+ assert placement_group_collection_first_model == placement_group_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_collection_next_model_json2 = network_acl_collection_next_model.to_dict()
- assert network_acl_collection_next_model_json2 == network_acl_collection_next_model_json
+ placement_group_collection_first_model_json2 = placement_group_collection_first_model.to_dict()
+ assert placement_group_collection_first_model_json2 == placement_group_collection_first_model_json
-class TestModel_NetworkACLPatch():
+class TestModel_PlacementGroupCollectionNext():
"""
- Test Class for NetworkACLPatch
+ Test Class for PlacementGroupCollectionNext
"""
- def test_network_acl_patch_serialization(self):
+ def test_placement_group_collection_next_serialization(self):
"""
- Test serialization/deserialization for NetworkACLPatch
+ Test serialization/deserialization for PlacementGroupCollectionNext
"""
- # Construct a json representation of a NetworkACLPatch model
- network_acl_patch_model_json = {}
- network_acl_patch_model_json['name'] = 'my-network-acl'
+ # Construct a json representation of a PlacementGroupCollectionNext model
+ placement_group_collection_next_model_json = {}
+ placement_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation
- network_acl_patch_model = NetworkACLPatch.from_dict(network_acl_patch_model_json)
- assert network_acl_patch_model != False
+ # Construct a model instance of PlacementGroupCollectionNext by calling from_dict on the json representation
+ placement_group_collection_next_model = PlacementGroupCollectionNext.from_dict(placement_group_collection_next_model_json)
+ assert placement_group_collection_next_model != False
- # Construct a model instance of NetworkACLPatch by calling from_dict on the json representation
- network_acl_patch_model_dict = NetworkACLPatch.from_dict(network_acl_patch_model_json).__dict__
- network_acl_patch_model2 = NetworkACLPatch(**network_acl_patch_model_dict)
+ # Construct a model instance of PlacementGroupCollectionNext by calling from_dict on the json representation
+ placement_group_collection_next_model_dict = PlacementGroupCollectionNext.from_dict(placement_group_collection_next_model_json).__dict__
+ placement_group_collection_next_model2 = PlacementGroupCollectionNext(**placement_group_collection_next_model_dict)
# Verify the model instances are equivalent
- assert network_acl_patch_model == network_acl_patch_model2
+ assert placement_group_collection_next_model == placement_group_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_patch_model_json2 = network_acl_patch_model.to_dict()
- assert network_acl_patch_model_json2 == network_acl_patch_model_json
+ placement_group_collection_next_model_json2 = placement_group_collection_next_model.to_dict()
+ assert placement_group_collection_next_model_json2 == placement_group_collection_next_model_json
-class TestModel_NetworkACLReference():
+class TestModel_PlacementGroupPatch():
"""
- Test Class for NetworkACLReference
+ Test Class for PlacementGroupPatch
"""
- def test_network_acl_reference_serialization(self):
+ def test_placement_group_patch_serialization(self):
"""
- Test serialization/deserialization for NetworkACLReference
+ Test serialization/deserialization for PlacementGroupPatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
- network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a NetworkACLReference model
- network_acl_reference_model_json = {}
- network_acl_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model_json['deleted'] = network_acl_reference_deleted_model
- network_acl_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model_json['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model_json['name'] = 'my-network-acl'
+ # Construct a json representation of a PlacementGroupPatch model
+ placement_group_patch_model_json = {}
+ placement_group_patch_model_json['name'] = 'my-placement-group'
- # Construct a model instance of NetworkACLReference by calling from_dict on the json representation
- network_acl_reference_model = NetworkACLReference.from_dict(network_acl_reference_model_json)
- assert network_acl_reference_model != False
+ # Construct a model instance of PlacementGroupPatch by calling from_dict on the json representation
+ placement_group_patch_model = PlacementGroupPatch.from_dict(placement_group_patch_model_json)
+ assert placement_group_patch_model != False
- # Construct a model instance of NetworkACLReference by calling from_dict on the json representation
- network_acl_reference_model_dict = NetworkACLReference.from_dict(network_acl_reference_model_json).__dict__
- network_acl_reference_model2 = NetworkACLReference(**network_acl_reference_model_dict)
+ # Construct a model instance of PlacementGroupPatch by calling from_dict on the json representation
+ placement_group_patch_model_dict = PlacementGroupPatch.from_dict(placement_group_patch_model_json).__dict__
+ placement_group_patch_model2 = PlacementGroupPatch(**placement_group_patch_model_dict)
# Verify the model instances are equivalent
- assert network_acl_reference_model == network_acl_reference_model2
+ assert placement_group_patch_model == placement_group_patch_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_reference_model_json2 = network_acl_reference_model.to_dict()
- assert network_acl_reference_model_json2 == network_acl_reference_model_json
+ placement_group_patch_model_json2 = placement_group_patch_model.to_dict()
+ assert placement_group_patch_model_json2 == placement_group_patch_model_json
-class TestModel_NetworkACLReferenceDeleted():
+class TestModel_PlacementGroupReferenceDeleted():
"""
- Test Class for NetworkACLReferenceDeleted
+ Test Class for PlacementGroupReferenceDeleted
"""
- def test_network_acl_reference_deleted_serialization(self):
+ def test_placement_group_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for NetworkACLReferenceDeleted
+ Test serialization/deserialization for PlacementGroupReferenceDeleted
"""
- # Construct a json representation of a NetworkACLReferenceDeleted model
- network_acl_reference_deleted_model_json = {}
- network_acl_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a PlacementGroupReferenceDeleted model
+ placement_group_reference_deleted_model_json = {}
+ placement_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of NetworkACLReferenceDeleted by calling from_dict on the json representation
- network_acl_reference_deleted_model = NetworkACLReferenceDeleted.from_dict(network_acl_reference_deleted_model_json)
- assert network_acl_reference_deleted_model != False
+ # Construct a model instance of PlacementGroupReferenceDeleted by calling from_dict on the json representation
+ placement_group_reference_deleted_model = PlacementGroupReferenceDeleted.from_dict(placement_group_reference_deleted_model_json)
+ assert placement_group_reference_deleted_model != False
- # Construct a model instance of NetworkACLReferenceDeleted by calling from_dict on the json representation
- network_acl_reference_deleted_model_dict = NetworkACLReferenceDeleted.from_dict(network_acl_reference_deleted_model_json).__dict__
- network_acl_reference_deleted_model2 = NetworkACLReferenceDeleted(**network_acl_reference_deleted_model_dict)
+ # Construct a model instance of PlacementGroupReferenceDeleted by calling from_dict on the json representation
+ placement_group_reference_deleted_model_dict = PlacementGroupReferenceDeleted.from_dict(placement_group_reference_deleted_model_json).__dict__
+ placement_group_reference_deleted_model2 = PlacementGroupReferenceDeleted(**placement_group_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert network_acl_reference_deleted_model == network_acl_reference_deleted_model2
+ assert placement_group_reference_deleted_model == placement_group_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_reference_deleted_model_json2 = network_acl_reference_deleted_model.to_dict()
- assert network_acl_reference_deleted_model_json2 == network_acl_reference_deleted_model_json
+ placement_group_reference_deleted_model_json2 = placement_group_reference_deleted_model.to_dict()
+ assert placement_group_reference_deleted_model_json2 == placement_group_reference_deleted_model_json
-class TestModel_NetworkACLRuleCollection():
+class TestModel_PublicGateway():
"""
- Test Class for NetworkACLRuleCollection
+ Test Class for PublicGateway
"""
- def test_network_acl_rule_collection_serialization(self):
+ def test_public_gateway_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleCollection
+ Test serialization/deserialization for PublicGateway
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_acl_rule_collection_first_model = {} # NetworkACLRuleCollectionFirst
- network_acl_rule_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20'
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- network_acl_rule_collection_next_model = {} # NetworkACLRuleCollectionNext
- network_acl_rule_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp
+ public_gateway_floating_ip_model['address'] = '203.0.113.1'
+ public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ public_gateway_floating_ip_model['deleted'] = floating_ip_reference_deleted_model
+ public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ public_gateway_floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ public_gateway_floating_ip_model['name'] = 'my-floating-ip'
- network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
- network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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'
- network_acl_rule_reference_model = {} # NetworkACLRuleReference
- network_acl_rule_reference_model['deleted'] = network_acl_rule_reference_deleted_model
- network_acl_rule_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model['name'] = 'my-rule-1'
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- network_acl_rule_item_model = {} # NetworkACLRuleItemNetworkACLRuleProtocolICMP
- network_acl_rule_item_model['action'] = 'allow'
- network_acl_rule_item_model['before'] = network_acl_rule_reference_model
- network_acl_rule_item_model['created_at'] = "2019-01-01T12:00:00Z"
- network_acl_rule_item_model['destination'] = '192.168.3.0/24'
- network_acl_rule_item_model['direction'] = 'inbound'
- network_acl_rule_item_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_item_model['ip_version'] = 'ipv4'
- network_acl_rule_item_model['name'] = 'my-rule-2'
- network_acl_rule_item_model['source'] = '192.168.3.0/24'
- network_acl_rule_item_model['code'] = 0
- network_acl_rule_item_model['protocol'] = 'icmp'
- network_acl_rule_item_model['type'] = 8
+ 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'
- # Construct a json representation of a NetworkACLRuleCollection model
- network_acl_rule_collection_model_json = {}
- network_acl_rule_collection_model_json['first'] = network_acl_rule_collection_first_model
- network_acl_rule_collection_model_json['limit'] = 20
- network_acl_rule_collection_model_json['next'] = network_acl_rule_collection_next_model
- network_acl_rule_collection_model_json['rules'] = [network_acl_rule_item_model]
- network_acl_rule_collection_model_json['total_count'] = 132
+ 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 model instance of NetworkACLRuleCollection by calling from_dict on the json representation
- network_acl_rule_collection_model = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json)
- assert network_acl_rule_collection_model != False
+ # Construct a json representation of a PublicGateway model
+ public_gateway_model_json = {}
+ public_gateway_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ public_gateway_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_model_json['floating_ip'] = public_gateway_floating_ip_model
+ public_gateway_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_model_json['name'] = 'my-public-gateway'
+ public_gateway_model_json['resource_group'] = resource_group_reference_model
+ public_gateway_model_json['resource_type'] = 'public_gateway'
+ public_gateway_model_json['status'] = 'available'
+ public_gateway_model_json['vpc'] = vpc_reference_model
+ public_gateway_model_json['zone'] = zone_reference_model
- # Construct a model instance of NetworkACLRuleCollection by calling from_dict on the json representation
- network_acl_rule_collection_model_dict = NetworkACLRuleCollection.from_dict(network_acl_rule_collection_model_json).__dict__
- network_acl_rule_collection_model2 = NetworkACLRuleCollection(**network_acl_rule_collection_model_dict)
+ # Construct a model instance of PublicGateway by calling from_dict on the json representation
+ public_gateway_model = PublicGateway.from_dict(public_gateway_model_json)
+ assert public_gateway_model != False
+
+ # Construct a model instance of PublicGateway by calling from_dict on the json representation
+ public_gateway_model_dict = PublicGateway.from_dict(public_gateway_model_json).__dict__
+ public_gateway_model2 = PublicGateway(**public_gateway_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_collection_model == network_acl_rule_collection_model2
+ assert public_gateway_model == public_gateway_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_collection_model_json2 = network_acl_rule_collection_model.to_dict()
- assert network_acl_rule_collection_model_json2 == network_acl_rule_collection_model_json
+ public_gateway_model_json2 = public_gateway_model.to_dict()
+ assert public_gateway_model_json2 == public_gateway_model_json
-class TestModel_NetworkACLRuleCollectionFirst():
+class TestModel_PublicGatewayCollection():
"""
- Test Class for NetworkACLRuleCollectionFirst
+ Test Class for PublicGatewayCollection
"""
- def test_network_acl_rule_collection_first_serialization(self):
+ def test_public_gateway_collection_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleCollectionFirst
+ Test serialization/deserialization for PublicGatewayCollection
"""
- # Construct a json representation of a NetworkACLRuleCollectionFirst model
- network_acl_rule_collection_first_model_json = {}
- network_acl_rule_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of NetworkACLRuleCollectionFirst by calling from_dict on the json representation
- network_acl_rule_collection_first_model = NetworkACLRuleCollectionFirst.from_dict(network_acl_rule_collection_first_model_json)
- assert network_acl_rule_collection_first_model != False
+ public_gateway_collection_first_model = {} # PublicGatewayCollectionFirst
+ public_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20'
- # Construct a model instance of NetworkACLRuleCollectionFirst by calling from_dict on the json representation
- network_acl_rule_collection_first_model_dict = NetworkACLRuleCollectionFirst.from_dict(network_acl_rule_collection_first_model_json).__dict__
- network_acl_rule_collection_first_model2 = NetworkACLRuleCollectionFirst(**network_acl_rule_collection_first_model_dict)
+ public_gateway_collection_next_model = {} # PublicGatewayCollectionNext
+ public_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp
+ public_gateway_floating_ip_model['address'] = '203.0.113.1'
+ public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ public_gateway_floating_ip_model['deleted'] = floating_ip_reference_deleted_model
+ public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ public_gateway_floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ public_gateway_floating_ip_model['name'] = 'my-floating-ip'
+
+ 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'
+
+ 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'
+
+ 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'
+
+ public_gateway_model = {} # PublicGateway
+ public_gateway_model['created_at'] = "2019-01-01T12:00:00Z"
+ public_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_model['floating_ip'] = public_gateway_floating_ip_model
+ public_gateway_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_model['name'] = 'my-public-gateway'
+ public_gateway_model['resource_group'] = resource_group_reference_model
+ public_gateway_model['resource_type'] = 'public_gateway'
+ public_gateway_model['status'] = 'available'
+ public_gateway_model['vpc'] = vpc_reference_model
+ public_gateway_model['zone'] = zone_reference_model
+
+ # Construct a json representation of a PublicGatewayCollection model
+ public_gateway_collection_model_json = {}
+ public_gateway_collection_model_json['first'] = public_gateway_collection_first_model
+ public_gateway_collection_model_json['limit'] = 20
+ public_gateway_collection_model_json['next'] = public_gateway_collection_next_model
+ public_gateway_collection_model_json['public_gateways'] = [public_gateway_model]
+ public_gateway_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of PublicGatewayCollection by calling from_dict on the json representation
+ public_gateway_collection_model = PublicGatewayCollection.from_dict(public_gateway_collection_model_json)
+ assert public_gateway_collection_model != False
+
+ # Construct a model instance of PublicGatewayCollection by calling from_dict on the json representation
+ public_gateway_collection_model_dict = PublicGatewayCollection.from_dict(public_gateway_collection_model_json).__dict__
+ public_gateway_collection_model2 = PublicGatewayCollection(**public_gateway_collection_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_collection_first_model == network_acl_rule_collection_first_model2
+ assert public_gateway_collection_model == public_gateway_collection_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_collection_first_model_json2 = network_acl_rule_collection_first_model.to_dict()
- assert network_acl_rule_collection_first_model_json2 == network_acl_rule_collection_first_model_json
+ public_gateway_collection_model_json2 = public_gateway_collection_model.to_dict()
+ assert public_gateway_collection_model_json2 == public_gateway_collection_model_json
-class TestModel_NetworkACLRuleCollectionNext():
+class TestModel_PublicGatewayCollectionFirst():
"""
- Test Class for NetworkACLRuleCollectionNext
+ Test Class for PublicGatewayCollectionFirst
"""
- def test_network_acl_rule_collection_next_serialization(self):
+ def test_public_gateway_collection_first_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleCollectionNext
+ Test serialization/deserialization for PublicGatewayCollectionFirst
"""
- # Construct a json representation of a NetworkACLRuleCollectionNext model
- network_acl_rule_collection_next_model_json = {}
- network_acl_rule_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a PublicGatewayCollectionFirst model
+ public_gateway_collection_first_model_json = {}
+ public_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20'
- # Construct a model instance of NetworkACLRuleCollectionNext by calling from_dict on the json representation
- network_acl_rule_collection_next_model = NetworkACLRuleCollectionNext.from_dict(network_acl_rule_collection_next_model_json)
- assert network_acl_rule_collection_next_model != False
+ # Construct a model instance of PublicGatewayCollectionFirst by calling from_dict on the json representation
+ public_gateway_collection_first_model = PublicGatewayCollectionFirst.from_dict(public_gateway_collection_first_model_json)
+ assert public_gateway_collection_first_model != False
- # Construct a model instance of NetworkACLRuleCollectionNext by calling from_dict on the json representation
- network_acl_rule_collection_next_model_dict = NetworkACLRuleCollectionNext.from_dict(network_acl_rule_collection_next_model_json).__dict__
- network_acl_rule_collection_next_model2 = NetworkACLRuleCollectionNext(**network_acl_rule_collection_next_model_dict)
+ # Construct a model instance of PublicGatewayCollectionFirst by calling from_dict on the json representation
+ public_gateway_collection_first_model_dict = PublicGatewayCollectionFirst.from_dict(public_gateway_collection_first_model_json).__dict__
+ public_gateway_collection_first_model2 = PublicGatewayCollectionFirst(**public_gateway_collection_first_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_collection_next_model == network_acl_rule_collection_next_model2
+ assert public_gateway_collection_first_model == public_gateway_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_collection_next_model_json2 = network_acl_rule_collection_next_model.to_dict()
- assert network_acl_rule_collection_next_model_json2 == network_acl_rule_collection_next_model_json
+ public_gateway_collection_first_model_json2 = public_gateway_collection_first_model.to_dict()
+ assert public_gateway_collection_first_model_json2 == public_gateway_collection_first_model_json
-class TestModel_NetworkACLRulePatch():
+class TestModel_PublicGatewayCollectionNext():
"""
- Test Class for NetworkACLRulePatch
+ Test Class for PublicGatewayCollectionNext
"""
- def test_network_acl_rule_patch_serialization(self):
+ def test_public_gateway_collection_next_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRulePatch
+ Test serialization/deserialization for PublicGatewayCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- network_acl_rule_before_patch_model = {} # NetworkACLRuleBeforePatchNetworkACLRuleIdentityById
- network_acl_rule_before_patch_model['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
-
- # Construct a json representation of a NetworkACLRulePatch model
- network_acl_rule_patch_model_json = {}
- network_acl_rule_patch_model_json['action'] = 'allow'
- network_acl_rule_patch_model_json['before'] = network_acl_rule_before_patch_model
- network_acl_rule_patch_model_json['code'] = 0
- network_acl_rule_patch_model_json['destination'] = '192.168.3.2/32'
- network_acl_rule_patch_model_json['destination_port_max'] = 22
- network_acl_rule_patch_model_json['destination_port_min'] = 22
- network_acl_rule_patch_model_json['direction'] = 'inbound'
- network_acl_rule_patch_model_json['name'] = 'my-rule-2'
- network_acl_rule_patch_model_json['source'] = '192.168.3.2/32'
- network_acl_rule_patch_model_json['source_port_max'] = 65535
- network_acl_rule_patch_model_json['source_port_min'] = 49152
- network_acl_rule_patch_model_json['type'] = 8
+ # Construct a json representation of a PublicGatewayCollectionNext model
+ public_gateway_collection_next_model_json = {}
+ public_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of NetworkACLRulePatch by calling from_dict on the json representation
- network_acl_rule_patch_model = NetworkACLRulePatch.from_dict(network_acl_rule_patch_model_json)
- assert network_acl_rule_patch_model != False
+ # Construct a model instance of PublicGatewayCollectionNext by calling from_dict on the json representation
+ public_gateway_collection_next_model = PublicGatewayCollectionNext.from_dict(public_gateway_collection_next_model_json)
+ assert public_gateway_collection_next_model != False
- # Construct a model instance of NetworkACLRulePatch by calling from_dict on the json representation
- network_acl_rule_patch_model_dict = NetworkACLRulePatch.from_dict(network_acl_rule_patch_model_json).__dict__
- network_acl_rule_patch_model2 = NetworkACLRulePatch(**network_acl_rule_patch_model_dict)
+ # Construct a model instance of PublicGatewayCollectionNext by calling from_dict on the json representation
+ public_gateway_collection_next_model_dict = PublicGatewayCollectionNext.from_dict(public_gateway_collection_next_model_json).__dict__
+ public_gateway_collection_next_model2 = PublicGatewayCollectionNext(**public_gateway_collection_next_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_patch_model == network_acl_rule_patch_model2
+ assert public_gateway_collection_next_model == public_gateway_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_patch_model_json2 = network_acl_rule_patch_model.to_dict()
- assert network_acl_rule_patch_model_json2 == network_acl_rule_patch_model_json
+ public_gateway_collection_next_model_json2 = public_gateway_collection_next_model.to_dict()
+ assert public_gateway_collection_next_model_json2 == public_gateway_collection_next_model_json
-class TestModel_NetworkACLRuleReference():
+class TestModel_PublicGatewayFloatingIp():
"""
- Test Class for NetworkACLRuleReference
+ Test Class for PublicGatewayFloatingIp
"""
- def test_network_acl_rule_reference_serialization(self):
+ def test_public_gateway_floating_ip_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleReference
+ Test serialization/deserialization for PublicGatewayFloatingIp
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_acl_rule_reference_deleted_model = {} # NetworkACLRuleReferenceDeleted
- network_acl_rule_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a NetworkACLRuleReference model
- network_acl_rule_reference_model_json = {}
- network_acl_rule_reference_model_json['deleted'] = network_acl_rule_reference_deleted_model
- network_acl_rule_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf/rules/8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model_json['id'] = '8daca77a-4980-4d33-8f3e-7038797be8f9'
- network_acl_rule_reference_model_json['name'] = 'my-rule-1'
+ # Construct a json representation of a PublicGatewayFloatingIp model
+ public_gateway_floating_ip_model_json = {}
+ public_gateway_floating_ip_model_json['address'] = '203.0.113.1'
+ public_gateway_floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ public_gateway_floating_ip_model_json['deleted'] = floating_ip_reference_deleted_model
+ public_gateway_floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ public_gateway_floating_ip_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ public_gateway_floating_ip_model_json['name'] = 'my-floating-ip'
- # Construct a model instance of NetworkACLRuleReference by calling from_dict on the json representation
- network_acl_rule_reference_model = NetworkACLRuleReference.from_dict(network_acl_rule_reference_model_json)
- assert network_acl_rule_reference_model != False
+ # Construct a model instance of PublicGatewayFloatingIp by calling from_dict on the json representation
+ public_gateway_floating_ip_model = PublicGatewayFloatingIp.from_dict(public_gateway_floating_ip_model_json)
+ assert public_gateway_floating_ip_model != False
- # Construct a model instance of NetworkACLRuleReference by calling from_dict on the json representation
- network_acl_rule_reference_model_dict = NetworkACLRuleReference.from_dict(network_acl_rule_reference_model_json).__dict__
- network_acl_rule_reference_model2 = NetworkACLRuleReference(**network_acl_rule_reference_model_dict)
+ # Construct a model instance of PublicGatewayFloatingIp by calling from_dict on the json representation
+ public_gateway_floating_ip_model_dict = PublicGatewayFloatingIp.from_dict(public_gateway_floating_ip_model_json).__dict__
+ public_gateway_floating_ip_model2 = PublicGatewayFloatingIp(**public_gateway_floating_ip_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_reference_model == network_acl_rule_reference_model2
+ assert public_gateway_floating_ip_model == public_gateway_floating_ip_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_reference_model_json2 = network_acl_rule_reference_model.to_dict()
- assert network_acl_rule_reference_model_json2 == network_acl_rule_reference_model_json
+ public_gateway_floating_ip_model_json2 = public_gateway_floating_ip_model.to_dict()
+ assert public_gateway_floating_ip_model_json2 == public_gateway_floating_ip_model_json
-class TestModel_NetworkACLRuleReferenceDeleted():
+class TestModel_PublicGatewayPatch():
"""
- Test Class for NetworkACLRuleReferenceDeleted
+ Test Class for PublicGatewayPatch
"""
- def test_network_acl_rule_reference_deleted_serialization(self):
+ def test_public_gateway_patch_serialization(self):
"""
- Test serialization/deserialization for NetworkACLRuleReferenceDeleted
+ Test serialization/deserialization for PublicGatewayPatch
"""
- # Construct a json representation of a NetworkACLRuleReferenceDeleted model
- network_acl_rule_reference_deleted_model_json = {}
- network_acl_rule_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a PublicGatewayPatch model
+ public_gateway_patch_model_json = {}
+ public_gateway_patch_model_json['name'] = 'my-public-gateway'
- # Construct a model instance of NetworkACLRuleReferenceDeleted by calling from_dict on the json representation
- network_acl_rule_reference_deleted_model = NetworkACLRuleReferenceDeleted.from_dict(network_acl_rule_reference_deleted_model_json)
- assert network_acl_rule_reference_deleted_model != False
+ # Construct a model instance of PublicGatewayPatch by calling from_dict on the json representation
+ public_gateway_patch_model = PublicGatewayPatch.from_dict(public_gateway_patch_model_json)
+ assert public_gateway_patch_model != False
- # Construct a model instance of NetworkACLRuleReferenceDeleted by calling from_dict on the json representation
- network_acl_rule_reference_deleted_model_dict = NetworkACLRuleReferenceDeleted.from_dict(network_acl_rule_reference_deleted_model_json).__dict__
- network_acl_rule_reference_deleted_model2 = NetworkACLRuleReferenceDeleted(**network_acl_rule_reference_deleted_model_dict)
+ # Construct a model instance of PublicGatewayPatch by calling from_dict on the json representation
+ public_gateway_patch_model_dict = PublicGatewayPatch.from_dict(public_gateway_patch_model_json).__dict__
+ public_gateway_patch_model2 = PublicGatewayPatch(**public_gateway_patch_model_dict)
# Verify the model instances are equivalent
- assert network_acl_rule_reference_deleted_model == network_acl_rule_reference_deleted_model2
+ assert public_gateway_patch_model == public_gateway_patch_model2
# Convert model instance back to dict and verify no loss of data
- network_acl_rule_reference_deleted_model_json2 = network_acl_rule_reference_deleted_model.to_dict()
- assert network_acl_rule_reference_deleted_model_json2 == network_acl_rule_reference_deleted_model_json
+ public_gateway_patch_model_json2 = public_gateway_patch_model.to_dict()
+ assert public_gateway_patch_model_json2 == public_gateway_patch_model_json
-class TestModel_NetworkInterface():
+class TestModel_PublicGatewayReference():
"""
- Test Class for NetworkInterface
+ Test Class for PublicGatewayReference
"""
- def test_network_interface_serialization(self):
+ def test_public_gateway_reference_serialization(self):
"""
- Test serialization/deserialization for NetworkInterface
+ Test serialization/deserialization for PublicGatewayReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted
+ public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- floating_ip_reference_model = {} # FloatingIPReference
- floating_ip_reference_model['address'] = '192.0.2.2'
- floating_ip_reference_model['crn'] = 'crn:[...]'
- floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
- floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/181b8670-52bf-47af-a5ca-7aff7f3824d1'
- floating_ip_reference_model['id'] = '181b8670-52bf-47af-a5ca-7aff7f3824d1'
- floating_ip_reference_model['name'] = 'my-floating-ip'
+ # Construct a json representation of a PublicGatewayReference model
+ public_gateway_reference_model_json = {}
+ public_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_reference_model_json['deleted'] = public_gateway_reference_deleted_model
+ public_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_reference_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_reference_model_json['name'] = 'my-public-gateway'
+ public_gateway_reference_model_json['resource_type'] = 'public_gateway'
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of PublicGatewayReference by calling from_dict on the json representation
+ public_gateway_reference_model = PublicGatewayReference.from_dict(public_gateway_reference_model_json)
+ assert public_gateway_reference_model != False
- 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'] = 'before-entrance-mountain-paralegal-photo-uninstall'
+ # Construct a model instance of PublicGatewayReference by calling from_dict on the json representation
+ public_gateway_reference_model_dict = PublicGatewayReference.from_dict(public_gateway_reference_model_json).__dict__
+ public_gateway_reference_model2 = PublicGatewayReference(**public_gateway_reference_model_dict)
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert public_gateway_reference_model == public_gateway_reference_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ public_gateway_reference_model_json2 = public_gateway_reference_model.to_dict()
+ assert public_gateway_reference_model_json2 == public_gateway_reference_model_json
- # Construct a json representation of a NetworkInterface model
- network_interface_model_json = {}
- network_interface_model_json['allow_ip_spoofing'] = True
- network_interface_model_json['created_at'] = "2019-01-01T12:00:00Z"
- network_interface_model_json['floating_ips'] = [floating_ip_reference_model]
- network_interface_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/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['port_speed'] = 1000
- network_interface_model_json['primary_ipv4_address'] = '192.168.3.4'
- network_interface_model_json['resource_type'] = 'network_interface'
- network_interface_model_json['security_groups'] = [security_group_reference_model]
- network_interface_model_json['status'] = 'available'
- network_interface_model_json['subnet'] = subnet_reference_model
- network_interface_model_json['type'] = 'primary'
+class TestModel_PublicGatewayReferenceDeleted():
+ """
+ Test Class for PublicGatewayReferenceDeleted
+ """
- # Construct a model instance of NetworkInterface by calling from_dict on the json representation
- network_interface_model = NetworkInterface.from_dict(network_interface_model_json)
- assert network_interface_model != False
+ def test_public_gateway_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for PublicGatewayReferenceDeleted
+ """
- # Construct a model instance of NetworkInterface by calling from_dict on the json representation
- network_interface_model_dict = NetworkInterface.from_dict(network_interface_model_json).__dict__
- network_interface_model2 = NetworkInterface(**network_interface_model_dict)
+ # Construct a json representation of a PublicGatewayReferenceDeleted model
+ public_gateway_reference_deleted_model_json = {}
+ public_gateway_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a model instance of PublicGatewayReferenceDeleted by calling from_dict on the json representation
+ public_gateway_reference_deleted_model = PublicGatewayReferenceDeleted.from_dict(public_gateway_reference_deleted_model_json)
+ assert public_gateway_reference_deleted_model != False
+
+ # Construct a model instance of PublicGatewayReferenceDeleted by calling from_dict on the json representation
+ public_gateway_reference_deleted_model_dict = PublicGatewayReferenceDeleted.from_dict(public_gateway_reference_deleted_model_json).__dict__
+ public_gateway_reference_deleted_model2 = PublicGatewayReferenceDeleted(**public_gateway_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert network_interface_model == network_interface_model2
+ assert public_gateway_reference_deleted_model == public_gateway_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_model_json2 = network_interface_model.to_dict()
- assert network_interface_model_json2 == network_interface_model_json
+ public_gateway_reference_deleted_model_json2 = public_gateway_reference_deleted_model.to_dict()
+ assert public_gateway_reference_deleted_model_json2 == public_gateway_reference_deleted_model_json
-class TestModel_NetworkInterfaceCollection():
+class TestModel_Region():
"""
- Test Class for NetworkInterfaceCollection
+ Test Class for Region
"""
- def test_network_interface_collection_serialization(self):
+ def test_region_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceCollection
+ Test serialization/deserialization for Region
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- network_interface_collection_first_model = {} # NetworkInterfaceCollectionFirst
- network_interface_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20'
+ # Construct a json representation of a Region model
+ region_model_json = {}
+ region_model_json['endpoint'] = 'testString'
+ region_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
+ region_model_json['name'] = 'us-south'
+ region_model_json['status'] = 'available'
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of Region by calling from_dict on the json representation
+ region_model = Region.from_dict(region_model_json)
+ assert region_model != False
- floating_ip_reference_model = {} # FloatingIPReference
- floating_ip_reference_model['address'] = '203.0.113.1'
- floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
- floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- floating_ip_reference_model['name'] = 'my-floating-ip'
+ # Construct a model instance of Region by calling from_dict on the json representation
+ region_model_dict = Region.from_dict(region_model_json).__dict__
+ region_model2 = Region(**region_model_dict)
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert region_model == region_model2
- security_group_reference_model = {} # SecurityGroupReference
- security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['deleted'] = security_group_reference_deleted_model
- security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['name'] = 'my-security-group'
+ # Convert model instance back to dict and verify no loss of data
+ region_model_json2 = region_model.to_dict()
+ assert region_model_json2 == region_model_json
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_RegionCollection():
+ """
+ Test Class for RegionCollection
+ """
- 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'
+ def test_region_collection_serialization(self):
+ """
+ Test serialization/deserialization for RegionCollection
+ """
- network_interface_model = {} # NetworkInterface
- network_interface_model['allow_ip_spoofing'] = True
- network_interface_model['created_at'] = "2019-01-01T12:00:00Z"
- network_interface_model['floating_ips'] = [floating_ip_reference_model]
- network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- network_interface_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- network_interface_model['name'] = 'my-network-interface'
- network_interface_model['port_speed'] = 1000
- network_interface_model['primary_ipv4_address'] = '192.168.3.4'
- network_interface_model['resource_type'] = 'network_interface'
- network_interface_model['security_groups'] = [security_group_reference_model]
- network_interface_model['status'] = 'available'
- network_interface_model['subnet'] = subnet_reference_model
- network_interface_model['type'] = 'primary'
+ # Construct dict forms of any model objects needed in order to build this model.
- network_interface_collection_next_model = {} # NetworkInterfaceCollectionNext
- network_interface_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
+ region_model = {} # Region
+ region_model['endpoint'] = 'testString'
+ region_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
+ region_model['name'] = 'us-south'
+ region_model['status'] = 'available'
- # Construct a json representation of a NetworkInterfaceCollection model
- network_interface_collection_model_json = {}
- network_interface_collection_model_json['first'] = network_interface_collection_first_model
- network_interface_collection_model_json['limit'] = 20
- network_interface_collection_model_json['network_interfaces'] = [network_interface_model]
- network_interface_collection_model_json['next'] = network_interface_collection_next_model
- network_interface_collection_model_json['total_count'] = 132
+ # Construct a json representation of a RegionCollection model
+ region_collection_model_json = {}
+ region_collection_model_json['regions'] = [region_model]
- # Construct a model instance of NetworkInterfaceCollection by calling from_dict on the json representation
- network_interface_collection_model = NetworkInterfaceCollection.from_dict(network_interface_collection_model_json)
- assert network_interface_collection_model != False
+ # Construct a model instance of RegionCollection by calling from_dict on the json representation
+ region_collection_model = RegionCollection.from_dict(region_collection_model_json)
+ assert region_collection_model != False
- # Construct a model instance of NetworkInterfaceCollection by calling from_dict on the json representation
- network_interface_collection_model_dict = NetworkInterfaceCollection.from_dict(network_interface_collection_model_json).__dict__
- network_interface_collection_model2 = NetworkInterfaceCollection(**network_interface_collection_model_dict)
+ # Construct a model instance of RegionCollection by calling from_dict on the json representation
+ region_collection_model_dict = RegionCollection.from_dict(region_collection_model_json).__dict__
+ region_collection_model2 = RegionCollection(**region_collection_model_dict)
# Verify the model instances are equivalent
- assert network_interface_collection_model == network_interface_collection_model2
+ assert region_collection_model == region_collection_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_collection_model_json2 = network_interface_collection_model.to_dict()
- assert network_interface_collection_model_json2 == network_interface_collection_model_json
+ region_collection_model_json2 = region_collection_model.to_dict()
+ assert region_collection_model_json2 == region_collection_model_json
-class TestModel_NetworkInterfaceCollectionFirst():
+class TestModel_RegionReference():
"""
- Test Class for NetworkInterfaceCollectionFirst
+ Test Class for RegionReference
"""
- def test_network_interface_collection_first_serialization(self):
+ def test_region_reference_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceCollectionFirst
+ Test serialization/deserialization for RegionReference
"""
- # Construct a json representation of a NetworkInterfaceCollectionFirst model
- network_interface_collection_first_model_json = {}
- network_interface_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?limit=20'
+ # Construct a json representation of a RegionReference model
+ region_reference_model_json = {}
+ region_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
+ region_reference_model_json['name'] = 'us-south'
- # Construct a model instance of NetworkInterfaceCollectionFirst by calling from_dict on the json representation
- network_interface_collection_first_model = NetworkInterfaceCollectionFirst.from_dict(network_interface_collection_first_model_json)
- assert network_interface_collection_first_model != False
+ # Construct a model instance of RegionReference by calling from_dict on the json representation
+ region_reference_model = RegionReference.from_dict(region_reference_model_json)
+ assert region_reference_model != False
- # Construct a model instance of NetworkInterfaceCollectionFirst by calling from_dict on the json representation
- network_interface_collection_first_model_dict = NetworkInterfaceCollectionFirst.from_dict(network_interface_collection_first_model_json).__dict__
- network_interface_collection_first_model2 = NetworkInterfaceCollectionFirst(**network_interface_collection_first_model_dict)
+ # Construct a model instance of RegionReference by calling from_dict on the json representation
+ region_reference_model_dict = RegionReference.from_dict(region_reference_model_json).__dict__
+ region_reference_model2 = RegionReference(**region_reference_model_dict)
# Verify the model instances are equivalent
- assert network_interface_collection_first_model == network_interface_collection_first_model2
+ assert region_reference_model == region_reference_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_collection_first_model_json2 = network_interface_collection_first_model.to_dict()
- assert network_interface_collection_first_model_json2 == network_interface_collection_first_model_json
+ region_reference_model_json2 = region_reference_model.to_dict()
+ assert region_reference_model_json2 == region_reference_model_json
-class TestModel_NetworkInterfaceCollectionNext():
+class TestModel_ReservedIP():
"""
- Test Class for NetworkInterfaceCollectionNext
+ Test Class for ReservedIP
"""
- def test_network_interface_collection_next_serialization(self):
+ def test_reserved_ip_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceCollectionNext
+ Test serialization/deserialization for ReservedIP
"""
- # Construct a json representation of a NetworkInterfaceCollectionNext model
- network_interface_collection_next_model_json = {}
- network_interface_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/3b2669a2-4c2b-4003-bc91-1b81f1326267/network_interfaces?start=d3e721fd-c988-4670-9927-dbd5e7b07fc6&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of NetworkInterfaceCollectionNext by calling from_dict on the json representation
- network_interface_collection_next_model = NetworkInterfaceCollectionNext.from_dict(network_interface_collection_next_model_json)
- assert network_interface_collection_next_model != False
+ endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
+ endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of NetworkInterfaceCollectionNext by calling from_dict on the json representation
- network_interface_collection_next_model_dict = NetworkInterfaceCollectionNext.from_dict(network_interface_collection_next_model_json).__dict__
- network_interface_collection_next_model2 = NetworkInterfaceCollectionNext(**network_interface_collection_next_model_dict)
+ reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
+ reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
+ reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['name'] = 'my-endpoint-gateway'
+ reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
+
+ # Construct a json representation of a ReservedIP model
+ reserved_ip_model_json = {}
+ reserved_ip_model_json['address'] = '192.168.3.4'
+ reserved_ip_model_json['auto_delete'] = False
+ reserved_ip_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ reserved_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model_json['name'] = 'my-reserved-ip'
+ reserved_ip_model_json['owner'] = 'user'
+ reserved_ip_model_json['resource_type'] = 'subnet_reserved_ip'
+ reserved_ip_model_json['target'] = reserved_ip_target_model
+
+ # Construct a model instance of ReservedIP by calling from_dict on the json representation
+ reserved_ip_model = ReservedIP.from_dict(reserved_ip_model_json)
+ assert reserved_ip_model != False
+
+ # Construct a model instance of ReservedIP by calling from_dict on the json representation
+ reserved_ip_model_dict = ReservedIP.from_dict(reserved_ip_model_json).__dict__
+ reserved_ip_model2 = ReservedIP(**reserved_ip_model_dict)
# Verify the model instances are equivalent
- assert network_interface_collection_next_model == network_interface_collection_next_model2
+ assert reserved_ip_model == reserved_ip_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_collection_next_model_json2 = network_interface_collection_next_model.to_dict()
- assert network_interface_collection_next_model_json2 == network_interface_collection_next_model_json
+ reserved_ip_model_json2 = reserved_ip_model.to_dict()
+ assert reserved_ip_model_json2 == reserved_ip_model_json
-class TestModel_NetworkInterfaceInstanceContextReference():
+class TestModel_ReservedIPCollection():
"""
- Test Class for NetworkInterfaceInstanceContextReference
+ Test Class for ReservedIPCollection
"""
- def test_network_interface_instance_context_reference_serialization(self):
+ def test_reserved_ip_collection_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceInstanceContextReference
+ Test serialization/deserialization for ReservedIPCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_interface_instance_context_reference_deleted_model = {} # NetworkInterfaceInstanceContextReferenceDeleted
- network_interface_instance_context_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ reserved_ip_collection_first_model = {} # ReservedIPCollectionFirst
+ reserved_ip_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20'
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ reserved_ip_collection_next_model = {} # ReservedIPCollectionNext
+ reserved_ip_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- 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'
+ endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
+ endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a NetworkInterfaceInstanceContextReference model
- network_interface_instance_context_reference_model_json = {}
- 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['primary_ipv4_address'] = '192.168.3.4'
- network_interface_instance_context_reference_model_json['resource_type'] = 'network_interface'
- network_interface_instance_context_reference_model_json['subnet'] = subnet_reference_model
+ reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
+ reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
+ reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['name'] = 'my-endpoint-gateway'
+ reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
- # Construct a model instance of NetworkInterfaceInstanceContextReference by calling from_dict on the json representation
- network_interface_instance_context_reference_model = NetworkInterfaceInstanceContextReference.from_dict(network_interface_instance_context_reference_model_json)
- assert network_interface_instance_context_reference_model != False
+ 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['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
- # Construct a model instance of NetworkInterfaceInstanceContextReference by calling from_dict on the json representation
- network_interface_instance_context_reference_model_dict = NetworkInterfaceInstanceContextReference.from_dict(network_interface_instance_context_reference_model_json).__dict__
- network_interface_instance_context_reference_model2 = NetworkInterfaceInstanceContextReference(**network_interface_instance_context_reference_model_dict)
+ # Construct a json representation of a ReservedIPCollection model
+ reserved_ip_collection_model_json = {}
+ reserved_ip_collection_model_json['first'] = reserved_ip_collection_first_model
+ reserved_ip_collection_model_json['limit'] = 20
+ reserved_ip_collection_model_json['next'] = reserved_ip_collection_next_model
+ reserved_ip_collection_model_json['reserved_ips'] = [reserved_ip_model]
+ reserved_ip_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of ReservedIPCollection by calling from_dict on the json representation
+ reserved_ip_collection_model = ReservedIPCollection.from_dict(reserved_ip_collection_model_json)
+ assert reserved_ip_collection_model != False
+
+ # Construct a model instance of ReservedIPCollection by calling from_dict on the json representation
+ reserved_ip_collection_model_dict = ReservedIPCollection.from_dict(reserved_ip_collection_model_json).__dict__
+ reserved_ip_collection_model2 = ReservedIPCollection(**reserved_ip_collection_model_dict)
# Verify the model instances are equivalent
- assert network_interface_instance_context_reference_model == network_interface_instance_context_reference_model2
+ assert reserved_ip_collection_model == reserved_ip_collection_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_instance_context_reference_model_json2 = network_interface_instance_context_reference_model.to_dict()
- assert network_interface_instance_context_reference_model_json2 == network_interface_instance_context_reference_model_json
+ reserved_ip_collection_model_json2 = reserved_ip_collection_model.to_dict()
+ assert reserved_ip_collection_model_json2 == reserved_ip_collection_model_json
-class TestModel_NetworkInterfaceInstanceContextReferenceDeleted():
+class TestModel_ReservedIPCollectionEndpointGatewayContext():
"""
- Test Class for NetworkInterfaceInstanceContextReferenceDeleted
+ Test Class for ReservedIPCollectionEndpointGatewayContext
"""
- def test_network_interface_instance_context_reference_deleted_serialization(self):
+ def test_reserved_ip_collection_endpoint_gateway_context_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceInstanceContextReferenceDeleted
+ Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContext
"""
- # Construct a json representation of a NetworkInterfaceInstanceContextReferenceDeleted model
- network_interface_instance_context_reference_deleted_model_json = {}
- network_interface_instance_context_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of NetworkInterfaceInstanceContextReferenceDeleted by calling from_dict on the json representation
- network_interface_instance_context_reference_deleted_model = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(network_interface_instance_context_reference_deleted_model_json)
- assert network_interface_instance_context_reference_deleted_model != False
+ reserved_ip_collection_endpoint_gateway_context_first_model = {} # ReservedIPCollectionEndpointGatewayContextFirst
+ reserved_ip_collection_endpoint_gateway_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20'
- # Construct a model instance of NetworkInterfaceInstanceContextReferenceDeleted by calling from_dict on the json representation
- network_interface_instance_context_reference_deleted_model_dict = NetworkInterfaceInstanceContextReferenceDeleted.from_dict(network_interface_instance_context_reference_deleted_model_json).__dict__
- network_interface_instance_context_reference_deleted_model2 = NetworkInterfaceInstanceContextReferenceDeleted(**network_interface_instance_context_reference_deleted_model_dict)
+ endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
+ endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
+ reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
+ reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ reserved_ip_target_model['name'] = 'my-endpoint-gateway'
+ reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
+
+ reserved_ip_model = {} # ReservedIP
+ reserved_ip_model['address'] = '192.168.3.4'
+ reserved_ip_model['auto_delete'] = False
+ reserved_ip_model['created_at'] = "2019-01-01T12:00:00Z"
+ reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_model['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_endpoint_gateway_context_next_model = {} # ReservedIPCollectionEndpointGatewayContextNext
+ reserved_ip_collection_endpoint_gateway_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20'
+
+ # Construct a json representation of a ReservedIPCollectionEndpointGatewayContext model
+ reserved_ip_collection_endpoint_gateway_context_model_json = {}
+ reserved_ip_collection_endpoint_gateway_context_model_json['first'] = reserved_ip_collection_endpoint_gateway_context_first_model
+ reserved_ip_collection_endpoint_gateway_context_model_json['ips'] = [reserved_ip_model]
+ reserved_ip_collection_endpoint_gateway_context_model_json['limit'] = 20
+ reserved_ip_collection_endpoint_gateway_context_model_json['next'] = reserved_ip_collection_endpoint_gateway_context_next_model
+ reserved_ip_collection_endpoint_gateway_context_model_json['total_count'] = 132
+
+ # Construct a model instance of ReservedIPCollectionEndpointGatewayContext by calling from_dict on the json representation
+ reserved_ip_collection_endpoint_gateway_context_model = ReservedIPCollectionEndpointGatewayContext.from_dict(reserved_ip_collection_endpoint_gateway_context_model_json)
+ assert reserved_ip_collection_endpoint_gateway_context_model != False
+
+ # Construct a model instance of ReservedIPCollectionEndpointGatewayContext by calling from_dict on the json representation
+ reserved_ip_collection_endpoint_gateway_context_model_dict = ReservedIPCollectionEndpointGatewayContext.from_dict(reserved_ip_collection_endpoint_gateway_context_model_json).__dict__
+ reserved_ip_collection_endpoint_gateway_context_model2 = ReservedIPCollectionEndpointGatewayContext(**reserved_ip_collection_endpoint_gateway_context_model_dict)
# Verify the model instances are equivalent
- assert network_interface_instance_context_reference_deleted_model == network_interface_instance_context_reference_deleted_model2
+ assert reserved_ip_collection_endpoint_gateway_context_model == reserved_ip_collection_endpoint_gateway_context_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_instance_context_reference_deleted_model_json2 = network_interface_instance_context_reference_deleted_model.to_dict()
- assert network_interface_instance_context_reference_deleted_model_json2 == network_interface_instance_context_reference_deleted_model_json
+ reserved_ip_collection_endpoint_gateway_context_model_json2 = reserved_ip_collection_endpoint_gateway_context_model.to_dict()
+ assert reserved_ip_collection_endpoint_gateway_context_model_json2 == reserved_ip_collection_endpoint_gateway_context_model_json
-class TestModel_NetworkInterfacePatch():
+class TestModel_ReservedIPCollectionEndpointGatewayContextFirst():
"""
- Test Class for NetworkInterfacePatch
+ Test Class for ReservedIPCollectionEndpointGatewayContextFirst
"""
- def test_network_interface_patch_serialization(self):
+ def test_reserved_ip_collection_endpoint_gateway_context_first_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfacePatch
+ Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextFirst
"""
- # 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'
+ # Construct a json representation of a ReservedIPCollectionEndpointGatewayContextFirst model
+ reserved_ip_collection_endpoint_gateway_context_first_model_json = {}
+ reserved_ip_collection_endpoint_gateway_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20'
- # Construct a model instance of NetworkInterfacePatch by calling from_dict on the json representation
- network_interface_patch_model = NetworkInterfacePatch.from_dict(network_interface_patch_model_json)
- assert network_interface_patch_model != False
+ # Construct a model instance of ReservedIPCollectionEndpointGatewayContextFirst by calling from_dict on the json representation
+ reserved_ip_collection_endpoint_gateway_context_first_model = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(reserved_ip_collection_endpoint_gateway_context_first_model_json)
+ assert reserved_ip_collection_endpoint_gateway_context_first_model != False
- # Construct a model instance of NetworkInterfacePatch by calling from_dict on the json representation
- network_interface_patch_model_dict = NetworkInterfacePatch.from_dict(network_interface_patch_model_json).__dict__
- network_interface_patch_model2 = NetworkInterfacePatch(**network_interface_patch_model_dict)
+ # Construct a model instance of ReservedIPCollectionEndpointGatewayContextFirst by calling from_dict on the json representation
+ reserved_ip_collection_endpoint_gateway_context_first_model_dict = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(reserved_ip_collection_endpoint_gateway_context_first_model_json).__dict__
+ reserved_ip_collection_endpoint_gateway_context_first_model2 = ReservedIPCollectionEndpointGatewayContextFirst(**reserved_ip_collection_endpoint_gateway_context_first_model_dict)
# Verify the model instances are equivalent
- assert network_interface_patch_model == network_interface_patch_model2
+ assert reserved_ip_collection_endpoint_gateway_context_first_model == reserved_ip_collection_endpoint_gateway_context_first_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_patch_model_json2 = network_interface_patch_model.to_dict()
- assert network_interface_patch_model_json2 == network_interface_patch_model_json
+ reserved_ip_collection_endpoint_gateway_context_first_model_json2 = reserved_ip_collection_endpoint_gateway_context_first_model.to_dict()
+ assert reserved_ip_collection_endpoint_gateway_context_first_model_json2 == reserved_ip_collection_endpoint_gateway_context_first_model_json
-class TestModel_NetworkInterfacePrototype():
+class TestModel_ReservedIPCollectionEndpointGatewayContextNext():
"""
- Test Class for NetworkInterfacePrototype
+ Test Class for ReservedIPCollectionEndpointGatewayContextNext
"""
- def test_network_interface_prototype_serialization(self):
+ def test_reserved_ip_collection_endpoint_gateway_context_next_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfacePrototype
+ Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- security_group_identity_model = {} # SecurityGroupIdentityById
- security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
-
- subnet_identity_model = {} # SubnetIdentityById
- subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
-
- # Construct a json representation of a 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['primary_ipv4_address'] = '10.0.0.5'
- network_interface_prototype_model_json['security_groups'] = [security_group_identity_model]
- network_interface_prototype_model_json['subnet'] = subnet_identity_model
+ # Construct a json representation of a ReservedIPCollectionEndpointGatewayContextNext model
+ reserved_ip_collection_endpoint_gateway_context_next_model_json = {}
+ reserved_ip_collection_endpoint_gateway_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20'
- # Construct a model instance of NetworkInterfacePrototype by calling from_dict on the json representation
- network_interface_prototype_model = NetworkInterfacePrototype.from_dict(network_interface_prototype_model_json)
- assert network_interface_prototype_model != False
+ # Construct a model instance of ReservedIPCollectionEndpointGatewayContextNext by calling from_dict on the json representation
+ reserved_ip_collection_endpoint_gateway_context_next_model = ReservedIPCollectionEndpointGatewayContextNext.from_dict(reserved_ip_collection_endpoint_gateway_context_next_model_json)
+ assert reserved_ip_collection_endpoint_gateway_context_next_model != False
- # Construct a model instance of NetworkInterfacePrototype by calling from_dict on the json representation
- network_interface_prototype_model_dict = NetworkInterfacePrototype.from_dict(network_interface_prototype_model_json).__dict__
- network_interface_prototype_model2 = NetworkInterfacePrototype(**network_interface_prototype_model_dict)
+ # Construct a model instance of ReservedIPCollectionEndpointGatewayContextNext by calling from_dict on the json representation
+ reserved_ip_collection_endpoint_gateway_context_next_model_dict = ReservedIPCollectionEndpointGatewayContextNext.from_dict(reserved_ip_collection_endpoint_gateway_context_next_model_json).__dict__
+ reserved_ip_collection_endpoint_gateway_context_next_model2 = ReservedIPCollectionEndpointGatewayContextNext(**reserved_ip_collection_endpoint_gateway_context_next_model_dict)
# Verify the model instances are equivalent
- assert network_interface_prototype_model == network_interface_prototype_model2
+ assert reserved_ip_collection_endpoint_gateway_context_next_model == reserved_ip_collection_endpoint_gateway_context_next_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_prototype_model_json2 = network_interface_prototype_model.to_dict()
- assert network_interface_prototype_model_json2 == network_interface_prototype_model_json
+ reserved_ip_collection_endpoint_gateway_context_next_model_json2 = reserved_ip_collection_endpoint_gateway_context_next_model.to_dict()
+ assert reserved_ip_collection_endpoint_gateway_context_next_model_json2 == reserved_ip_collection_endpoint_gateway_context_next_model_json
-class TestModel_NetworkInterfaceReference():
+class TestModel_ReservedIPCollectionFirst():
"""
- Test Class for NetworkInterfaceReference
+ Test Class for ReservedIPCollectionFirst
"""
- def test_network_interface_reference_serialization(self):
+ def test_reserved_ip_collection_first_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceReference
+ Test serialization/deserialization for ReservedIPCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
- network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a NetworkInterfaceReference model
- network_interface_reference_model_json = {}
- network_interface_reference_model_json['deleted'] = network_interface_reference_deleted_model
- network_interface_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- network_interface_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- network_interface_reference_model_json['name'] = 'my-network-interface'
- network_interface_reference_model_json['primary_ipv4_address'] = '192.168.3.4'
- network_interface_reference_model_json['resource_type'] = 'network_interface'
+ # Construct a json representation of a ReservedIPCollectionFirst model
+ reserved_ip_collection_first_model_json = {}
+ reserved_ip_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20'
- # Construct a model instance of NetworkInterfaceReference by calling from_dict on the json representation
- network_interface_reference_model = NetworkInterfaceReference.from_dict(network_interface_reference_model_json)
- assert network_interface_reference_model != False
+ # Construct a model instance of ReservedIPCollectionFirst by calling from_dict on the json representation
+ reserved_ip_collection_first_model = ReservedIPCollectionFirst.from_dict(reserved_ip_collection_first_model_json)
+ assert reserved_ip_collection_first_model != False
- # Construct a model instance of NetworkInterfaceReference by calling from_dict on the json representation
- network_interface_reference_model_dict = NetworkInterfaceReference.from_dict(network_interface_reference_model_json).__dict__
- network_interface_reference_model2 = NetworkInterfaceReference(**network_interface_reference_model_dict)
+ # Construct a model instance of ReservedIPCollectionFirst by calling from_dict on the json representation
+ reserved_ip_collection_first_model_dict = ReservedIPCollectionFirst.from_dict(reserved_ip_collection_first_model_json).__dict__
+ reserved_ip_collection_first_model2 = ReservedIPCollectionFirst(**reserved_ip_collection_first_model_dict)
# Verify the model instances are equivalent
- assert network_interface_reference_model == network_interface_reference_model2
+ assert reserved_ip_collection_first_model == reserved_ip_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_reference_model_json2 = network_interface_reference_model.to_dict()
- assert network_interface_reference_model_json2 == network_interface_reference_model_json
+ reserved_ip_collection_first_model_json2 = reserved_ip_collection_first_model.to_dict()
+ assert reserved_ip_collection_first_model_json2 == reserved_ip_collection_first_model_json
-class TestModel_NetworkInterfaceReferenceDeleted():
+class TestModel_ReservedIPCollectionNext():
"""
- Test Class for NetworkInterfaceReferenceDeleted
+ Test Class for ReservedIPCollectionNext
"""
- def test_network_interface_reference_deleted_serialization(self):
+ def test_reserved_ip_collection_next_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceReferenceDeleted
+ Test serialization/deserialization for ReservedIPCollectionNext
"""
- # Construct a json representation of a NetworkInterfaceReferenceDeleted model
- network_interface_reference_deleted_model_json = {}
- network_interface_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a model instance of NetworkInterfaceReferenceDeleted by calling from_dict on the json representation
- network_interface_reference_deleted_model = NetworkInterfaceReferenceDeleted.from_dict(network_interface_reference_deleted_model_json)
- assert network_interface_reference_deleted_model != False
+ # Construct a json representation of a ReservedIPCollectionNext model
+ reserved_ip_collection_next_model_json = {}
+ reserved_ip_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of NetworkInterfaceReferenceDeleted by calling from_dict on the json representation
- network_interface_reference_deleted_model_dict = NetworkInterfaceReferenceDeleted.from_dict(network_interface_reference_deleted_model_json).__dict__
- network_interface_reference_deleted_model2 = NetworkInterfaceReferenceDeleted(**network_interface_reference_deleted_model_dict)
+ # Construct a model instance of ReservedIPCollectionNext by calling from_dict on the json representation
+ reserved_ip_collection_next_model = ReservedIPCollectionNext.from_dict(reserved_ip_collection_next_model_json)
+ assert reserved_ip_collection_next_model != False
+
+ # Construct a model instance of ReservedIPCollectionNext by calling from_dict on the json representation
+ reserved_ip_collection_next_model_dict = ReservedIPCollectionNext.from_dict(reserved_ip_collection_next_model_json).__dict__
+ reserved_ip_collection_next_model2 = ReservedIPCollectionNext(**reserved_ip_collection_next_model_dict)
# Verify the model instances are equivalent
- assert network_interface_reference_deleted_model == network_interface_reference_deleted_model2
+ assert reserved_ip_collection_next_model == reserved_ip_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_reference_deleted_model_json2 = network_interface_reference_deleted_model.to_dict()
- assert network_interface_reference_deleted_model_json2 == network_interface_reference_deleted_model_json
+ reserved_ip_collection_next_model_json2 = reserved_ip_collection_next_model.to_dict()
+ assert reserved_ip_collection_next_model_json2 == reserved_ip_collection_next_model_json
-class TestModel_NetworkInterfaceReferenceTargetContextDeleted():
+class TestModel_ReservedIPPatch():
"""
- Test Class for NetworkInterfaceReferenceTargetContextDeleted
+ Test Class for ReservedIPPatch
"""
- def test_network_interface_reference_target_context_deleted_serialization(self):
+ def test_reserved_ip_patch_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceReferenceTargetContextDeleted
+ Test serialization/deserialization for ReservedIPPatch
"""
- # Construct a json representation of a NetworkInterfaceReferenceTargetContextDeleted model
- network_interface_reference_target_context_deleted_model_json = {}
- network_interface_reference_target_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a ReservedIPPatch model
+ reserved_ip_patch_model_json = {}
+ reserved_ip_patch_model_json['auto_delete'] = False
+ reserved_ip_patch_model_json['name'] = 'my-reserved-ip'
- # Construct a model instance of NetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation
- network_interface_reference_target_context_deleted_model = NetworkInterfaceReferenceTargetContextDeleted.from_dict(network_interface_reference_target_context_deleted_model_json)
- assert network_interface_reference_target_context_deleted_model != False
+ # Construct a model instance of ReservedIPPatch by calling from_dict on the json representation
+ reserved_ip_patch_model = ReservedIPPatch.from_dict(reserved_ip_patch_model_json)
+ assert reserved_ip_patch_model != False
- # Construct a model instance of NetworkInterfaceReferenceTargetContextDeleted by calling from_dict on the json representation
- network_interface_reference_target_context_deleted_model_dict = NetworkInterfaceReferenceTargetContextDeleted.from_dict(network_interface_reference_target_context_deleted_model_json).__dict__
- network_interface_reference_target_context_deleted_model2 = NetworkInterfaceReferenceTargetContextDeleted(**network_interface_reference_target_context_deleted_model_dict)
+ # Construct a model instance of ReservedIPPatch by calling from_dict on the json representation
+ reserved_ip_patch_model_dict = ReservedIPPatch.from_dict(reserved_ip_patch_model_json).__dict__
+ reserved_ip_patch_model2 = ReservedIPPatch(**reserved_ip_patch_model_dict)
# Verify the model instances are equivalent
- assert network_interface_reference_target_context_deleted_model == network_interface_reference_target_context_deleted_model2
+ assert reserved_ip_patch_model == reserved_ip_patch_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_reference_target_context_deleted_model_json2 = network_interface_reference_target_context_deleted_model.to_dict()
- assert network_interface_reference_target_context_deleted_model_json2 == network_interface_reference_target_context_deleted_model_json
+ reserved_ip_patch_model_json2 = reserved_ip_patch_model.to_dict()
+ assert reserved_ip_patch_model_json2 == reserved_ip_patch_model_json
-class TestModel_NetworkInterfaceUnpaginatedCollection():
+class TestModel_ReservedIPReference():
"""
- Test Class for NetworkInterfaceUnpaginatedCollection
+ Test Class for ReservedIPReference
"""
- def test_network_interface_unpaginated_collection_serialization(self):
+ def test_reserved_ip_reference_serialization(self):
"""
- Test serialization/deserialization for NetworkInterfaceUnpaginatedCollection
+ Test serialization/deserialization for ReservedIPReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
+ reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- floating_ip_reference_model = {} # FloatingIPReference
- floating_ip_reference_model['address'] = '192.0.2.2'
- floating_ip_reference_model['crn'] = 'crn:[...]'
- floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
- floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/181b8670-52bf-47af-a5ca-7aff7f3824d1'
- floating_ip_reference_model['id'] = '181b8670-52bf-47af-a5ca-7aff7f3824d1'
- floating_ip_reference_model['name'] = 'my-floating-ip'
+ # Construct a json representation of a ReservedIPReference model
+ reserved_ip_reference_model_json = {}
+ reserved_ip_reference_model_json['address'] = '192.168.3.4'
+ reserved_ip_reference_model_json['deleted'] = reserved_ip_reference_deleted_model
+ reserved_ip_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
+ reserved_ip_reference_model_json['name'] = 'my-reserved-ip'
+ reserved_ip_reference_model_json['resource_type'] = 'subnet_reserved_ip'
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of ReservedIPReference by calling from_dict on the json representation
+ reserved_ip_reference_model = ReservedIPReference.from_dict(reserved_ip_reference_model_json)
+ assert reserved_ip_reference_model != False
- 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'] = 'before-entrance-mountain-paralegal-photo-uninstall'
+ # Construct a model instance of ReservedIPReference by calling from_dict on the json representation
+ reserved_ip_reference_model_dict = ReservedIPReference.from_dict(reserved_ip_reference_model_json).__dict__
+ reserved_ip_reference_model2 = ReservedIPReference(**reserved_ip_reference_model_dict)
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert reserved_ip_reference_model == reserved_ip_reference_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ reserved_ip_reference_model_json2 = reserved_ip_reference_model.to_dict()
+ assert reserved_ip_reference_model_json2 == reserved_ip_reference_model_json
- network_interface_model = {} # NetworkInterface
- network_interface_model['allow_ip_spoofing'] = False
- network_interface_model['created_at'] = "2019-01-31T03:42:32.993000Z"
- network_interface_model['floating_ips'] = [floating_ip_reference_model]
- network_interface_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/123a490a-9e64-4254-a93b-9a3af3ede270/network_interfaces/35bd3f19-bdd4-434b-ad6a-5e9358d65e20'
- network_interface_model['id'] = '35bd3f19-bdd4-434b-ad6a-5e9358d65e20'
- network_interface_model['name'] = 'molecule-find-wild-name-dictionary-trench'
- network_interface_model['port_speed'] = 1000
- network_interface_model['primary_ipv4_address'] = '10.0.0.32'
- network_interface_model['resource_type'] = 'network_interface'
- network_interface_model['security_groups'] = [security_group_reference_model]
- network_interface_model['status'] = 'available'
- network_interface_model['subnet'] = subnet_reference_model
- network_interface_model['type'] = 'primary'
+class TestModel_ReservedIPReferenceDeleted():
+ """
+ Test Class for ReservedIPReferenceDeleted
+ """
- # Construct a json representation of a NetworkInterfaceUnpaginatedCollection model
- network_interface_unpaginated_collection_model_json = {}
- network_interface_unpaginated_collection_model_json['network_interfaces'] = [network_interface_model]
+ def test_reserved_ip_reference_deleted_serialization(self):
+ """
+ Test serialization/deserialization for ReservedIPReferenceDeleted
+ """
- # Construct a model instance of NetworkInterfaceUnpaginatedCollection by calling from_dict on the json representation
- network_interface_unpaginated_collection_model = NetworkInterfaceUnpaginatedCollection.from_dict(network_interface_unpaginated_collection_model_json)
- assert network_interface_unpaginated_collection_model != False
+ # Construct a json representation of a ReservedIPReferenceDeleted model
+ reserved_ip_reference_deleted_model_json = {}
+ reserved_ip_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of NetworkInterfaceUnpaginatedCollection by calling from_dict on the json representation
- network_interface_unpaginated_collection_model_dict = NetworkInterfaceUnpaginatedCollection.from_dict(network_interface_unpaginated_collection_model_json).__dict__
- network_interface_unpaginated_collection_model2 = NetworkInterfaceUnpaginatedCollection(**network_interface_unpaginated_collection_model_dict)
+ # Construct a model instance of ReservedIPReferenceDeleted by calling from_dict on the json representation
+ reserved_ip_reference_deleted_model = ReservedIPReferenceDeleted.from_dict(reserved_ip_reference_deleted_model_json)
+ assert reserved_ip_reference_deleted_model != False
+
+ # Construct a model instance of ReservedIPReferenceDeleted by calling from_dict on the json representation
+ reserved_ip_reference_deleted_model_dict = ReservedIPReferenceDeleted.from_dict(reserved_ip_reference_deleted_model_json).__dict__
+ reserved_ip_reference_deleted_model2 = ReservedIPReferenceDeleted(**reserved_ip_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert network_interface_unpaginated_collection_model == network_interface_unpaginated_collection_model2
+ assert reserved_ip_reference_deleted_model == reserved_ip_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- network_interface_unpaginated_collection_model_json2 = network_interface_unpaginated_collection_model.to_dict()
- assert network_interface_unpaginated_collection_model_json2 == network_interface_unpaginated_collection_model_json
+ reserved_ip_reference_deleted_model_json2 = reserved_ip_reference_deleted_model.to_dict()
+ assert reserved_ip_reference_deleted_model_json2 == reserved_ip_reference_deleted_model_json
-class TestModel_OperatingSystem():
+class TestModel_ResourceGroupReference():
"""
- Test Class for OperatingSystem
+ Test Class for ResourceGroupReference
"""
- def test_operating_system_serialization(self):
+ def test_resource_group_reference_serialization(self):
"""
- Test serialization/deserialization for OperatingSystem
+ Test serialization/deserialization for ResourceGroupReference
"""
- # Construct a json representation of a OperatingSystem model
- operating_system_model_json = {}
- operating_system_model_json['architecture'] = 'amd64'
- operating_system_model_json['dedicated_host_only'] = False
- operating_system_model_json['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
- operating_system_model_json['family'] = 'Ubuntu Server'
- operating_system_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- operating_system_model_json['name'] = 'ubuntu-16-amd64'
- operating_system_model_json['vendor'] = 'Canonical'
- operating_system_model_json['version'] = '16.04 LTS'
+ # Construct a json representation of a ResourceGroupReference model
+ resource_group_reference_model_json = {}
+ resource_group_reference_model_json['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model_json['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model_json['name'] = 'my-resource-group'
- # Construct a model instance of OperatingSystem by calling from_dict on the json representation
- operating_system_model = OperatingSystem.from_dict(operating_system_model_json)
- assert operating_system_model != False
+ # Construct a model instance of ResourceGroupReference by calling from_dict on the json representation
+ resource_group_reference_model = ResourceGroupReference.from_dict(resource_group_reference_model_json)
+ assert resource_group_reference_model != False
- # Construct a model instance of OperatingSystem by calling from_dict on the json representation
- operating_system_model_dict = OperatingSystem.from_dict(operating_system_model_json).__dict__
- operating_system_model2 = OperatingSystem(**operating_system_model_dict)
+ # Construct a model instance of ResourceGroupReference by calling from_dict on the json representation
+ resource_group_reference_model_dict = ResourceGroupReference.from_dict(resource_group_reference_model_json).__dict__
+ resource_group_reference_model2 = ResourceGroupReference(**resource_group_reference_model_dict)
# Verify the model instances are equivalent
- assert operating_system_model == operating_system_model2
+ assert resource_group_reference_model == resource_group_reference_model2
# Convert model instance back to dict and verify no loss of data
- operating_system_model_json2 = operating_system_model.to_dict()
- assert operating_system_model_json2 == operating_system_model_json
+ resource_group_reference_model_json2 = resource_group_reference_model.to_dict()
+ assert resource_group_reference_model_json2 == resource_group_reference_model_json
-class TestModel_OperatingSystemCollection():
+class TestModel_Route():
"""
- Test Class for OperatingSystemCollection
+ Test Class for Route
"""
- def test_operating_system_collection_serialization(self):
+ def test_route_serialization(self):
"""
- Test serialization/deserialization for OperatingSystemCollection
+ Test serialization/deserialization for Route
"""
# Construct dict forms of any model objects needed in order to build this model.
- operating_system_collection_first_model = {} # OperatingSystemCollectionFirst
- operating_system_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20'
-
- operating_system_collection_next_model = {} # OperatingSystemCollectionNext
- operating_system_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ route_next_hop_model = {} # RouteNextHopIP
+ route_next_hop_model['address'] = '192.168.3.4'
- operating_system_model = {} # OperatingSystem
- operating_system_model['architecture'] = 'amd64'
- operating_system_model['dedicated_host_only'] = False
- operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
- operating_system_model['family'] = 'Ubuntu Server'
- operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- operating_system_model['name'] = 'ubuntu-16-amd64'
- operating_system_model['vendor'] = 'Canonical'
- operating_system_model['version'] = '16.04 LTS'
+ 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 OperatingSystemCollection model
- operating_system_collection_model_json = {}
- operating_system_collection_model_json['first'] = operating_system_collection_first_model
- operating_system_collection_model_json['limit'] = 20
- operating_system_collection_model_json['next'] = operating_system_collection_next_model
- operating_system_collection_model_json['operating_systems'] = [operating_system_model]
+ # Construct a json representation of a Route model
+ route_model_json = {}
+ route_model_json['action'] = 'delegate'
+ route_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ route_model_json['destination'] = '192.168.3.0/24'
+ route_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_model_json['lifecycle_state'] = 'stable'
+ route_model_json['name'] = 'my-route-1'
+ route_model_json['next_hop'] = route_next_hop_model
+ route_model_json['zone'] = zone_reference_model
- # Construct a model instance of OperatingSystemCollection by calling from_dict on the json representation
- operating_system_collection_model = OperatingSystemCollection.from_dict(operating_system_collection_model_json)
- assert operating_system_collection_model != False
+ # Construct a model instance of Route by calling from_dict on the json representation
+ route_model = Route.from_dict(route_model_json)
+ assert route_model != False
- # Construct a model instance of OperatingSystemCollection by calling from_dict on the json representation
- operating_system_collection_model_dict = OperatingSystemCollection.from_dict(operating_system_collection_model_json).__dict__
- operating_system_collection_model2 = OperatingSystemCollection(**operating_system_collection_model_dict)
+ # Construct a model instance of Route by calling from_dict on the json representation
+ route_model_dict = Route.from_dict(route_model_json).__dict__
+ route_model2 = Route(**route_model_dict)
# Verify the model instances are equivalent
- assert operating_system_collection_model == operating_system_collection_model2
+ assert route_model == route_model2
# Convert model instance back to dict and verify no loss of data
- operating_system_collection_model_json2 = operating_system_collection_model.to_dict()
- assert operating_system_collection_model_json2 == operating_system_collection_model_json
+ route_model_json2 = route_model.to_dict()
+ assert route_model_json2 == route_model_json
-class TestModel_OperatingSystemCollectionFirst():
+class TestModel_RouteCollection():
"""
- Test Class for OperatingSystemCollectionFirst
+ Test Class for RouteCollection
"""
- def test_operating_system_collection_first_serialization(self):
+ def test_route_collection_serialization(self):
"""
- Test serialization/deserialization for OperatingSystemCollectionFirst
+ Test serialization/deserialization for RouteCollection
"""
- # Construct a json representation of a OperatingSystemCollectionFirst model
- operating_system_collection_first_model_json = {}
- operating_system_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?limit=20'
-
- # Construct a model instance of OperatingSystemCollectionFirst by calling from_dict on the json representation
- operating_system_collection_first_model = OperatingSystemCollectionFirst.from_dict(operating_system_collection_first_model_json)
- assert operating_system_collection_first_model != False
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of OperatingSystemCollectionFirst by calling from_dict on the json representation
- operating_system_collection_first_model_dict = OperatingSystemCollectionFirst.from_dict(operating_system_collection_first_model_json).__dict__
- operating_system_collection_first_model2 = OperatingSystemCollectionFirst(**operating_system_collection_first_model_dict)
+ route_collection_first_model = {} # RouteCollectionFirst
+ route_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20'
- # Verify the model instances are equivalent
- assert operating_system_collection_first_model == operating_system_collection_first_model2
+ route_collection_next_model = {} # RouteCollectionNext
+ route_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
- # Convert model instance back to dict and verify no loss of data
- operating_system_collection_first_model_json2 = operating_system_collection_first_model.to_dict()
- assert operating_system_collection_first_model_json2 == operating_system_collection_first_model_json
+ route_next_hop_model = {} # RouteNextHopIP
+ route_next_hop_model['address'] = '192.168.3.4'
-class TestModel_OperatingSystemCollectionNext():
- """
- Test Class for OperatingSystemCollectionNext
- """
+ 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'
- def test_operating_system_collection_next_serialization(self):
- """
- Test serialization/deserialization for OperatingSystemCollectionNext
- """
+ route_model = {} # Route
+ route_model['action'] = 'delegate'
+ route_model['created_at'] = "2019-01-01T12:00:00Z"
+ route_model['destination'] = '192.168.3.0/24'
+ route_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_model['lifecycle_state'] = 'stable'
+ route_model['name'] = 'my-route-1'
+ route_model['next_hop'] = route_next_hop_model
+ route_model['zone'] = zone_reference_model
- # Construct a json representation of a OperatingSystemCollectionNext model
- operating_system_collection_next_model_json = {}
- operating_system_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a RouteCollection model
+ route_collection_model_json = {}
+ route_collection_model_json['first'] = route_collection_first_model
+ route_collection_model_json['limit'] = 20
+ route_collection_model_json['next'] = route_collection_next_model
+ route_collection_model_json['routes'] = [route_model]
+ route_collection_model_json['total_count'] = 132
- # Construct a model instance of OperatingSystemCollectionNext by calling from_dict on the json representation
- operating_system_collection_next_model = OperatingSystemCollectionNext.from_dict(operating_system_collection_next_model_json)
- assert operating_system_collection_next_model != False
+ # Construct a model instance of RouteCollection by calling from_dict on the json representation
+ route_collection_model = RouteCollection.from_dict(route_collection_model_json)
+ assert route_collection_model != False
- # Construct a model instance of OperatingSystemCollectionNext by calling from_dict on the json representation
- operating_system_collection_next_model_dict = OperatingSystemCollectionNext.from_dict(operating_system_collection_next_model_json).__dict__
- operating_system_collection_next_model2 = OperatingSystemCollectionNext(**operating_system_collection_next_model_dict)
+ # Construct a model instance of RouteCollection by calling from_dict on the json representation
+ route_collection_model_dict = RouteCollection.from_dict(route_collection_model_json).__dict__
+ route_collection_model2 = RouteCollection(**route_collection_model_dict)
# Verify the model instances are equivalent
- assert operating_system_collection_next_model == operating_system_collection_next_model2
+ assert route_collection_model == route_collection_model2
# Convert model instance back to dict and verify no loss of data
- operating_system_collection_next_model_json2 = operating_system_collection_next_model.to_dict()
- assert operating_system_collection_next_model_json2 == operating_system_collection_next_model_json
+ route_collection_model_json2 = route_collection_model.to_dict()
+ assert route_collection_model_json2 == route_collection_model_json
-class TestModel_OperatingSystemReference():
+class TestModel_RouteCollectionFirst():
"""
- Test Class for OperatingSystemReference
+ Test Class for RouteCollectionFirst
"""
- def test_operating_system_reference_serialization(self):
+ def test_route_collection_first_serialization(self):
"""
- Test serialization/deserialization for OperatingSystemReference
+ Test serialization/deserialization for RouteCollectionFirst
"""
- # Construct a json representation of a OperatingSystemReference model
- operating_system_reference_model_json = {}
- operating_system_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- operating_system_reference_model_json['name'] = 'ubuntu-16-amd64'
+ # Construct a json representation of a RouteCollectionFirst model
+ route_collection_first_model_json = {}
+ route_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20'
- # Construct a model instance of OperatingSystemReference by calling from_dict on the json representation
- operating_system_reference_model = OperatingSystemReference.from_dict(operating_system_reference_model_json)
- assert operating_system_reference_model != False
+ # Construct a model instance of RouteCollectionFirst by calling from_dict on the json representation
+ route_collection_first_model = RouteCollectionFirst.from_dict(route_collection_first_model_json)
+ assert route_collection_first_model != False
- # Construct a model instance of OperatingSystemReference by calling from_dict on the json representation
- operating_system_reference_model_dict = OperatingSystemReference.from_dict(operating_system_reference_model_json).__dict__
- operating_system_reference_model2 = OperatingSystemReference(**operating_system_reference_model_dict)
+ # Construct a model instance of RouteCollectionFirst by calling from_dict on the json representation
+ route_collection_first_model_dict = RouteCollectionFirst.from_dict(route_collection_first_model_json).__dict__
+ route_collection_first_model2 = RouteCollectionFirst(**route_collection_first_model_dict)
# Verify the model instances are equivalent
- assert operating_system_reference_model == operating_system_reference_model2
+ assert route_collection_first_model == route_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- operating_system_reference_model_json2 = operating_system_reference_model.to_dict()
- assert operating_system_reference_model_json2 == operating_system_reference_model_json
+ route_collection_first_model_json2 = route_collection_first_model.to_dict()
+ assert route_collection_first_model_json2 == route_collection_first_model_json
-class TestModel_PlacementGroup():
+class TestModel_RouteCollectionNext():
"""
- Test Class for PlacementGroup
+ Test Class for RouteCollectionNext
"""
- def test_placement_group_serialization(self):
+ def test_route_collection_next_serialization(self):
"""
- Test serialization/deserialization for PlacementGroup
+ Test serialization/deserialization for RouteCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/4bbce614c13444cd8fc5e7e878ef8e21'
- resource_group_reference_model['id'] = '4bbce614c13444cd8fc5e7e878ef8e21'
- resource_group_reference_model['name'] = 'Default'
-
- # Construct a json representation of a PlacementGroup model
- placement_group_model_json = {}
- placement_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
- placement_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::placement-group:r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- placement_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- placement_group_model_json['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- placement_group_model_json['lifecycle_state'] = 'stable'
- placement_group_model_json['name'] = 'my-placement-group'
- placement_group_model_json['resource_group'] = resource_group_reference_model
- placement_group_model_json['resource_type'] = 'placement_group'
- placement_group_model_json['strategy'] = 'host_spread'
+ # Construct a json representation of a RouteCollectionNext model
+ route_collection_next_model_json = {}
+ route_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
- # Construct a model instance of PlacementGroup by calling from_dict on the json representation
- placement_group_model = PlacementGroup.from_dict(placement_group_model_json)
- assert placement_group_model != False
+ # Construct a model instance of RouteCollectionNext by calling from_dict on the json representation
+ route_collection_next_model = RouteCollectionNext.from_dict(route_collection_next_model_json)
+ assert route_collection_next_model != False
- # Construct a model instance of PlacementGroup by calling from_dict on the json representation
- placement_group_model_dict = PlacementGroup.from_dict(placement_group_model_json).__dict__
- placement_group_model2 = PlacementGroup(**placement_group_model_dict)
+ # Construct a model instance of RouteCollectionNext by calling from_dict on the json representation
+ route_collection_next_model_dict = RouteCollectionNext.from_dict(route_collection_next_model_json).__dict__
+ route_collection_next_model2 = RouteCollectionNext(**route_collection_next_model_dict)
# Verify the model instances are equivalent
- assert placement_group_model == placement_group_model2
+ assert route_collection_next_model == route_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- placement_group_model_json2 = placement_group_model.to_dict()
- assert placement_group_model_json2 == placement_group_model_json
+ route_collection_next_model_json2 = route_collection_next_model.to_dict()
+ assert route_collection_next_model_json2 == route_collection_next_model_json
-class TestModel_PlacementGroupCollection():
+class TestModel_RoutePatch():
"""
- Test Class for PlacementGroupCollection
+ Test Class for RoutePatch
"""
- def test_placement_group_collection_serialization(self):
+ def test_route_patch_serialization(self):
"""
- Test serialization/deserialization for PlacementGroupCollection
+ Test serialization/deserialization for RoutePatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- placement_group_collection_first_model = {} # PlacementGroupCollectionFirst
- placement_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=50'
-
- placement_group_collection_next_model = {} # PlacementGroupCollectionNext
- placement_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- 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'
-
- placement_group_model = {} # PlacementGroup
- placement_group_model['created_at'] = "2020-12-29T19:55:00Z"
- placement_group_model['crn'] = 'crn:[...]'
- placement_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups/r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- placement_group_model['id'] = 'r018-418fe842-a3e9-47b9-a938-1aa5bd632871'
- placement_group_model['lifecycle_state'] = 'stable'
- placement_group_model['name'] = 'my-updated-placement-group'
- placement_group_model['resource_group'] = resource_group_reference_model
- placement_group_model['resource_type'] = 'placement_group'
- placement_group_model['strategy'] = 'host_spread'
-
- # Construct a json representation of a PlacementGroupCollection model
- placement_group_collection_model_json = {}
- placement_group_collection_model_json['first'] = placement_group_collection_first_model
- placement_group_collection_model_json['limit'] = 20
- placement_group_collection_model_json['next'] = placement_group_collection_next_model
- placement_group_collection_model_json['placement_groups'] = [placement_group_model]
- placement_group_collection_model_json['total_count'] = 132
+ # Construct a json representation of a RoutePatch model
+ route_patch_model_json = {}
+ route_patch_model_json['name'] = 'my-route-2'
- # Construct a model instance of PlacementGroupCollection by calling from_dict on the json representation
- placement_group_collection_model = PlacementGroupCollection.from_dict(placement_group_collection_model_json)
- assert placement_group_collection_model != False
+ # Construct a model instance of RoutePatch by calling from_dict on the json representation
+ route_patch_model = RoutePatch.from_dict(route_patch_model_json)
+ assert route_patch_model != False
- # Construct a model instance of PlacementGroupCollection by calling from_dict on the json representation
- placement_group_collection_model_dict = PlacementGroupCollection.from_dict(placement_group_collection_model_json).__dict__
- placement_group_collection_model2 = PlacementGroupCollection(**placement_group_collection_model_dict)
+ # Construct a model instance of RoutePatch by calling from_dict on the json representation
+ route_patch_model_dict = RoutePatch.from_dict(route_patch_model_json).__dict__
+ route_patch_model2 = RoutePatch(**route_patch_model_dict)
# Verify the model instances are equivalent
- assert placement_group_collection_model == placement_group_collection_model2
+ assert route_patch_model == route_patch_model2
# Convert model instance back to dict and verify no loss of data
- placement_group_collection_model_json2 = placement_group_collection_model.to_dict()
- assert placement_group_collection_model_json2 == placement_group_collection_model_json
+ route_patch_model_json2 = route_patch_model.to_dict()
+ assert route_patch_model_json2 == route_patch_model_json
-class TestModel_PlacementGroupCollectionFirst():
+class TestModel_RoutePrototype():
"""
- Test Class for PlacementGroupCollectionFirst
+ Test Class for RoutePrototype
"""
- def test_placement_group_collection_first_serialization(self):
+ def test_route_prototype_serialization(self):
"""
- Test serialization/deserialization for PlacementGroupCollectionFirst
+ Test serialization/deserialization for RoutePrototype
"""
- # Construct a json representation of a PlacementGroupCollectionFirst model
- placement_group_collection_first_model_json = {}
- placement_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of PlacementGroupCollectionFirst by calling from_dict on the json representation
- placement_group_collection_first_model = PlacementGroupCollectionFirst.from_dict(placement_group_collection_first_model_json)
- assert placement_group_collection_first_model != False
+ route_next_hop_prototype_model = {} # RouteNextHopPrototypeRouteNextHopIP
+ route_next_hop_prototype_model['address'] = '192.168.3.4'
- # Construct a model instance of PlacementGroupCollectionFirst by calling from_dict on the json representation
- placement_group_collection_first_model_dict = PlacementGroupCollectionFirst.from_dict(placement_group_collection_first_model_json).__dict__
- placement_group_collection_first_model2 = PlacementGroupCollectionFirst(**placement_group_collection_first_model_dict)
+ zone_identity_model = {} # ZoneIdentityByName
+ zone_identity_model['name'] = 'us-south-1'
+
+ # Construct a json representation of a RoutePrototype model
+ route_prototype_model_json = {}
+ route_prototype_model_json['action'] = 'deliver'
+ route_prototype_model_json['destination'] = '192.168.3.0/24'
+ route_prototype_model_json['name'] = 'my-route-2'
+ route_prototype_model_json['next_hop'] = route_next_hop_prototype_model
+ route_prototype_model_json['zone'] = zone_identity_model
+
+ # Construct a model instance of RoutePrototype by calling from_dict on the json representation
+ route_prototype_model = RoutePrototype.from_dict(route_prototype_model_json)
+ assert route_prototype_model != False
+
+ # Construct a model instance of RoutePrototype by calling from_dict on the json representation
+ route_prototype_model_dict = RoutePrototype.from_dict(route_prototype_model_json).__dict__
+ route_prototype_model2 = RoutePrototype(**route_prototype_model_dict)
# Verify the model instances are equivalent
- assert placement_group_collection_first_model == placement_group_collection_first_model2
+ assert route_prototype_model == route_prototype_model2
# Convert model instance back to dict and verify no loss of data
- placement_group_collection_first_model_json2 = placement_group_collection_first_model.to_dict()
- assert placement_group_collection_first_model_json2 == placement_group_collection_first_model_json
+ route_prototype_model_json2 = route_prototype_model.to_dict()
+ assert route_prototype_model_json2 == route_prototype_model_json
-class TestModel_PlacementGroupCollectionNext():
+class TestModel_RouteReference():
"""
- Test Class for PlacementGroupCollectionNext
+ Test Class for RouteReference
"""
- def test_placement_group_collection_next_serialization(self):
+ def test_route_reference_serialization(self):
"""
- Test serialization/deserialization for PlacementGroupCollectionNext
+ Test serialization/deserialization for RouteReference
"""
- # Construct a json representation of a PlacementGroupCollectionNext model
- placement_group_collection_next_model_json = {}
- placement_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/placement_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of PlacementGroupCollectionNext by calling from_dict on the json representation
- placement_group_collection_next_model = PlacementGroupCollectionNext.from_dict(placement_group_collection_next_model_json)
- assert placement_group_collection_next_model != False
+ route_reference_deleted_model = {} # RouteReferenceDeleted
+ route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of PlacementGroupCollectionNext by calling from_dict on the json representation
- placement_group_collection_next_model_dict = PlacementGroupCollectionNext.from_dict(placement_group_collection_next_model_json).__dict__
- placement_group_collection_next_model2 = PlacementGroupCollectionNext(**placement_group_collection_next_model_dict)
+ # Construct a json representation of a RouteReference model
+ route_reference_model_json = {}
+ route_reference_model_json['deleted'] = route_reference_deleted_model
+ route_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model_json['name'] = 'my-route-1'
+
+ # Construct a model instance of RouteReference by calling from_dict on the json representation
+ route_reference_model = RouteReference.from_dict(route_reference_model_json)
+ assert route_reference_model != False
+
+ # Construct a model instance of RouteReference by calling from_dict on the json representation
+ route_reference_model_dict = RouteReference.from_dict(route_reference_model_json).__dict__
+ route_reference_model2 = RouteReference(**route_reference_model_dict)
# Verify the model instances are equivalent
- assert placement_group_collection_next_model == placement_group_collection_next_model2
+ assert route_reference_model == route_reference_model2
# Convert model instance back to dict and verify no loss of data
- placement_group_collection_next_model_json2 = placement_group_collection_next_model.to_dict()
- assert placement_group_collection_next_model_json2 == placement_group_collection_next_model_json
+ route_reference_model_json2 = route_reference_model.to_dict()
+ assert route_reference_model_json2 == route_reference_model_json
-class TestModel_PlacementGroupPatch():
+class TestModel_RouteReferenceDeleted():
"""
- Test Class for PlacementGroupPatch
+ Test Class for RouteReferenceDeleted
"""
- def test_placement_group_patch_serialization(self):
+ def test_route_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for PlacementGroupPatch
+ Test serialization/deserialization for RouteReferenceDeleted
"""
- # Construct a json representation of a PlacementGroupPatch model
- placement_group_patch_model_json = {}
- placement_group_patch_model_json['name'] = 'my-placement-group'
+ # Construct a json representation of a RouteReferenceDeleted model
+ route_reference_deleted_model_json = {}
+ route_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of PlacementGroupPatch by calling from_dict on the json representation
- placement_group_patch_model = PlacementGroupPatch.from_dict(placement_group_patch_model_json)
- assert placement_group_patch_model != False
+ # Construct a model instance of RouteReferenceDeleted by calling from_dict on the json representation
+ route_reference_deleted_model = RouteReferenceDeleted.from_dict(route_reference_deleted_model_json)
+ assert route_reference_deleted_model != False
- # Construct a model instance of PlacementGroupPatch by calling from_dict on the json representation
- placement_group_patch_model_dict = PlacementGroupPatch.from_dict(placement_group_patch_model_json).__dict__
- placement_group_patch_model2 = PlacementGroupPatch(**placement_group_patch_model_dict)
+ # Construct a model instance of RouteReferenceDeleted by calling from_dict on the json representation
+ route_reference_deleted_model_dict = RouteReferenceDeleted.from_dict(route_reference_deleted_model_json).__dict__
+ route_reference_deleted_model2 = RouteReferenceDeleted(**route_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert placement_group_patch_model == placement_group_patch_model2
+ assert route_reference_deleted_model == route_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- placement_group_patch_model_json2 = placement_group_patch_model.to_dict()
- assert placement_group_patch_model_json2 == placement_group_patch_model_json
+ route_reference_deleted_model_json2 = route_reference_deleted_model.to_dict()
+ assert route_reference_deleted_model_json2 == route_reference_deleted_model_json
-class TestModel_PlacementGroupReferenceDeleted():
+class TestModel_RoutingTable():
"""
- Test Class for PlacementGroupReferenceDeleted
+ Test Class for RoutingTable
"""
- def test_placement_group_reference_deleted_serialization(self):
+ def test_routing_table_serialization(self):
"""
- Test serialization/deserialization for PlacementGroupReferenceDeleted
+ Test serialization/deserialization for RoutingTable
"""
- # Construct a json representation of a PlacementGroupReferenceDeleted model
- placement_group_reference_deleted_model_json = {}
- placement_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of PlacementGroupReferenceDeleted by calling from_dict on the json representation
- placement_group_reference_deleted_model = PlacementGroupReferenceDeleted.from_dict(placement_group_reference_deleted_model_json)
- assert placement_group_reference_deleted_model != False
+ route_reference_deleted_model = {} # RouteReferenceDeleted
+ route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of PlacementGroupReferenceDeleted by calling from_dict on the json representation
- placement_group_reference_deleted_model_dict = PlacementGroupReferenceDeleted.from_dict(placement_group_reference_deleted_model_json).__dict__
- placement_group_reference_deleted_model2 = PlacementGroupReferenceDeleted(**placement_group_reference_deleted_model_dict)
+ route_reference_model = {} # RouteReference
+ route_reference_model['deleted'] = route_reference_deleted_model
+ route_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model['name'] = 'my-route-1'
+
+ 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'
+
+ # Construct a json representation of a RoutingTable model
+ routing_table_model_json = {}
+ routing_table_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ routing_table_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
+ routing_table_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ routing_table_model_json['is_default'] = True
+ routing_table_model_json['lifecycle_state'] = 'stable'
+ routing_table_model_json['name'] = 'my-routing-table-1'
+ routing_table_model_json['resource_type'] = 'routing_table'
+ routing_table_model_json['route_direct_link_ingress'] = True
+ routing_table_model_json['route_transit_gateway_ingress'] = True
+ routing_table_model_json['route_vpc_zone_ingress'] = True
+ routing_table_model_json['routes'] = [route_reference_model]
+ routing_table_model_json['subnets'] = [subnet_reference_model]
+
+ # Construct a model instance of RoutingTable by calling from_dict on the json representation
+ routing_table_model = RoutingTable.from_dict(routing_table_model_json)
+ assert routing_table_model != False
+
+ # Construct a model instance of RoutingTable by calling from_dict on the json representation
+ routing_table_model_dict = RoutingTable.from_dict(routing_table_model_json).__dict__
+ routing_table_model2 = RoutingTable(**routing_table_model_dict)
# Verify the model instances are equivalent
- assert placement_group_reference_deleted_model == placement_group_reference_deleted_model2
+ assert routing_table_model == routing_table_model2
# Convert model instance back to dict and verify no loss of data
- placement_group_reference_deleted_model_json2 = placement_group_reference_deleted_model.to_dict()
- assert placement_group_reference_deleted_model_json2 == placement_group_reference_deleted_model_json
+ routing_table_model_json2 = routing_table_model.to_dict()
+ assert routing_table_model_json2 == routing_table_model_json
-class TestModel_PublicGateway():
+class TestModel_RoutingTableCollection():
"""
- Test Class for PublicGateway
+ Test Class for RoutingTableCollection
"""
- def test_public_gateway_serialization(self):
+ def test_routing_table_collection_serialization(self):
"""
- Test serialization/deserialization for PublicGateway
+ Test serialization/deserialization for RoutingTableCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ routing_table_collection_first_model = {} # RoutingTableCollectionFirst
+ routing_table_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20'
- public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp
- public_gateway_floating_ip_model['address'] = '203.0.113.1'
- public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- public_gateway_floating_ip_model['deleted'] = floating_ip_reference_deleted_model
- public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- public_gateway_floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- public_gateway_floating_ip_model['name'] = 'my-floating-ip'
+ routing_table_collection_next_model = {} # RoutingTableCollectionNext
+ routing_table_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ route_reference_deleted_model = {} # RouteReferenceDeleted
+ route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ route_reference_model = {} # RouteReference
+ route_reference_model['deleted'] = route_reference_deleted_model
+ route_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ route_reference_model['name'] = 'my-route-1'
- 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'
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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'
+ 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'
- # Construct a json representation of a PublicGateway model
- public_gateway_model_json = {}
- public_gateway_model_json['created_at'] = "2019-01-01T12:00:00Z"
- public_gateway_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_model_json['floating_ip'] = public_gateway_floating_ip_model
- public_gateway_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_model_json['name'] = 'my-public-gateway'
- public_gateway_model_json['resource_group'] = resource_group_reference_model
- public_gateway_model_json['resource_type'] = 'public_gateway'
- public_gateway_model_json['status'] = 'available'
- public_gateway_model_json['vpc'] = vpc_reference_model
- public_gateway_model_json['zone'] = zone_reference_model
+ routing_table_model = {} # RoutingTable
+ routing_table_model['created_at'] = "2019-01-01T12:00:00Z"
+ routing_table_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
+ routing_table_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ routing_table_model['is_default'] = True
+ routing_table_model['lifecycle_state'] = 'stable'
+ routing_table_model['name'] = 'my-routing-table-1'
+ routing_table_model['resource_type'] = 'routing_table'
+ routing_table_model['route_direct_link_ingress'] = True
+ routing_table_model['route_transit_gateway_ingress'] = True
+ routing_table_model['route_vpc_zone_ingress'] = True
+ routing_table_model['routes'] = [route_reference_model]
+ routing_table_model['subnets'] = [subnet_reference_model]
- # Construct a model instance of PublicGateway by calling from_dict on the json representation
- public_gateway_model = PublicGateway.from_dict(public_gateway_model_json)
- assert public_gateway_model != False
+ # Construct a json representation of a RoutingTableCollection model
+ routing_table_collection_model_json = {}
+ routing_table_collection_model_json['first'] = routing_table_collection_first_model
+ routing_table_collection_model_json['limit'] = 20
+ routing_table_collection_model_json['next'] = routing_table_collection_next_model
+ routing_table_collection_model_json['routing_tables'] = [routing_table_model]
+ routing_table_collection_model_json['total_count'] = 132
- # Construct a model instance of PublicGateway by calling from_dict on the json representation
- public_gateway_model_dict = PublicGateway.from_dict(public_gateway_model_json).__dict__
- public_gateway_model2 = PublicGateway(**public_gateway_model_dict)
+ # Construct a model instance of RoutingTableCollection by calling from_dict on the json representation
+ routing_table_collection_model = RoutingTableCollection.from_dict(routing_table_collection_model_json)
+ assert routing_table_collection_model != False
+
+ # Construct a model instance of RoutingTableCollection by calling from_dict on the json representation
+ routing_table_collection_model_dict = RoutingTableCollection.from_dict(routing_table_collection_model_json).__dict__
+ routing_table_collection_model2 = RoutingTableCollection(**routing_table_collection_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_model == public_gateway_model2
+ assert routing_table_collection_model == routing_table_collection_model2
# Convert model instance back to dict and verify no loss of data
- public_gateway_model_json2 = public_gateway_model.to_dict()
- assert public_gateway_model_json2 == public_gateway_model_json
+ routing_table_collection_model_json2 = routing_table_collection_model.to_dict()
+ assert routing_table_collection_model_json2 == routing_table_collection_model_json
-class TestModel_PublicGatewayCollection():
+class TestModel_RoutingTableCollectionFirst():
"""
- Test Class for PublicGatewayCollection
+ Test Class for RoutingTableCollectionFirst
"""
- def test_public_gateway_collection_serialization(self):
+ def test_routing_table_collection_first_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayCollection
+ Test serialization/deserialization for RoutingTableCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a RoutingTableCollectionFirst model
+ routing_table_collection_first_model_json = {}
+ routing_table_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20'
- public_gateway_collection_first_model = {} # PublicGatewayCollectionFirst
- public_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20'
+ # Construct a model instance of RoutingTableCollectionFirst by calling from_dict on the json representation
+ routing_table_collection_first_model = RoutingTableCollectionFirst.from_dict(routing_table_collection_first_model_json)
+ assert routing_table_collection_first_model != False
- public_gateway_collection_next_model = {} # PublicGatewayCollectionNext
- public_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a model instance of RoutingTableCollectionFirst by calling from_dict on the json representation
+ routing_table_collection_first_model_dict = RoutingTableCollectionFirst.from_dict(routing_table_collection_first_model_json).__dict__
+ routing_table_collection_first_model2 = RoutingTableCollectionFirst(**routing_table_collection_first_model_dict)
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert routing_table_collection_first_model == routing_table_collection_first_model2
- public_gateway_floating_ip_model = {} # PublicGatewayFloatingIp
- public_gateway_floating_ip_model['address'] = '203.0.113.1'
- public_gateway_floating_ip_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- public_gateway_floating_ip_model['deleted'] = floating_ip_reference_deleted_model
- public_gateway_floating_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- public_gateway_floating_ip_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- public_gateway_floating_ip_model['name'] = 'my-floating-ip'
+ # Convert model instance back to dict and verify no loss of data
+ routing_table_collection_first_model_json2 = routing_table_collection_first_model.to_dict()
+ assert routing_table_collection_first_model_json2 == routing_table_collection_first_model_json
- 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'
+class TestModel_RoutingTableCollectionNext():
+ """
+ Test Class for RoutingTableCollectionNext
+ """
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ def test_routing_table_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for RoutingTableCollectionNext
+ """
- 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'
+ # Construct a json representation of a RoutingTableCollectionNext model
+ routing_table_collection_next_model_json = {}
+ routing_table_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- 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 model instance of RoutingTableCollectionNext by calling from_dict on the json representation
+ routing_table_collection_next_model = RoutingTableCollectionNext.from_dict(routing_table_collection_next_model_json)
+ assert routing_table_collection_next_model != False
- public_gateway_model = {} # PublicGateway
- public_gateway_model['created_at'] = "2019-01-01T12:00:00Z"
- public_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_model['floating_ip'] = public_gateway_floating_ip_model
- public_gateway_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_model['name'] = 'my-public-gateway'
- public_gateway_model['resource_group'] = resource_group_reference_model
- public_gateway_model['resource_type'] = 'public_gateway'
- public_gateway_model['status'] = 'available'
- public_gateway_model['vpc'] = vpc_reference_model
- public_gateway_model['zone'] = zone_reference_model
+ # Construct a model instance of RoutingTableCollectionNext by calling from_dict on the json representation
+ routing_table_collection_next_model_dict = RoutingTableCollectionNext.from_dict(routing_table_collection_next_model_json).__dict__
+ routing_table_collection_next_model2 = RoutingTableCollectionNext(**routing_table_collection_next_model_dict)
- # Construct a json representation of a PublicGatewayCollection model
- public_gateway_collection_model_json = {}
- public_gateway_collection_model_json['first'] = public_gateway_collection_first_model
- public_gateway_collection_model_json['limit'] = 20
- public_gateway_collection_model_json['next'] = public_gateway_collection_next_model
- public_gateway_collection_model_json['public_gateways'] = [public_gateway_model]
- public_gateway_collection_model_json['total_count'] = 132
+ # Verify the model instances are equivalent
+ assert routing_table_collection_next_model == routing_table_collection_next_model2
- # Construct a model instance of PublicGatewayCollection by calling from_dict on the json representation
- public_gateway_collection_model = PublicGatewayCollection.from_dict(public_gateway_collection_model_json)
- assert public_gateway_collection_model != False
+ # Convert model instance back to dict and verify no loss of data
+ routing_table_collection_next_model_json2 = routing_table_collection_next_model.to_dict()
+ assert routing_table_collection_next_model_json2 == routing_table_collection_next_model_json
- # Construct a model instance of PublicGatewayCollection by calling from_dict on the json representation
- public_gateway_collection_model_dict = PublicGatewayCollection.from_dict(public_gateway_collection_model_json).__dict__
- public_gateway_collection_model2 = PublicGatewayCollection(**public_gateway_collection_model_dict)
+class TestModel_RoutingTablePatch():
+ """
+ Test Class for RoutingTablePatch
+ """
+
+ def test_routing_table_patch_serialization(self):
+ """
+ Test serialization/deserialization for RoutingTablePatch
+ """
+
+ # Construct a json representation of a RoutingTablePatch model
+ routing_table_patch_model_json = {}
+ routing_table_patch_model_json['name'] = 'my-routing-table-2'
+ routing_table_patch_model_json['route_direct_link_ingress'] = True
+ routing_table_patch_model_json['route_transit_gateway_ingress'] = True
+ routing_table_patch_model_json['route_vpc_zone_ingress'] = True
+
+ # Construct a model instance of RoutingTablePatch by calling from_dict on the json representation
+ routing_table_patch_model = RoutingTablePatch.from_dict(routing_table_patch_model_json)
+ assert routing_table_patch_model != False
+
+ # Construct a model instance of RoutingTablePatch by calling from_dict on the json representation
+ routing_table_patch_model_dict = RoutingTablePatch.from_dict(routing_table_patch_model_json).__dict__
+ routing_table_patch_model2 = RoutingTablePatch(**routing_table_patch_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_collection_model == public_gateway_collection_model2
+ assert routing_table_patch_model == routing_table_patch_model2
# Convert model instance back to dict and verify no loss of data
- public_gateway_collection_model_json2 = public_gateway_collection_model.to_dict()
- assert public_gateway_collection_model_json2 == public_gateway_collection_model_json
+ routing_table_patch_model_json2 = routing_table_patch_model.to_dict()
+ assert routing_table_patch_model_json2 == routing_table_patch_model_json
-class TestModel_PublicGatewayCollectionFirst():
+class TestModel_RoutingTableReference():
"""
- Test Class for PublicGatewayCollectionFirst
+ Test Class for RoutingTableReference
"""
- def test_public_gateway_collection_first_serialization(self):
+ def test_routing_table_reference_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayCollectionFirst
+ Test serialization/deserialization for RoutingTableReference
"""
- # Construct a json representation of a PublicGatewayCollectionFirst model
- public_gateway_collection_first_model_json = {}
- public_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of PublicGatewayCollectionFirst by calling from_dict on the json representation
- public_gateway_collection_first_model = PublicGatewayCollectionFirst.from_dict(public_gateway_collection_first_model_json)
- assert public_gateway_collection_first_model != False
+ routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
+ routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of PublicGatewayCollectionFirst by calling from_dict on the json representation
- public_gateway_collection_first_model_dict = PublicGatewayCollectionFirst.from_dict(public_gateway_collection_first_model_json).__dict__
- public_gateway_collection_first_model2 = PublicGatewayCollectionFirst(**public_gateway_collection_first_model_dict)
+ # Construct a json representation of a RoutingTableReference model
+ routing_table_reference_model_json = {}
+ routing_table_reference_model_json['deleted'] = routing_table_reference_deleted_model
+ routing_table_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
+ routing_table_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ routing_table_reference_model_json['name'] = 'my-routing-table-1'
+ routing_table_reference_model_json['resource_type'] = 'routing_table'
+
+ # Construct a model instance of RoutingTableReference by calling from_dict on the json representation
+ routing_table_reference_model = RoutingTableReference.from_dict(routing_table_reference_model_json)
+ assert routing_table_reference_model != False
+
+ # Construct a model instance of RoutingTableReference by calling from_dict on the json representation
+ routing_table_reference_model_dict = RoutingTableReference.from_dict(routing_table_reference_model_json).__dict__
+ routing_table_reference_model2 = RoutingTableReference(**routing_table_reference_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_collection_first_model == public_gateway_collection_first_model2
+ assert routing_table_reference_model == routing_table_reference_model2
# Convert model instance back to dict and verify no loss of data
- public_gateway_collection_first_model_json2 = public_gateway_collection_first_model.to_dict()
- assert public_gateway_collection_first_model_json2 == public_gateway_collection_first_model_json
+ routing_table_reference_model_json2 = routing_table_reference_model.to_dict()
+ assert routing_table_reference_model_json2 == routing_table_reference_model_json
-class TestModel_PublicGatewayCollectionNext():
+class TestModel_RoutingTableReferenceDeleted():
"""
- Test Class for PublicGatewayCollectionNext
+ Test Class for RoutingTableReferenceDeleted
"""
- def test_public_gateway_collection_next_serialization(self):
+ def test_routing_table_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayCollectionNext
+ Test serialization/deserialization for RoutingTableReferenceDeleted
"""
- # Construct a json representation of a PublicGatewayCollectionNext model
- public_gateway_collection_next_model_json = {}
- public_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a RoutingTableReferenceDeleted model
+ routing_table_reference_deleted_model_json = {}
+ routing_table_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of PublicGatewayCollectionNext by calling from_dict on the json representation
- public_gateway_collection_next_model = PublicGatewayCollectionNext.from_dict(public_gateway_collection_next_model_json)
- assert public_gateway_collection_next_model != False
+ # Construct a model instance of RoutingTableReferenceDeleted by calling from_dict on the json representation
+ routing_table_reference_deleted_model = RoutingTableReferenceDeleted.from_dict(routing_table_reference_deleted_model_json)
+ assert routing_table_reference_deleted_model != False
- # Construct a model instance of PublicGatewayCollectionNext by calling from_dict on the json representation
- public_gateway_collection_next_model_dict = PublicGatewayCollectionNext.from_dict(public_gateway_collection_next_model_json).__dict__
- public_gateway_collection_next_model2 = PublicGatewayCollectionNext(**public_gateway_collection_next_model_dict)
+ # Construct a model instance of RoutingTableReferenceDeleted by calling from_dict on the json representation
+ routing_table_reference_deleted_model_dict = RoutingTableReferenceDeleted.from_dict(routing_table_reference_deleted_model_json).__dict__
+ routing_table_reference_deleted_model2 = RoutingTableReferenceDeleted(**routing_table_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_collection_next_model == public_gateway_collection_next_model2
+ assert routing_table_reference_deleted_model == routing_table_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- public_gateway_collection_next_model_json2 = public_gateway_collection_next_model.to_dict()
- assert public_gateway_collection_next_model_json2 == public_gateway_collection_next_model_json
+ routing_table_reference_deleted_model_json2 = routing_table_reference_deleted_model.to_dict()
+ assert routing_table_reference_deleted_model_json2 == routing_table_reference_deleted_model_json
-class TestModel_PublicGatewayFloatingIp():
+class TestModel_SecurityGroup():
"""
- Test Class for PublicGatewayFloatingIp
+ Test Class for SecurityGroup
"""
- def test_public_gateway_floating_ip_serialization(self):
+ def test_security_group_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayFloatingIp
+ Test serialization/deserialization for SecurityGroup
"""
# Construct dict forms of any model objects needed in order to build this model.
- floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
- floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
+ network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a PublicGatewayFloatingIp model
- public_gateway_floating_ip_model_json = {}
- public_gateway_floating_ip_model_json['address'] = '203.0.113.1'
- public_gateway_floating_ip_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
- public_gateway_floating_ip_model_json['deleted'] = floating_ip_reference_deleted_model
- public_gateway_floating_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
- public_gateway_floating_ip_model_json['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
- public_gateway_floating_ip_model_json['name'] = 'my-floating-ip'
+ network_interface_reference_model = {} # NetworkInterfaceReference
+ network_interface_reference_model['deleted'] = network_interface_reference_deleted_model
+ network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ network_interface_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ network_interface_reference_model['name'] = 'my-network-interface'
+ network_interface_reference_model['primary_ipv4_address'] = '192.168.3.4'
+ network_interface_reference_model['resource_type'] = 'network_interface'
+
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
+
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_model['address'] = '192.168.3.4'
+
+ security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll
+ security_group_rule_model['direction'] = 'inbound'
+ security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_model['ip_version'] = 'ipv4'
+ security_group_rule_model['remote'] = security_group_rule_remote_model
+ security_group_rule_model['protocol'] = 'all'
+
+ network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
+ network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
+ 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['resource_type'] = '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'
+
+ # Construct a json representation of a SecurityGroup model
+ security_group_model_json = {}
+ security_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ security_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_model_json['name'] = 'my-security-group'
+ security_group_model_json['network_interfaces'] = [network_interface_reference_model]
+ security_group_model_json['resource_group'] = resource_group_reference_model
+ security_group_model_json['rules'] = [security_group_rule_model]
+ security_group_model_json['targets'] = [security_group_target_reference_model]
+ security_group_model_json['vpc'] = vpc_reference_model
- # Construct a model instance of PublicGatewayFloatingIp by calling from_dict on the json representation
- public_gateway_floating_ip_model = PublicGatewayFloatingIp.from_dict(public_gateway_floating_ip_model_json)
- assert public_gateway_floating_ip_model != False
+ # Construct a model instance of SecurityGroup by calling from_dict on the json representation
+ security_group_model = SecurityGroup.from_dict(security_group_model_json)
+ assert security_group_model != False
- # Construct a model instance of PublicGatewayFloatingIp by calling from_dict on the json representation
- public_gateway_floating_ip_model_dict = PublicGatewayFloatingIp.from_dict(public_gateway_floating_ip_model_json).__dict__
- public_gateway_floating_ip_model2 = PublicGatewayFloatingIp(**public_gateway_floating_ip_model_dict)
+ # Construct a model instance of SecurityGroup by calling from_dict on the json representation
+ security_group_model_dict = SecurityGroup.from_dict(security_group_model_json).__dict__
+ security_group_model2 = SecurityGroup(**security_group_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_floating_ip_model == public_gateway_floating_ip_model2
+ assert security_group_model == security_group_model2
# Convert model instance back to dict and verify no loss of data
- public_gateway_floating_ip_model_json2 = public_gateway_floating_ip_model.to_dict()
- assert public_gateway_floating_ip_model_json2 == public_gateway_floating_ip_model_json
+ security_group_model_json2 = security_group_model.to_dict()
+ assert security_group_model_json2 == security_group_model_json
-class TestModel_PublicGatewayPatch():
+class TestModel_SecurityGroupCollection():
"""
- Test Class for PublicGatewayPatch
+ Test Class for SecurityGroupCollection
"""
- def test_public_gateway_patch_serialization(self):
+ def test_security_group_collection_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayPatch
+ Test serialization/deserialization for SecurityGroupCollection
"""
- # Construct a json representation of a PublicGatewayPatch model
- public_gateway_patch_model_json = {}
- public_gateway_patch_model_json['name'] = 'my-public-gateway'
-
- # Construct a model instance of PublicGatewayPatch by calling from_dict on the json representation
- public_gateway_patch_model = PublicGatewayPatch.from_dict(public_gateway_patch_model_json)
- assert public_gateway_patch_model != False
-
- # Construct a model instance of PublicGatewayPatch by calling from_dict on the json representation
- public_gateway_patch_model_dict = PublicGatewayPatch.from_dict(public_gateway_patch_model_json).__dict__
- public_gateway_patch_model2 = PublicGatewayPatch(**public_gateway_patch_model_dict)
-
- # Verify the model instances are equivalent
- assert public_gateway_patch_model == public_gateway_patch_model2
+ # Construct dict forms of any model objects needed in order to build this model.
- # Convert model instance back to dict and verify no loss of data
- public_gateway_patch_model_json2 = public_gateway_patch_model.to_dict()
- assert public_gateway_patch_model_json2 == public_gateway_patch_model_json
+ security_group_collection_first_model = {} # SecurityGroupCollectionFirst
+ security_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20'
-class TestModel_PublicGatewayReference():
- """
- Test Class for PublicGatewayReference
- """
+ security_group_collection_next_model = {} # SecurityGroupCollectionNext
+ security_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- def test_public_gateway_reference_serialization(self):
- """
- Test serialization/deserialization for PublicGatewayReference
- """
+ network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
+ network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct dict forms of any model objects needed in order to build this model.
+ network_interface_reference_model = {} # NetworkInterfaceReference
+ network_interface_reference_model['deleted'] = network_interface_reference_deleted_model
+ network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ network_interface_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ network_interface_reference_model['name'] = 'my-network-interface'
+ network_interface_reference_model['primary_ipv4_address'] = '192.168.3.4'
+ network_interface_reference_model['resource_type'] = 'network_interface'
- public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted
- public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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'
- # Construct a json representation of a PublicGatewayReference model
- public_gateway_reference_model_json = {}
- public_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_reference_model_json['deleted'] = public_gateway_reference_deleted_model
- public_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_reference_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_reference_model_json['name'] = 'my-public-gateway'
- public_gateway_reference_model_json['resource_type'] = 'public_gateway'
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_model['address'] = '192.168.3.4'
- # Construct a model instance of PublicGatewayReference by calling from_dict on the json representation
- public_gateway_reference_model = PublicGatewayReference.from_dict(public_gateway_reference_model_json)
- assert public_gateway_reference_model != False
+ security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll
+ security_group_rule_model['direction'] = 'inbound'
+ security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_model['ip_version'] = 'ipv4'
+ security_group_rule_model['remote'] = security_group_rule_remote_model
+ security_group_rule_model['protocol'] = 'all'
- # Construct a model instance of PublicGatewayReference by calling from_dict on the json representation
- public_gateway_reference_model_dict = PublicGatewayReference.from_dict(public_gateway_reference_model_json).__dict__
- public_gateway_reference_model2 = PublicGatewayReference(**public_gateway_reference_model_dict)
+ network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
+ network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert public_gateway_reference_model == public_gateway_reference_model2
+ security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
+ 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['resource_type'] = 'network_interface'
- # Convert model instance back to dict and verify no loss of data
- public_gateway_reference_model_json2 = public_gateway_reference_model.to_dict()
- assert public_gateway_reference_model_json2 == public_gateway_reference_model_json
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_PublicGatewayReferenceDeleted():
- """
- Test Class for PublicGatewayReferenceDeleted
- """
+ 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'
- def test_public_gateway_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for PublicGatewayReferenceDeleted
- """
+ security_group_model = {} # SecurityGroup
+ security_group_model['created_at'] = "2019-01-01T12:00:00Z"
+ security_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_model['name'] = 'my-security-group'
+ security_group_model['network_interfaces'] = [network_interface_reference_model]
+ security_group_model['resource_group'] = resource_group_reference_model
+ security_group_model['rules'] = [security_group_rule_model]
+ security_group_model['targets'] = [security_group_target_reference_model]
+ security_group_model['vpc'] = vpc_reference_model
- # Construct a json representation of a PublicGatewayReferenceDeleted model
- public_gateway_reference_deleted_model_json = {}
- public_gateway_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a SecurityGroupCollection model
+ security_group_collection_model_json = {}
+ security_group_collection_model_json['first'] = security_group_collection_first_model
+ security_group_collection_model_json['limit'] = 20
+ security_group_collection_model_json['next'] = security_group_collection_next_model
+ security_group_collection_model_json['security_groups'] = [security_group_model]
+ security_group_collection_model_json['total_count'] = 132
- # Construct a model instance of PublicGatewayReferenceDeleted by calling from_dict on the json representation
- public_gateway_reference_deleted_model = PublicGatewayReferenceDeleted.from_dict(public_gateway_reference_deleted_model_json)
- assert public_gateway_reference_deleted_model != False
+ # Construct a model instance of SecurityGroupCollection by calling from_dict on the json representation
+ security_group_collection_model = SecurityGroupCollection.from_dict(security_group_collection_model_json)
+ assert security_group_collection_model != False
- # Construct a model instance of PublicGatewayReferenceDeleted by calling from_dict on the json representation
- public_gateway_reference_deleted_model_dict = PublicGatewayReferenceDeleted.from_dict(public_gateway_reference_deleted_model_json).__dict__
- public_gateway_reference_deleted_model2 = PublicGatewayReferenceDeleted(**public_gateway_reference_deleted_model_dict)
+ # Construct a model instance of SecurityGroupCollection by calling from_dict on the json representation
+ security_group_collection_model_dict = SecurityGroupCollection.from_dict(security_group_collection_model_json).__dict__
+ security_group_collection_model2 = SecurityGroupCollection(**security_group_collection_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_reference_deleted_model == public_gateway_reference_deleted_model2
+ assert security_group_collection_model == security_group_collection_model2
# Convert model instance back to dict and verify no loss of data
- public_gateway_reference_deleted_model_json2 = public_gateway_reference_deleted_model.to_dict()
- assert public_gateway_reference_deleted_model_json2 == public_gateway_reference_deleted_model_json
+ security_group_collection_model_json2 = security_group_collection_model.to_dict()
+ assert security_group_collection_model_json2 == security_group_collection_model_json
-class TestModel_Region():
+class TestModel_SecurityGroupCollectionFirst():
"""
- Test Class for Region
+ Test Class for SecurityGroupCollectionFirst
"""
- def test_region_serialization(self):
+ def test_security_group_collection_first_serialization(self):
"""
- Test serialization/deserialization for Region
+ Test serialization/deserialization for SecurityGroupCollectionFirst
"""
- # Construct a json representation of a Region model
- region_model_json = {}
- region_model_json['endpoint'] = 'testString'
- region_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
- region_model_json['name'] = 'us-south'
- region_model_json['status'] = 'available'
+ # Construct a json representation of a SecurityGroupCollectionFirst model
+ security_group_collection_first_model_json = {}
+ security_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20'
- # Construct a model instance of Region by calling from_dict on the json representation
- region_model = Region.from_dict(region_model_json)
- assert region_model != False
+ # Construct a model instance of SecurityGroupCollectionFirst by calling from_dict on the json representation
+ security_group_collection_first_model = SecurityGroupCollectionFirst.from_dict(security_group_collection_first_model_json)
+ assert security_group_collection_first_model != False
- # Construct a model instance of Region by calling from_dict on the json representation
- region_model_dict = Region.from_dict(region_model_json).__dict__
- region_model2 = Region(**region_model_dict)
+ # Construct a model instance of SecurityGroupCollectionFirst by calling from_dict on the json representation
+ security_group_collection_first_model_dict = SecurityGroupCollectionFirst.from_dict(security_group_collection_first_model_json).__dict__
+ security_group_collection_first_model2 = SecurityGroupCollectionFirst(**security_group_collection_first_model_dict)
# Verify the model instances are equivalent
- assert region_model == region_model2
+ assert security_group_collection_first_model == security_group_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- region_model_json2 = region_model.to_dict()
- assert region_model_json2 == region_model_json
+ security_group_collection_first_model_json2 = security_group_collection_first_model.to_dict()
+ assert security_group_collection_first_model_json2 == security_group_collection_first_model_json
-class TestModel_RegionCollection():
+class TestModel_SecurityGroupCollectionNext():
"""
- Test Class for RegionCollection
+ Test Class for SecurityGroupCollectionNext
"""
- def test_region_collection_serialization(self):
+ def test_security_group_collection_next_serialization(self):
"""
- Test serialization/deserialization for RegionCollection
+ Test serialization/deserialization for SecurityGroupCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- region_model = {} # Region
- region_model['endpoint'] = 'testString'
- region_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
- region_model['name'] = 'us-south'
- region_model['status'] = 'available'
-
- # Construct a json representation of a RegionCollection model
- region_collection_model_json = {}
- region_collection_model_json['regions'] = [region_model]
+ # Construct a json representation of a SecurityGroupCollectionNext model
+ security_group_collection_next_model_json = {}
+ security_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of RegionCollection by calling from_dict on the json representation
- region_collection_model = RegionCollection.from_dict(region_collection_model_json)
- assert region_collection_model != False
+ # Construct a model instance of SecurityGroupCollectionNext by calling from_dict on the json representation
+ security_group_collection_next_model = SecurityGroupCollectionNext.from_dict(security_group_collection_next_model_json)
+ assert security_group_collection_next_model != False
- # Construct a model instance of RegionCollection by calling from_dict on the json representation
- region_collection_model_dict = RegionCollection.from_dict(region_collection_model_json).__dict__
- region_collection_model2 = RegionCollection(**region_collection_model_dict)
+ # Construct a model instance of SecurityGroupCollectionNext by calling from_dict on the json representation
+ security_group_collection_next_model_dict = SecurityGroupCollectionNext.from_dict(security_group_collection_next_model_json).__dict__
+ security_group_collection_next_model2 = SecurityGroupCollectionNext(**security_group_collection_next_model_dict)
# Verify the model instances are equivalent
- assert region_collection_model == region_collection_model2
+ assert security_group_collection_next_model == security_group_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- region_collection_model_json2 = region_collection_model.to_dict()
- assert region_collection_model_json2 == region_collection_model_json
+ security_group_collection_next_model_json2 = security_group_collection_next_model.to_dict()
+ assert security_group_collection_next_model_json2 == security_group_collection_next_model_json
-class TestModel_RegionReference():
+class TestModel_SecurityGroupPatch():
"""
- Test Class for RegionReference
+ Test Class for SecurityGroupPatch
"""
- def test_region_reference_serialization(self):
+ def test_security_group_patch_serialization(self):
"""
- Test serialization/deserialization for RegionReference
+ Test serialization/deserialization for SecurityGroupPatch
"""
- # Construct a json representation of a RegionReference model
- region_reference_model_json = {}
- region_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
- region_reference_model_json['name'] = 'us-south'
+ # Construct a json representation of a SecurityGroupPatch model
+ security_group_patch_model_json = {}
+ security_group_patch_model_json['name'] = 'my-security-group'
- # Construct a model instance of RegionReference by calling from_dict on the json representation
- region_reference_model = RegionReference.from_dict(region_reference_model_json)
- assert region_reference_model != False
+ # Construct a model instance of SecurityGroupPatch by calling from_dict on the json representation
+ security_group_patch_model = SecurityGroupPatch.from_dict(security_group_patch_model_json)
+ assert security_group_patch_model != False
- # Construct a model instance of RegionReference by calling from_dict on the json representation
- region_reference_model_dict = RegionReference.from_dict(region_reference_model_json).__dict__
- region_reference_model2 = RegionReference(**region_reference_model_dict)
+ # Construct a model instance of SecurityGroupPatch by calling from_dict on the json representation
+ security_group_patch_model_dict = SecurityGroupPatch.from_dict(security_group_patch_model_json).__dict__
+ security_group_patch_model2 = SecurityGroupPatch(**security_group_patch_model_dict)
# Verify the model instances are equivalent
- assert region_reference_model == region_reference_model2
+ assert security_group_patch_model == security_group_patch_model2
# Convert model instance back to dict and verify no loss of data
- region_reference_model_json2 = region_reference_model.to_dict()
- assert region_reference_model_json2 == region_reference_model_json
+ security_group_patch_model_json2 = security_group_patch_model.to_dict()
+ assert security_group_patch_model_json2 == security_group_patch_model_json
-class TestModel_ReservedIP():
+class TestModel_SecurityGroupReference():
"""
- Test Class for ReservedIP
+ Test Class for SecurityGroupReference
"""
- def test_reserved_ip_serialization(self):
+ def test_security_group_reference_serialization(self):
"""
- Test serialization/deserialization for ReservedIP
+ Test serialization/deserialization for SecurityGroupReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
- endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
- reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
- reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['name'] = 'my-endpoint-gateway'
- reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a ReservedIP model
- reserved_ip_model_json = {}
- reserved_ip_model_json['address'] = '192.168.3.4'
- reserved_ip_model_json['auto_delete'] = False
- reserved_ip_model_json['created_at'] = "2019-01-01T12:00:00Z"
- reserved_ip_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model_json['name'] = 'my-reserved-ip'
- reserved_ip_model_json['owner'] = 'user'
- reserved_ip_model_json['resource_type'] = 'subnet_reserved_ip'
- reserved_ip_model_json['target'] = reserved_ip_target_model
+ # Construct a json representation of a SecurityGroupReference model
+ security_group_reference_model_json = {}
+ security_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model_json['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model_json['name'] = 'my-security-group'
- # Construct a model instance of ReservedIP by calling from_dict on the json representation
- reserved_ip_model = ReservedIP.from_dict(reserved_ip_model_json)
- assert reserved_ip_model != False
+ # Construct a model instance of SecurityGroupReference by calling from_dict on the json representation
+ security_group_reference_model = SecurityGroupReference.from_dict(security_group_reference_model_json)
+ assert security_group_reference_model != False
- # Construct a model instance of ReservedIP by calling from_dict on the json representation
- reserved_ip_model_dict = ReservedIP.from_dict(reserved_ip_model_json).__dict__
- reserved_ip_model2 = ReservedIP(**reserved_ip_model_dict)
+ # Construct a model instance of SecurityGroupReference by calling from_dict on the json representation
+ security_group_reference_model_dict = SecurityGroupReference.from_dict(security_group_reference_model_json).__dict__
+ security_group_reference_model2 = SecurityGroupReference(**security_group_reference_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_model == reserved_ip_model2
+ assert security_group_reference_model == security_group_reference_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_model_json2 = reserved_ip_model.to_dict()
- assert reserved_ip_model_json2 == reserved_ip_model_json
+ security_group_reference_model_json2 = security_group_reference_model.to_dict()
+ assert security_group_reference_model_json2 == security_group_reference_model_json
-class TestModel_ReservedIPCollection():
+class TestModel_SecurityGroupReferenceDeleted():
"""
- Test Class for ReservedIPCollection
+ Test Class for SecurityGroupReferenceDeleted
"""
- def test_reserved_ip_collection_serialization(self):
+ def test_security_group_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollection
+ Test serialization/deserialization for SecurityGroupReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- reserved_ip_collection_first_model = {} # ReservedIPCollectionFirst
- reserved_ip_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20'
-
- reserved_ip_collection_next_model = {} # ReservedIPCollectionNext
- reserved_ip_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
- endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
- reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
- reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['name'] = 'my-endpoint-gateway'
- reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
-
- reserved_ip_model = {} # ReservedIP
- reserved_ip_model['address'] = '192.168.3.4'
- reserved_ip_model['auto_delete'] = False
- reserved_ip_model['created_at'] = "2019-01-01T12:00:00Z"
- reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['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
-
- # Construct a json representation of a ReservedIPCollection model
- reserved_ip_collection_model_json = {}
- reserved_ip_collection_model_json['first'] = reserved_ip_collection_first_model
- reserved_ip_collection_model_json['limit'] = 20
- reserved_ip_collection_model_json['next'] = reserved_ip_collection_next_model
- reserved_ip_collection_model_json['reserved_ips'] = [reserved_ip_model]
- reserved_ip_collection_model_json['total_count'] = 132
+ # Construct a json representation of a SecurityGroupReferenceDeleted model
+ security_group_reference_deleted_model_json = {}
+ security_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of ReservedIPCollection by calling from_dict on the json representation
- reserved_ip_collection_model = ReservedIPCollection.from_dict(reserved_ip_collection_model_json)
- assert reserved_ip_collection_model != False
+ # Construct a model instance of SecurityGroupReferenceDeleted by calling from_dict on the json representation
+ security_group_reference_deleted_model = SecurityGroupReferenceDeleted.from_dict(security_group_reference_deleted_model_json)
+ assert security_group_reference_deleted_model != False
- # Construct a model instance of ReservedIPCollection by calling from_dict on the json representation
- reserved_ip_collection_model_dict = ReservedIPCollection.from_dict(reserved_ip_collection_model_json).__dict__
- reserved_ip_collection_model2 = ReservedIPCollection(**reserved_ip_collection_model_dict)
+ # Construct a model instance of SecurityGroupReferenceDeleted by calling from_dict on the json representation
+ security_group_reference_deleted_model_dict = SecurityGroupReferenceDeleted.from_dict(security_group_reference_deleted_model_json).__dict__
+ security_group_reference_deleted_model2 = SecurityGroupReferenceDeleted(**security_group_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_model == reserved_ip_collection_model2
+ assert security_group_reference_deleted_model == security_group_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_model_json2 = reserved_ip_collection_model.to_dict()
- assert reserved_ip_collection_model_json2 == reserved_ip_collection_model_json
+ security_group_reference_deleted_model_json2 = security_group_reference_deleted_model.to_dict()
+ assert security_group_reference_deleted_model_json2 == security_group_reference_deleted_model_json
-class TestModel_ReservedIPCollectionEndpointGatewayContext():
+class TestModel_SecurityGroupRuleCollection():
"""
- Test Class for ReservedIPCollectionEndpointGatewayContext
+ Test Class for SecurityGroupRuleCollection
"""
- def test_reserved_ip_collection_endpoint_gateway_context_serialization(self):
+ def test_security_group_rule_collection_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContext
+ Test serialization/deserialization for SecurityGroupRuleCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- reserved_ip_collection_endpoint_gateway_context_first_model = {} # ReservedIPCollectionEndpointGatewayContextFirst
- reserved_ip_collection_endpoint_gateway_context_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20'
-
- endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
- endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- reserved_ip_target_model = {} # ReservedIPTargetEndpointGatewayReference
- reserved_ip_target_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['deleted'] = endpoint_gateway_reference_deleted_model
- reserved_ip_target_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
- reserved_ip_target_model['name'] = 'my-endpoint-gateway'
- reserved_ip_target_model['resource_type'] = 'endpoint_gateway'
-
- reserved_ip_model = {} # ReservedIP
- reserved_ip_model['address'] = '192.168.3.4'
- reserved_ip_model['auto_delete'] = False
- reserved_ip_model['created_at'] = "2019-01-01T12:00:00Z"
- reserved_ip_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_model['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
+ security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
+ security_group_rule_remote_model['address'] = '192.168.3.4'
- reserved_ip_collection_endpoint_gateway_context_next_model = {} # ReservedIPCollectionEndpointGatewayContextNext
- reserved_ip_collection_endpoint_gateway_context_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20'
+ security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll
+ security_group_rule_model['direction'] = 'inbound'
+ security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
+ security_group_rule_model['ip_version'] = 'ipv4'
+ security_group_rule_model['remote'] = security_group_rule_remote_model
+ security_group_rule_model['protocol'] = 'all'
- # Construct a json representation of a ReservedIPCollectionEndpointGatewayContext model
- reserved_ip_collection_endpoint_gateway_context_model_json = {}
- reserved_ip_collection_endpoint_gateway_context_model_json['first'] = reserved_ip_collection_endpoint_gateway_context_first_model
- reserved_ip_collection_endpoint_gateway_context_model_json['ips'] = [reserved_ip_model]
- reserved_ip_collection_endpoint_gateway_context_model_json['limit'] = 20
- reserved_ip_collection_endpoint_gateway_context_model_json['next'] = reserved_ip_collection_endpoint_gateway_context_next_model
- reserved_ip_collection_endpoint_gateway_context_model_json['total_count'] = 132
+ # Construct a json representation of a SecurityGroupRuleCollection model
+ security_group_rule_collection_model_json = {}
+ security_group_rule_collection_model_json['rules'] = [security_group_rule_model]
- # Construct a model instance of ReservedIPCollectionEndpointGatewayContext by calling from_dict on the json representation
- reserved_ip_collection_endpoint_gateway_context_model = ReservedIPCollectionEndpointGatewayContext.from_dict(reserved_ip_collection_endpoint_gateway_context_model_json)
- assert reserved_ip_collection_endpoint_gateway_context_model != False
+ # Construct a model instance of SecurityGroupRuleCollection by calling from_dict on the json representation
+ security_group_rule_collection_model = SecurityGroupRuleCollection.from_dict(security_group_rule_collection_model_json)
+ assert security_group_rule_collection_model != False
- # Construct a model instance of ReservedIPCollectionEndpointGatewayContext by calling from_dict on the json representation
- reserved_ip_collection_endpoint_gateway_context_model_dict = ReservedIPCollectionEndpointGatewayContext.from_dict(reserved_ip_collection_endpoint_gateway_context_model_json).__dict__
- reserved_ip_collection_endpoint_gateway_context_model2 = ReservedIPCollectionEndpointGatewayContext(**reserved_ip_collection_endpoint_gateway_context_model_dict)
+ # Construct a model instance of SecurityGroupRuleCollection by calling from_dict on the json representation
+ security_group_rule_collection_model_dict = SecurityGroupRuleCollection.from_dict(security_group_rule_collection_model_json).__dict__
+ security_group_rule_collection_model2 = SecurityGroupRuleCollection(**security_group_rule_collection_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_endpoint_gateway_context_model == reserved_ip_collection_endpoint_gateway_context_model2
+ assert security_group_rule_collection_model == security_group_rule_collection_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_endpoint_gateway_context_model_json2 = reserved_ip_collection_endpoint_gateway_context_model.to_dict()
- assert reserved_ip_collection_endpoint_gateway_context_model_json2 == reserved_ip_collection_endpoint_gateway_context_model_json
+ security_group_rule_collection_model_json2 = security_group_rule_collection_model.to_dict()
+ assert security_group_rule_collection_model_json2 == security_group_rule_collection_model_json
-class TestModel_ReservedIPCollectionEndpointGatewayContextFirst():
+class TestModel_SecurityGroupRulePatch():
"""
- Test Class for ReservedIPCollectionEndpointGatewayContextFirst
+ Test Class for SecurityGroupRulePatch
"""
- def test_reserved_ip_collection_endpoint_gateway_context_first_serialization(self):
+ def test_security_group_rule_patch_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextFirst
+ Test serialization/deserialization for SecurityGroupRulePatch
"""
- # Construct a json representation of a ReservedIPCollectionEndpointGatewayContextFirst model
- reserved_ip_collection_endpoint_gateway_context_first_model_json = {}
- reserved_ip_collection_endpoint_gateway_context_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?limit=20'
-
- # Construct a model instance of ReservedIPCollectionEndpointGatewayContextFirst by calling from_dict on the json representation
- reserved_ip_collection_endpoint_gateway_context_first_model = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(reserved_ip_collection_endpoint_gateway_context_first_model_json)
- assert reserved_ip_collection_endpoint_gateway_context_first_model != False
-
- # Construct a model instance of ReservedIPCollectionEndpointGatewayContextFirst by calling from_dict on the json representation
- reserved_ip_collection_endpoint_gateway_context_first_model_dict = ReservedIPCollectionEndpointGatewayContextFirst.from_dict(reserved_ip_collection_endpoint_gateway_context_first_model_json).__dict__
- reserved_ip_collection_endpoint_gateway_context_first_model2 = ReservedIPCollectionEndpointGatewayContextFirst(**reserved_ip_collection_endpoint_gateway_context_first_model_dict)
-
- # Verify the model instances are equivalent
- assert reserved_ip_collection_endpoint_gateway_context_first_model == reserved_ip_collection_endpoint_gateway_context_first_model2
-
- # Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_endpoint_gateway_context_first_model_json2 = reserved_ip_collection_endpoint_gateway_context_first_model.to_dict()
- assert reserved_ip_collection_endpoint_gateway_context_first_model_json2 == reserved_ip_collection_endpoint_gateway_context_first_model_json
-
-class TestModel_ReservedIPCollectionEndpointGatewayContextNext():
- """
- Test Class for ReservedIPCollectionEndpointGatewayContextNext
- """
+ # Construct dict forms of any model objects needed in order to build this model.
- def test_reserved_ip_collection_endpoint_gateway_context_next_serialization(self):
- """
- Test serialization/deserialization for ReservedIPCollectionEndpointGatewayContextNext
- """
+ security_group_rule_remote_patch_model = {} # SecurityGroupRuleRemotePatchCIDR
+ security_group_rule_remote_patch_model['cidr_block'] = '10.0.0.0/16'
- # Construct a json representation of a ReservedIPCollectionEndpointGatewayContextNext model
- reserved_ip_collection_endpoint_gateway_context_next_model_json = {}
- reserved_ip_collection_endpoint_gateway_context_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5/ips?start=90ac13871b604023ab8b827178518328&limit=20'
+ # Construct a json representation of a SecurityGroupRulePatch model
+ security_group_rule_patch_model_json = {}
+ security_group_rule_patch_model_json['code'] = 0
+ security_group_rule_patch_model_json['direction'] = 'inbound'
+ security_group_rule_patch_model_json['ip_version'] = 'ipv4'
+ security_group_rule_patch_model_json['port_max'] = 22
+ security_group_rule_patch_model_json['port_min'] = 22
+ security_group_rule_patch_model_json['remote'] = security_group_rule_remote_patch_model
+ security_group_rule_patch_model_json['type'] = 8
- # Construct a model instance of ReservedIPCollectionEndpointGatewayContextNext by calling from_dict on the json representation
- reserved_ip_collection_endpoint_gateway_context_next_model = ReservedIPCollectionEndpointGatewayContextNext.from_dict(reserved_ip_collection_endpoint_gateway_context_next_model_json)
- assert reserved_ip_collection_endpoint_gateway_context_next_model != False
+ # Construct a model instance of SecurityGroupRulePatch by calling from_dict on the json representation
+ security_group_rule_patch_model = SecurityGroupRulePatch.from_dict(security_group_rule_patch_model_json)
+ assert security_group_rule_patch_model != False
- # Construct a model instance of ReservedIPCollectionEndpointGatewayContextNext by calling from_dict on the json representation
- reserved_ip_collection_endpoint_gateway_context_next_model_dict = ReservedIPCollectionEndpointGatewayContextNext.from_dict(reserved_ip_collection_endpoint_gateway_context_next_model_json).__dict__
- reserved_ip_collection_endpoint_gateway_context_next_model2 = ReservedIPCollectionEndpointGatewayContextNext(**reserved_ip_collection_endpoint_gateway_context_next_model_dict)
+ # Construct a model instance of SecurityGroupRulePatch by calling from_dict on the json representation
+ security_group_rule_patch_model_dict = SecurityGroupRulePatch.from_dict(security_group_rule_patch_model_json).__dict__
+ security_group_rule_patch_model2 = SecurityGroupRulePatch(**security_group_rule_patch_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_endpoint_gateway_context_next_model == reserved_ip_collection_endpoint_gateway_context_next_model2
+ assert security_group_rule_patch_model == security_group_rule_patch_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_endpoint_gateway_context_next_model_json2 = reserved_ip_collection_endpoint_gateway_context_next_model.to_dict()
- assert reserved_ip_collection_endpoint_gateway_context_next_model_json2 == reserved_ip_collection_endpoint_gateway_context_next_model_json
+ security_group_rule_patch_model_json2 = security_group_rule_patch_model.to_dict()
+ assert security_group_rule_patch_model_json2 == security_group_rule_patch_model_json
-class TestModel_ReservedIPCollectionFirst():
+class TestModel_SecurityGroupTargetCollection():
"""
- Test Class for ReservedIPCollectionFirst
+ Test Class for SecurityGroupTargetCollection
"""
- def test_reserved_ip_collection_first_serialization(self):
+ def test_security_group_target_collection_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionFirst
+ Test serialization/deserialization for SecurityGroupTargetCollection
"""
- # Construct a json representation of a ReservedIPCollectionFirst model
- reserved_ip_collection_first_model_json = {}
- reserved_ip_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ReservedIPCollectionFirst by calling from_dict on the json representation
- reserved_ip_collection_first_model = ReservedIPCollectionFirst.from_dict(reserved_ip_collection_first_model_json)
- assert reserved_ip_collection_first_model != False
+ security_group_target_collection_first_model = {} # SecurityGroupTargetCollectionFirst
+ security_group_target_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20'
- # Construct a model instance of ReservedIPCollectionFirst by calling from_dict on the json representation
- reserved_ip_collection_first_model_dict = ReservedIPCollectionFirst.from_dict(reserved_ip_collection_first_model_json).__dict__
- reserved_ip_collection_first_model2 = ReservedIPCollectionFirst(**reserved_ip_collection_first_model_dict)
+ security_group_target_collection_next_model = {} # SecurityGroupTargetCollectionNext
+ security_group_target_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
+ network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
+ 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['resource_type'] = 'network_interface'
+
+ # Construct a json representation of a SecurityGroupTargetCollection model
+ security_group_target_collection_model_json = {}
+ security_group_target_collection_model_json['first'] = security_group_target_collection_first_model
+ security_group_target_collection_model_json['limit'] = 20
+ security_group_target_collection_model_json['next'] = security_group_target_collection_next_model
+ security_group_target_collection_model_json['targets'] = [security_group_target_reference_model]
+ security_group_target_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of SecurityGroupTargetCollection by calling from_dict on the json representation
+ security_group_target_collection_model = SecurityGroupTargetCollection.from_dict(security_group_target_collection_model_json)
+ assert security_group_target_collection_model != False
+
+ # Construct a model instance of SecurityGroupTargetCollection by calling from_dict on the json representation
+ security_group_target_collection_model_dict = SecurityGroupTargetCollection.from_dict(security_group_target_collection_model_json).__dict__
+ security_group_target_collection_model2 = SecurityGroupTargetCollection(**security_group_target_collection_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_first_model == reserved_ip_collection_first_model2
+ assert security_group_target_collection_model == security_group_target_collection_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_first_model_json2 = reserved_ip_collection_first_model.to_dict()
- assert reserved_ip_collection_first_model_json2 == reserved_ip_collection_first_model_json
+ security_group_target_collection_model_json2 = security_group_target_collection_model.to_dict()
+ assert security_group_target_collection_model_json2 == security_group_target_collection_model_json
-class TestModel_ReservedIPCollectionNext():
+class TestModel_SecurityGroupTargetCollectionFirst():
"""
- Test Class for ReservedIPCollectionNext
+ Test Class for SecurityGroupTargetCollectionFirst
"""
- def test_reserved_ip_collection_next_serialization(self):
+ def test_security_group_target_collection_first_serialization(self):
"""
- Test serialization/deserialization for ReservedIPCollectionNext
+ Test serialization/deserialization for SecurityGroupTargetCollectionFirst
"""
- # Construct a json representation of a ReservedIPCollectionNext model
- reserved_ip_collection_next_model_json = {}
- reserved_ip_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a SecurityGroupTargetCollectionFirst model
+ security_group_target_collection_first_model_json = {}
+ security_group_target_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20'
- # Construct a model instance of ReservedIPCollectionNext by calling from_dict on the json representation
- reserved_ip_collection_next_model = ReservedIPCollectionNext.from_dict(reserved_ip_collection_next_model_json)
- assert reserved_ip_collection_next_model != False
+ # Construct a model instance of SecurityGroupTargetCollectionFirst by calling from_dict on the json representation
+ security_group_target_collection_first_model = SecurityGroupTargetCollectionFirst.from_dict(security_group_target_collection_first_model_json)
+ assert security_group_target_collection_first_model != False
- # Construct a model instance of ReservedIPCollectionNext by calling from_dict on the json representation
- reserved_ip_collection_next_model_dict = ReservedIPCollectionNext.from_dict(reserved_ip_collection_next_model_json).__dict__
- reserved_ip_collection_next_model2 = ReservedIPCollectionNext(**reserved_ip_collection_next_model_dict)
+ # Construct a model instance of SecurityGroupTargetCollectionFirst by calling from_dict on the json representation
+ security_group_target_collection_first_model_dict = SecurityGroupTargetCollectionFirst.from_dict(security_group_target_collection_first_model_json).__dict__
+ security_group_target_collection_first_model2 = SecurityGroupTargetCollectionFirst(**security_group_target_collection_first_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_collection_next_model == reserved_ip_collection_next_model2
+ assert security_group_target_collection_first_model == security_group_target_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_collection_next_model_json2 = reserved_ip_collection_next_model.to_dict()
- assert reserved_ip_collection_next_model_json2 == reserved_ip_collection_next_model_json
+ security_group_target_collection_first_model_json2 = security_group_target_collection_first_model.to_dict()
+ assert security_group_target_collection_first_model_json2 == security_group_target_collection_first_model_json
-class TestModel_ReservedIPPatch():
+class TestModel_SecurityGroupTargetCollectionNext():
"""
- Test Class for ReservedIPPatch
+ Test Class for SecurityGroupTargetCollectionNext
"""
- def test_reserved_ip_patch_serialization(self):
+ def test_security_group_target_collection_next_serialization(self):
"""
- Test serialization/deserialization for ReservedIPPatch
+ Test serialization/deserialization for SecurityGroupTargetCollectionNext
"""
- # Construct a json representation of a ReservedIPPatch model
- reserved_ip_patch_model_json = {}
- reserved_ip_patch_model_json['auto_delete'] = False
- reserved_ip_patch_model_json['name'] = 'my-reserved-ip'
+ # Construct a json representation of a SecurityGroupTargetCollectionNext model
+ security_group_target_collection_next_model_json = {}
+ security_group_target_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of ReservedIPPatch by calling from_dict on the json representation
- reserved_ip_patch_model = ReservedIPPatch.from_dict(reserved_ip_patch_model_json)
- assert reserved_ip_patch_model != False
+ # Construct a model instance of SecurityGroupTargetCollectionNext by calling from_dict on the json representation
+ security_group_target_collection_next_model = SecurityGroupTargetCollectionNext.from_dict(security_group_target_collection_next_model_json)
+ assert security_group_target_collection_next_model != False
- # Construct a model instance of ReservedIPPatch by calling from_dict on the json representation
- reserved_ip_patch_model_dict = ReservedIPPatch.from_dict(reserved_ip_patch_model_json).__dict__
- reserved_ip_patch_model2 = ReservedIPPatch(**reserved_ip_patch_model_dict)
+ # Construct a model instance of SecurityGroupTargetCollectionNext by calling from_dict on the json representation
+ security_group_target_collection_next_model_dict = SecurityGroupTargetCollectionNext.from_dict(security_group_target_collection_next_model_json).__dict__
+ security_group_target_collection_next_model2 = SecurityGroupTargetCollectionNext(**security_group_target_collection_next_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_patch_model == reserved_ip_patch_model2
+ assert security_group_target_collection_next_model == security_group_target_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_patch_model_json2 = reserved_ip_patch_model.to_dict()
- assert reserved_ip_patch_model_json2 == reserved_ip_patch_model_json
+ security_group_target_collection_next_model_json2 = security_group_target_collection_next_model.to_dict()
+ assert security_group_target_collection_next_model_json2 == security_group_target_collection_next_model_json
-class TestModel_ReservedIPReference():
+class TestModel_Snapshot():
"""
- Test Class for ReservedIPReference
+ Test Class for Snapshot
"""
- def test_reserved_ip_reference_serialization(self):
+ def test_snapshot_serialization(self):
"""
- Test serialization/deserialization for ReservedIPReference
+ Test serialization/deserialization for Snapshot
"""
# Construct dict forms of any model objects needed in order to build this model.
- reserved_ip_reference_deleted_model = {} # ReservedIPReferenceDeleted
- reserved_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a ReservedIPReference model
- reserved_ip_reference_model_json = {}
- reserved_ip_reference_model_json['address'] = '192.168.3.4'
- reserved_ip_reference_model_json['deleted'] = reserved_ip_reference_deleted_model
- reserved_ip_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e/reserved_ips/6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model_json['id'] = '6d353a0f-aeb1-4ae1-832e-1110d10981bb'
- reserved_ip_reference_model_json['name'] = 'my-reserved-ip'
- reserved_ip_reference_model_json['resource_type'] = 'subnet_reserved_ip'
+ 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'
- # Construct a model instance of ReservedIPReference by calling from_dict on the json representation
- reserved_ip_reference_model = ReservedIPReference.from_dict(reserved_ip_reference_model_json)
- assert reserved_ip_reference_model != False
+ operating_system_model = {} # OperatingSystem
+ operating_system_model['architecture'] = 'amd64'
+ operating_system_model['dedicated_host_only'] = False
+ operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
+ operating_system_model['family'] = 'Ubuntu Server'
+ operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ operating_system_model['name'] = 'ubuntu-16-amd64'
+ operating_system_model['vendor'] = 'Canonical'
+ operating_system_model['version'] = '16.04 LTS'
- # Construct a model instance of ReservedIPReference by calling from_dict on the json representation
- reserved_ip_reference_model_dict = ReservedIPReference.from_dict(reserved_ip_reference_model_json).__dict__
- reserved_ip_reference_model2 = ReservedIPReference(**reserved_ip_reference_model_dict)
+ 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'
- # Verify the model instances are equivalent
- assert reserved_ip_reference_model == reserved_ip_reference_model2
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- reserved_ip_reference_model_json2 = reserved_ip_reference_model.to_dict()
- assert reserved_ip_reference_model_json2 == reserved_ip_reference_model_json
+ image_reference_model = {} # ImageReference
+ image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['deleted'] = image_reference_deleted_model
+ image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['name'] = 'my-image'
-class TestModel_ReservedIPReferenceDeleted():
- """
- Test Class for ReservedIPReferenceDeleted
- """
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_reserved_ip_reference_deleted_serialization(self):
- """
- Test serialization/deserialization for ReservedIPReferenceDeleted
- """
+ volume_reference_model = {} # VolumeReference
+ volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['deleted'] = volume_reference_deleted_model
+ volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['name'] = 'my-volume'
- # Construct a json representation of a ReservedIPReferenceDeleted model
- reserved_ip_reference_deleted_model_json = {}
- reserved_ip_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a Snapshot model
+ snapshot_model_json = {}
+ snapshot_model_json['bootable'] = True
+ snapshot_model_json['captured_at'] = "2019-01-01T12:00:00Z"
+ snapshot_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ snapshot_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_model_json['deletable'] = True
+ snapshot_model_json['encryption'] = 'provider_managed'
+ snapshot_model_json['encryption_key'] = encryption_key_reference_model
+ snapshot_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_model_json['lifecycle_state'] = 'stable'
+ snapshot_model_json['minimum_capacity'] = 1
+ snapshot_model_json['name'] = 'my-snapshot'
+ snapshot_model_json['operating_system'] = operating_system_model
+ snapshot_model_json['resource_group'] = resource_group_reference_model
+ snapshot_model_json['resource_type'] = 'snapshot'
+ snapshot_model_json['size'] = 1
+ snapshot_model_json['source_image'] = image_reference_model
+ snapshot_model_json['source_volume'] = volume_reference_model
- # Construct a model instance of ReservedIPReferenceDeleted by calling from_dict on the json representation
- reserved_ip_reference_deleted_model = ReservedIPReferenceDeleted.from_dict(reserved_ip_reference_deleted_model_json)
- assert reserved_ip_reference_deleted_model != False
+ # Construct a model instance of Snapshot by calling from_dict on the json representation
+ snapshot_model = Snapshot.from_dict(snapshot_model_json)
+ assert snapshot_model != False
- # Construct a model instance of ReservedIPReferenceDeleted by calling from_dict on the json representation
- reserved_ip_reference_deleted_model_dict = ReservedIPReferenceDeleted.from_dict(reserved_ip_reference_deleted_model_json).__dict__
- reserved_ip_reference_deleted_model2 = ReservedIPReferenceDeleted(**reserved_ip_reference_deleted_model_dict)
+ # Construct a model instance of Snapshot by calling from_dict on the json representation
+ snapshot_model_dict = Snapshot.from_dict(snapshot_model_json).__dict__
+ snapshot_model2 = Snapshot(**snapshot_model_dict)
# Verify the model instances are equivalent
- assert reserved_ip_reference_deleted_model == reserved_ip_reference_deleted_model2
+ assert snapshot_model == snapshot_model2
# Convert model instance back to dict and verify no loss of data
- reserved_ip_reference_deleted_model_json2 = reserved_ip_reference_deleted_model.to_dict()
- assert reserved_ip_reference_deleted_model_json2 == reserved_ip_reference_deleted_model_json
+ snapshot_model_json2 = snapshot_model.to_dict()
+ assert snapshot_model_json2 == snapshot_model_json
-class TestModel_ResourceGroupReference():
+class TestModel_SnapshotCollection():
"""
- Test Class for ResourceGroupReference
+ Test Class for SnapshotCollection
"""
- def test_resource_group_reference_serialization(self):
+ def test_snapshot_collection_serialization(self):
"""
- Test serialization/deserialization for ResourceGroupReference
+ Test serialization/deserialization for SnapshotCollection
"""
- # Construct a json representation of a ResourceGroupReference model
- resource_group_reference_model_json = {}
- resource_group_reference_model_json['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model_json['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model_json['name'] = 'my-resource-group'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of ResourceGroupReference by calling from_dict on the json representation
- resource_group_reference_model = ResourceGroupReference.from_dict(resource_group_reference_model_json)
- assert resource_group_reference_model != False
+ snapshot_collection_first_model = {} # SnapshotCollectionFirst
+ snapshot_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20'
- # Construct a model instance of ResourceGroupReference by calling from_dict on the json representation
- resource_group_reference_model_dict = ResourceGroupReference.from_dict(resource_group_reference_model_json).__dict__
- resource_group_reference_model2 = ResourceGroupReference(**resource_group_reference_model_dict)
+ snapshot_collection_next_model = {} # SnapshotCollectionNext
+ snapshot_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Verify the model instances are equivalent
- assert resource_group_reference_model == resource_group_reference_model2
+ 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'
- # Convert model instance back to dict and verify no loss of data
- resource_group_reference_model_json2 = resource_group_reference_model.to_dict()
- assert resource_group_reference_model_json2 == resource_group_reference_model_json
+ operating_system_model = {} # OperatingSystem
+ operating_system_model['architecture'] = 'amd64'
+ operating_system_model['dedicated_host_only'] = False
+ operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
+ operating_system_model['family'] = 'Ubuntu Server'
+ operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ operating_system_model['name'] = 'ubuntu-16-amd64'
+ operating_system_model['vendor'] = 'Canonical'
+ operating_system_model['version'] = '16.04 LTS'
-class TestModel_Route():
- """
- Test Class for Route
- """
+ 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'
- def test_route_serialization(self):
- """
- Test serialization/deserialization for Route
- """
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct dict forms of any model objects needed in order to build this model.
+ image_reference_model = {} # ImageReference
+ image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['deleted'] = image_reference_deleted_model
+ image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['name'] = 'my-image'
- route_next_hop_model = {} # RouteNextHopIP
- route_next_hop_model['address'] = '192.168.3.4'
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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'
+ volume_reference_model = {} # VolumeReference
+ volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['deleted'] = volume_reference_deleted_model
+ volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['name'] = 'my-volume'
- # Construct a json representation of a Route model
- route_model_json = {}
- route_model_json['action'] = 'delegate'
- route_model_json['created_at'] = "2019-01-01T12:00:00Z"
- route_model_json['destination'] = '192.168.3.0/24'
- route_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_model_json['lifecycle_state'] = 'stable'
- route_model_json['name'] = 'my-route-1'
- route_model_json['next_hop'] = route_next_hop_model
- route_model_json['zone'] = zone_reference_model
+ snapshot_model = {} # Snapshot
+ snapshot_model['bootable'] = True
+ snapshot_model['captured_at'] = "2019-01-01T12:00:00Z"
+ snapshot_model['created_at'] = "2019-01-01T12:00:00Z"
+ snapshot_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_model['deletable'] = True
+ snapshot_model['encryption'] = 'provider_managed'
+ snapshot_model['encryption_key'] = encryption_key_reference_model
+ snapshot_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_model['lifecycle_state'] = 'stable'
+ snapshot_model['minimum_capacity'] = 1
+ snapshot_model['name'] = 'my-snapshot'
+ snapshot_model['operating_system'] = operating_system_model
+ snapshot_model['resource_group'] = resource_group_reference_model
+ snapshot_model['resource_type'] = 'snapshot'
+ snapshot_model['size'] = 1
+ snapshot_model['source_image'] = image_reference_model
+ snapshot_model['source_volume'] = volume_reference_model
- # Construct a model instance of Route by calling from_dict on the json representation
- route_model = Route.from_dict(route_model_json)
- assert route_model != False
+ # Construct a json representation of a SnapshotCollection model
+ snapshot_collection_model_json = {}
+ snapshot_collection_model_json['first'] = snapshot_collection_first_model
+ snapshot_collection_model_json['limit'] = 20
+ snapshot_collection_model_json['next'] = snapshot_collection_next_model
+ snapshot_collection_model_json['snapshots'] = [snapshot_model]
+ snapshot_collection_model_json['total_count'] = 132
- # Construct a model instance of Route by calling from_dict on the json representation
- route_model_dict = Route.from_dict(route_model_json).__dict__
- route_model2 = Route(**route_model_dict)
+ # Construct a model instance of SnapshotCollection by calling from_dict on the json representation
+ snapshot_collection_model = SnapshotCollection.from_dict(snapshot_collection_model_json)
+ assert snapshot_collection_model != False
+
+ # Construct a model instance of SnapshotCollection by calling from_dict on the json representation
+ snapshot_collection_model_dict = SnapshotCollection.from_dict(snapshot_collection_model_json).__dict__
+ snapshot_collection_model2 = SnapshotCollection(**snapshot_collection_model_dict)
# Verify the model instances are equivalent
- assert route_model == route_model2
+ assert snapshot_collection_model == snapshot_collection_model2
# Convert model instance back to dict and verify no loss of data
- route_model_json2 = route_model.to_dict()
- assert route_model_json2 == route_model_json
+ snapshot_collection_model_json2 = snapshot_collection_model.to_dict()
+ assert snapshot_collection_model_json2 == snapshot_collection_model_json
-class TestModel_RouteCollection():
+class TestModel_SnapshotCollectionFirst():
"""
- Test Class for RouteCollection
+ Test Class for SnapshotCollectionFirst
"""
- def test_route_collection_serialization(self):
+ def test_snapshot_collection_first_serialization(self):
"""
- Test serialization/deserialization for RouteCollection
+ Test serialization/deserialization for SnapshotCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a SnapshotCollectionFirst model
+ snapshot_collection_first_model_json = {}
+ snapshot_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20'
- route_collection_first_model = {} # RouteCollectionFirst
- route_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20'
+ # Construct a model instance of SnapshotCollectionFirst by calling from_dict on the json representation
+ snapshot_collection_first_model = SnapshotCollectionFirst.from_dict(snapshot_collection_first_model_json)
+ assert snapshot_collection_first_model != False
- route_collection_next_model = {} # RouteCollectionNext
- route_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
+ # Construct a model instance of SnapshotCollectionFirst by calling from_dict on the json representation
+ snapshot_collection_first_model_dict = SnapshotCollectionFirst.from_dict(snapshot_collection_first_model_json).__dict__
+ snapshot_collection_first_model2 = SnapshotCollectionFirst(**snapshot_collection_first_model_dict)
- route_next_hop_model = {} # RouteNextHopIP
- route_next_hop_model['address'] = '192.168.3.4'
+ # Verify the model instances are equivalent
+ assert snapshot_collection_first_model == snapshot_collection_first_model2
- 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'
+ # Convert model instance back to dict and verify no loss of data
+ snapshot_collection_first_model_json2 = snapshot_collection_first_model.to_dict()
+ assert snapshot_collection_first_model_json2 == snapshot_collection_first_model_json
- route_model = {} # Route
- route_model['action'] = 'delegate'
- route_model['created_at'] = "2019-01-01T12:00:00Z"
- route_model['destination'] = '192.168.3.0/24'
- route_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_model['lifecycle_state'] = 'stable'
- route_model['name'] = 'my-route-1'
- route_model['next_hop'] = route_next_hop_model
- route_model['zone'] = zone_reference_model
+class TestModel_SnapshotCollectionNext():
+ """
+ Test Class for SnapshotCollectionNext
+ """
- # Construct a json representation of a RouteCollection model
- route_collection_model_json = {}
- route_collection_model_json['first'] = route_collection_first_model
- route_collection_model_json['limit'] = 20
- route_collection_model_json['next'] = route_collection_next_model
- route_collection_model_json['routes'] = [route_model]
- route_collection_model_json['total_count'] = 132
+ def test_snapshot_collection_next_serialization(self):
+ """
+ Test serialization/deserialization for SnapshotCollectionNext
+ """
- # Construct a model instance of RouteCollection by calling from_dict on the json representation
- route_collection_model = RouteCollection.from_dict(route_collection_model_json)
- assert route_collection_model != False
+ # Construct a json representation of a SnapshotCollectionNext model
+ snapshot_collection_next_model_json = {}
+ snapshot_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of RouteCollection by calling from_dict on the json representation
- route_collection_model_dict = RouteCollection.from_dict(route_collection_model_json).__dict__
- route_collection_model2 = RouteCollection(**route_collection_model_dict)
+ # Construct a model instance of SnapshotCollectionNext by calling from_dict on the json representation
+ snapshot_collection_next_model = SnapshotCollectionNext.from_dict(snapshot_collection_next_model_json)
+ assert snapshot_collection_next_model != False
+
+ # Construct a model instance of SnapshotCollectionNext by calling from_dict on the json representation
+ snapshot_collection_next_model_dict = SnapshotCollectionNext.from_dict(snapshot_collection_next_model_json).__dict__
+ snapshot_collection_next_model2 = SnapshotCollectionNext(**snapshot_collection_next_model_dict)
# Verify the model instances are equivalent
- assert route_collection_model == route_collection_model2
+ assert snapshot_collection_next_model == snapshot_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- route_collection_model_json2 = route_collection_model.to_dict()
- assert route_collection_model_json2 == route_collection_model_json
+ snapshot_collection_next_model_json2 = snapshot_collection_next_model.to_dict()
+ assert snapshot_collection_next_model_json2 == snapshot_collection_next_model_json
-class TestModel_RouteCollectionFirst():
+class TestModel_SnapshotPatch():
"""
- Test Class for RouteCollectionFirst
+ Test Class for SnapshotPatch
"""
- def test_route_collection_first_serialization(self):
+ def test_snapshot_patch_serialization(self):
"""
- Test serialization/deserialization for RouteCollectionFirst
+ Test serialization/deserialization for SnapshotPatch
"""
- # Construct a json representation of a RouteCollectionFirst model
- route_collection_first_model_json = {}
- route_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?limit=20'
+ # Construct a json representation of a SnapshotPatch model
+ snapshot_patch_model_json = {}
+ snapshot_patch_model_json['name'] = 'my-snapshot'
- # Construct a model instance of RouteCollectionFirst by calling from_dict on the json representation
- route_collection_first_model = RouteCollectionFirst.from_dict(route_collection_first_model_json)
- assert route_collection_first_model != False
+ # Construct a model instance of SnapshotPatch by calling from_dict on the json representation
+ snapshot_patch_model = SnapshotPatch.from_dict(snapshot_patch_model_json)
+ assert snapshot_patch_model != False
- # Construct a model instance of RouteCollectionFirst by calling from_dict on the json representation
- route_collection_first_model_dict = RouteCollectionFirst.from_dict(route_collection_first_model_json).__dict__
- route_collection_first_model2 = RouteCollectionFirst(**route_collection_first_model_dict)
+ # Construct a model instance of SnapshotPatch by calling from_dict on the json representation
+ snapshot_patch_model_dict = SnapshotPatch.from_dict(snapshot_patch_model_json).__dict__
+ snapshot_patch_model2 = SnapshotPatch(**snapshot_patch_model_dict)
# Verify the model instances are equivalent
- assert route_collection_first_model == route_collection_first_model2
+ assert snapshot_patch_model == snapshot_patch_model2
# Convert model instance back to dict and verify no loss of data
- route_collection_first_model_json2 = route_collection_first_model.to_dict()
- assert route_collection_first_model_json2 == route_collection_first_model_json
+ snapshot_patch_model_json2 = snapshot_patch_model.to_dict()
+ assert snapshot_patch_model_json2 == snapshot_patch_model_json
-class TestModel_RouteCollectionNext():
+class TestModel_SnapshotReference():
"""
- Test Class for RouteCollectionNext
+ Test Class for SnapshotReference
"""
- def test_route_collection_next_serialization(self):
+ def test_snapshot_reference_serialization(self):
"""
- Test serialization/deserialization for RouteCollectionNext
+ Test serialization/deserialization for SnapshotReference
"""
- # Construct a json representation of a RouteCollectionNext model
- route_collection_next_model_json = {}
- route_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/1a15dca5-7e33-45e1-b7c5-bc690e569531/routes?start=a5e812a2-62c0-4555-86a5-907106760c56&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a json representation of a SnapshotReference model
+ snapshot_reference_model_json = {}
+ snapshot_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_reference_model_json['deleted'] = snapshot_reference_deleted_model
+ snapshot_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_reference_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_reference_model_json['name'] = 'my-snapshot'
+ snapshot_reference_model_json['resource_type'] = 'snapshot'
- # Construct a model instance of RouteCollectionNext by calling from_dict on the json representation
- route_collection_next_model = RouteCollectionNext.from_dict(route_collection_next_model_json)
- assert route_collection_next_model != False
+ # Construct a model instance of SnapshotReference by calling from_dict on the json representation
+ snapshot_reference_model = SnapshotReference.from_dict(snapshot_reference_model_json)
+ assert snapshot_reference_model != False
- # Construct a model instance of RouteCollectionNext by calling from_dict on the json representation
- route_collection_next_model_dict = RouteCollectionNext.from_dict(route_collection_next_model_json).__dict__
- route_collection_next_model2 = RouteCollectionNext(**route_collection_next_model_dict)
+ # Construct a model instance of SnapshotReference by calling from_dict on the json representation
+ snapshot_reference_model_dict = SnapshotReference.from_dict(snapshot_reference_model_json).__dict__
+ snapshot_reference_model2 = SnapshotReference(**snapshot_reference_model_dict)
# Verify the model instances are equivalent
- assert route_collection_next_model == route_collection_next_model2
+ assert snapshot_reference_model == snapshot_reference_model2
# Convert model instance back to dict and verify no loss of data
- route_collection_next_model_json2 = route_collection_next_model.to_dict()
- assert route_collection_next_model_json2 == route_collection_next_model_json
+ snapshot_reference_model_json2 = snapshot_reference_model.to_dict()
+ assert snapshot_reference_model_json2 == snapshot_reference_model_json
-class TestModel_RoutePatch():
+class TestModel_SnapshotReferenceDeleted():
"""
- Test Class for RoutePatch
+ Test Class for SnapshotReferenceDeleted
"""
- def test_route_patch_serialization(self):
+ def test_snapshot_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for RoutePatch
+ Test serialization/deserialization for SnapshotReferenceDeleted
"""
- # Construct a json representation of a RoutePatch model
- route_patch_model_json = {}
- route_patch_model_json['name'] = 'my-route-2'
+ # Construct a json representation of a SnapshotReferenceDeleted model
+ snapshot_reference_deleted_model_json = {}
+ snapshot_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of RoutePatch by calling from_dict on the json representation
- route_patch_model = RoutePatch.from_dict(route_patch_model_json)
- assert route_patch_model != False
+ # Construct a model instance of SnapshotReferenceDeleted by calling from_dict on the json representation
+ snapshot_reference_deleted_model = SnapshotReferenceDeleted.from_dict(snapshot_reference_deleted_model_json)
+ assert snapshot_reference_deleted_model != False
- # Construct a model instance of RoutePatch by calling from_dict on the json representation
- route_patch_model_dict = RoutePatch.from_dict(route_patch_model_json).__dict__
- route_patch_model2 = RoutePatch(**route_patch_model_dict)
+ # Construct a model instance of SnapshotReferenceDeleted by calling from_dict on the json representation
+ snapshot_reference_deleted_model_dict = SnapshotReferenceDeleted.from_dict(snapshot_reference_deleted_model_json).__dict__
+ snapshot_reference_deleted_model2 = SnapshotReferenceDeleted(**snapshot_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert route_patch_model == route_patch_model2
+ assert snapshot_reference_deleted_model == snapshot_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- route_patch_model_json2 = route_patch_model.to_dict()
- assert route_patch_model_json2 == route_patch_model_json
+ snapshot_reference_deleted_model_json2 = snapshot_reference_deleted_model.to_dict()
+ assert snapshot_reference_deleted_model_json2 == snapshot_reference_deleted_model_json
-class TestModel_RoutePrototype():
+class TestModel_Subnet():
"""
- Test Class for RoutePrototype
+ Test Class for Subnet
"""
- def test_route_prototype_serialization(self):
+ def test_subnet_serialization(self):
"""
- Test serialization/deserialization for RoutePrototype
+ Test serialization/deserialization for Subnet
"""
# Construct dict forms of any model objects needed in order to build this model.
- route_next_hop_prototype_model = {} # RouteNextHopPrototypeRouteNextHopIP
- route_next_hop_prototype_model['address'] = '192.168.3.4'
-
- zone_identity_model = {} # ZoneIdentityByName
- zone_identity_model['name'] = 'us-south-1'
+ network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
+ network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a RoutePrototype model
- route_prototype_model_json = {}
- route_prototype_model_json['action'] = 'deliver'
- route_prototype_model_json['destination'] = '192.168.3.0/24'
- route_prototype_model_json['name'] = 'my-route-2'
- route_prototype_model_json['next_hop'] = route_next_hop_prototype_model
- route_prototype_model_json['zone'] = zone_identity_model
+ network_acl_reference_model = {} # NetworkACLReference
+ network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['deleted'] = network_acl_reference_deleted_model
+ network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['name'] = 'my-network-acl'
- # Construct a model instance of RoutePrototype by calling from_dict on the json representation
- route_prototype_model = RoutePrototype.from_dict(route_prototype_model_json)
- assert route_prototype_model != False
+ public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted
+ public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of RoutePrototype by calling from_dict on the json representation
- route_prototype_model_dict = RoutePrototype.from_dict(route_prototype_model_json).__dict__
- route_prototype_model2 = RoutePrototype(**route_prototype_model_dict)
+ public_gateway_reference_model = {} # PublicGatewayReference
+ public_gateway_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_reference_model['deleted'] = public_gateway_reference_deleted_model
+ public_gateway_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_reference_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_reference_model['name'] = 'my-public-gateway'
+ public_gateway_reference_model['resource_type'] = 'public_gateway'
- # Verify the model instances are equivalent
- assert route_prototype_model == route_prototype_model2
+ 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'
- # Convert model instance back to dict and verify no loss of data
- route_prototype_model_json2 = route_prototype_model.to_dict()
- assert route_prototype_model_json2 == route_prototype_model_json
+ routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
+ routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_RouteReference():
- """
- Test Class for RouteReference
- """
+ routing_table_reference_model = {} # RoutingTableReference
+ routing_table_reference_model['deleted'] = routing_table_reference_deleted_model
+ routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
+ routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ routing_table_reference_model['name'] = 'my-routing-table-1'
+ routing_table_reference_model['resource_type'] = 'routing_table'
- def test_route_reference_serialization(self):
- """
- Test serialization/deserialization for RouteReference
- """
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct dict forms of any model objects needed in order to build this model.
+ vpc_reference_model = {} # VPCReference
+ vpc_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/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'
- route_reference_deleted_model = {} # RouteReferenceDeleted
- route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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 RouteReference model
- route_reference_model_json = {}
- route_reference_model_json['deleted'] = route_reference_deleted_model
- route_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model_json['name'] = 'my-route-1'
+ # Construct a json representation of a Subnet model
+ subnet_model_json = {}
+ subnet_model_json['available_ipv4_address_count'] = 15
+ subnet_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ subnet_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_model_json['ip_version'] = 'ipv4'
+ subnet_model_json['ipv4_cidr_block'] = '10.0.0.0/24'
+ subnet_model_json['name'] = 'my-subnet'
+ subnet_model_json['network_acl'] = network_acl_reference_model
+ subnet_model_json['public_gateway'] = public_gateway_reference_model
+ subnet_model_json['resource_group'] = resource_group_reference_model
+ subnet_model_json['routing_table'] = routing_table_reference_model
+ subnet_model_json['status'] = 'available'
+ subnet_model_json['total_ipv4_address_count'] = 256
+ subnet_model_json['vpc'] = vpc_reference_model
+ subnet_model_json['zone'] = zone_reference_model
- # Construct a model instance of RouteReference by calling from_dict on the json representation
- route_reference_model = RouteReference.from_dict(route_reference_model_json)
- assert route_reference_model != False
+ # Construct a model instance of Subnet by calling from_dict on the json representation
+ subnet_model = Subnet.from_dict(subnet_model_json)
+ assert subnet_model != False
- # Construct a model instance of RouteReference by calling from_dict on the json representation
- route_reference_model_dict = RouteReference.from_dict(route_reference_model_json).__dict__
- route_reference_model2 = RouteReference(**route_reference_model_dict)
+ # Construct a model instance of Subnet by calling from_dict on the json representation
+ subnet_model_dict = Subnet.from_dict(subnet_model_json).__dict__
+ subnet_model2 = Subnet(**subnet_model_dict)
# Verify the model instances are equivalent
- assert route_reference_model == route_reference_model2
+ assert subnet_model == subnet_model2
# Convert model instance back to dict and verify no loss of data
- route_reference_model_json2 = route_reference_model.to_dict()
- assert route_reference_model_json2 == route_reference_model_json
+ subnet_model_json2 = subnet_model.to_dict()
+ assert subnet_model_json2 == subnet_model_json
-class TestModel_RouteReferenceDeleted():
+class TestModel_SubnetCollection():
"""
- Test Class for RouteReferenceDeleted
+ Test Class for SubnetCollection
"""
- def test_route_reference_deleted_serialization(self):
+ def test_subnet_collection_serialization(self):
"""
- Test serialization/deserialization for RouteReferenceDeleted
+ Test serialization/deserialization for SubnetCollection
"""
- # Construct a json representation of a RouteReferenceDeleted model
- route_reference_deleted_model_json = {}
- route_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of RouteReferenceDeleted by calling from_dict on the json representation
- route_reference_deleted_model = RouteReferenceDeleted.from_dict(route_reference_deleted_model_json)
- assert route_reference_deleted_model != False
+ subnet_collection_first_model = {} # SubnetCollectionFirst
+ subnet_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20'
- # Construct a model instance of RouteReferenceDeleted by calling from_dict on the json representation
- route_reference_deleted_model_dict = RouteReferenceDeleted.from_dict(route_reference_deleted_model_json).__dict__
- route_reference_deleted_model2 = RouteReferenceDeleted(**route_reference_deleted_model_dict)
+ subnet_collection_next_model = {} # SubnetCollectionNext
+ subnet_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Verify the model instances are equivalent
- assert route_reference_deleted_model == route_reference_deleted_model2
+ network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
+ network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- route_reference_deleted_model_json2 = route_reference_deleted_model.to_dict()
- assert route_reference_deleted_model_json2 == route_reference_deleted_model_json
+ network_acl_reference_model = {} # NetworkACLReference
+ network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['deleted'] = network_acl_reference_deleted_model
+ network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['name'] = 'my-network-acl'
-class TestModel_RoutingTable():
- """
- Test Class for RoutingTable
- """
+ public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted
+ public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_routing_table_serialization(self):
- """
- Test serialization/deserialization for RoutingTable
- """
+ public_gateway_reference_model = {} # PublicGatewayReference
+ public_gateway_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_reference_model['deleted'] = public_gateway_reference_deleted_model
+ public_gateway_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_reference_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ public_gateway_reference_model['name'] = 'my-public-gateway'
+ public_gateway_reference_model['resource_type'] = 'public_gateway'
- # Construct dict forms of any model objects needed in order to build this model.
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
- route_reference_deleted_model = {} # RouteReferenceDeleted
- route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
+ routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- route_reference_model = {} # RouteReference
- route_reference_model['deleted'] = route_reference_deleted_model
- route_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model['name'] = 'my-route-1'
+ routing_table_reference_model = {} # RoutingTableReference
+ routing_table_reference_model['deleted'] = routing_table_reference_deleted_model
+ routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
+ routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ routing_table_reference_model['name'] = 'my-routing-table-1'
+ routing_table_reference_model['resource_type'] = 'routing_table'
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_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'
+ 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'
- # Construct a json representation of a RoutingTable model
- routing_table_model_json = {}
- routing_table_model_json['created_at'] = "2019-01-01T12:00:00Z"
- routing_table_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
- routing_table_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- routing_table_model_json['is_default'] = True
- routing_table_model_json['lifecycle_state'] = 'stable'
- routing_table_model_json['name'] = 'my-routing-table-1'
- routing_table_model_json['resource_type'] = 'routing_table'
- routing_table_model_json['route_direct_link_ingress'] = True
- routing_table_model_json['route_transit_gateway_ingress'] = True
- routing_table_model_json['route_vpc_zone_ingress'] = True
- routing_table_model_json['routes'] = [route_reference_model]
- routing_table_model_json['subnets'] = [subnet_reference_model]
+ zone_reference_model = {} # ZoneReference
+ zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model['name'] = 'us-south-1'
- # Construct a model instance of RoutingTable by calling from_dict on the json representation
- routing_table_model = RoutingTable.from_dict(routing_table_model_json)
- assert routing_table_model != False
+ subnet_model = {} # Subnet
+ subnet_model['available_ipv4_address_count'] = 15
+ subnet_model['created_at'] = "2019-01-01T12:00:00Z"
+ subnet_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_model['ip_version'] = 'ipv4'
+ subnet_model['ipv4_cidr_block'] = '10.0.0.0/24'
+ subnet_model['name'] = 'my-subnet'
+ subnet_model['network_acl'] = network_acl_reference_model
+ subnet_model['public_gateway'] = public_gateway_reference_model
+ subnet_model['resource_group'] = resource_group_reference_model
+ subnet_model['routing_table'] = routing_table_reference_model
+ subnet_model['status'] = 'available'
+ subnet_model['total_ipv4_address_count'] = 256
+ subnet_model['vpc'] = vpc_reference_model
+ subnet_model['zone'] = zone_reference_model
- # Construct a model instance of RoutingTable by calling from_dict on the json representation
- routing_table_model_dict = RoutingTable.from_dict(routing_table_model_json).__dict__
- routing_table_model2 = RoutingTable(**routing_table_model_dict)
+ # Construct a json representation of a SubnetCollection model
+ subnet_collection_model_json = {}
+ subnet_collection_model_json['first'] = subnet_collection_first_model
+ subnet_collection_model_json['limit'] = 20
+ subnet_collection_model_json['next'] = subnet_collection_next_model
+ subnet_collection_model_json['subnets'] = [subnet_model]
+ subnet_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of SubnetCollection by calling from_dict on the json representation
+ subnet_collection_model = SubnetCollection.from_dict(subnet_collection_model_json)
+ assert subnet_collection_model != False
+
+ # Construct a model instance of SubnetCollection by calling from_dict on the json representation
+ subnet_collection_model_dict = SubnetCollection.from_dict(subnet_collection_model_json).__dict__
+ subnet_collection_model2 = SubnetCollection(**subnet_collection_model_dict)
# Verify the model instances are equivalent
- assert routing_table_model == routing_table_model2
+ assert subnet_collection_model == subnet_collection_model2
# Convert model instance back to dict and verify no loss of data
- routing_table_model_json2 = routing_table_model.to_dict()
- assert routing_table_model_json2 == routing_table_model_json
+ subnet_collection_model_json2 = subnet_collection_model.to_dict()
+ assert subnet_collection_model_json2 == subnet_collection_model_json
-class TestModel_RoutingTableCollection():
+class TestModel_SubnetCollectionFirst():
"""
- Test Class for RoutingTableCollection
+ Test Class for SubnetCollectionFirst
"""
- def test_routing_table_collection_serialization(self):
+ def test_subnet_collection_first_serialization(self):
"""
- Test serialization/deserialization for RoutingTableCollection
+ Test serialization/deserialization for SubnetCollectionFirst
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- routing_table_collection_first_model = {} # RoutingTableCollectionFirst
- routing_table_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20'
-
- routing_table_collection_next_model = {} # RoutingTableCollectionNext
- routing_table_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- route_reference_deleted_model = {} # RouteReferenceDeleted
- route_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- route_reference_model = {} # RouteReference
- route_reference_model['deleted'] = route_reference_deleted_model
- route_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/8e454ead-0db7-48ac-9a8b-2698d8c470a7/routes/1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- route_reference_model['name'] = 'my-route-1'
-
- 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'
-
- routing_table_model = {} # RoutingTable
- routing_table_model['created_at'] = "2019-01-01T12:00:00Z"
- routing_table_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
- routing_table_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- routing_table_model['is_default'] = True
- routing_table_model['lifecycle_state'] = 'stable'
- routing_table_model['name'] = 'my-routing-table-1'
- routing_table_model['resource_type'] = 'routing_table'
- routing_table_model['route_direct_link_ingress'] = True
- routing_table_model['route_transit_gateway_ingress'] = True
- routing_table_model['route_vpc_zone_ingress'] = True
- routing_table_model['routes'] = [route_reference_model]
- routing_table_model['subnets'] = [subnet_reference_model]
-
- # Construct a json representation of a RoutingTableCollection model
- routing_table_collection_model_json = {}
- routing_table_collection_model_json['first'] = routing_table_collection_first_model
- routing_table_collection_model_json['limit'] = 20
- routing_table_collection_model_json['next'] = routing_table_collection_next_model
- routing_table_collection_model_json['routing_tables'] = [routing_table_model]
- routing_table_collection_model_json['total_count'] = 132
+ # Construct a json representation of a SubnetCollectionFirst model
+ subnet_collection_first_model_json = {}
+ subnet_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20'
- # Construct a model instance of RoutingTableCollection by calling from_dict on the json representation
- routing_table_collection_model = RoutingTableCollection.from_dict(routing_table_collection_model_json)
- assert routing_table_collection_model != False
+ # Construct a model instance of SubnetCollectionFirst by calling from_dict on the json representation
+ subnet_collection_first_model = SubnetCollectionFirst.from_dict(subnet_collection_first_model_json)
+ assert subnet_collection_first_model != False
- # Construct a model instance of RoutingTableCollection by calling from_dict on the json representation
- routing_table_collection_model_dict = RoutingTableCollection.from_dict(routing_table_collection_model_json).__dict__
- routing_table_collection_model2 = RoutingTableCollection(**routing_table_collection_model_dict)
+ # Construct a model instance of SubnetCollectionFirst by calling from_dict on the json representation
+ subnet_collection_first_model_dict = SubnetCollectionFirst.from_dict(subnet_collection_first_model_json).__dict__
+ subnet_collection_first_model2 = SubnetCollectionFirst(**subnet_collection_first_model_dict)
# Verify the model instances are equivalent
- assert routing_table_collection_model == routing_table_collection_model2
+ assert subnet_collection_first_model == subnet_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- routing_table_collection_model_json2 = routing_table_collection_model.to_dict()
- assert routing_table_collection_model_json2 == routing_table_collection_model_json
+ subnet_collection_first_model_json2 = subnet_collection_first_model.to_dict()
+ assert subnet_collection_first_model_json2 == subnet_collection_first_model_json
-class TestModel_RoutingTableCollectionFirst():
+class TestModel_SubnetCollectionNext():
"""
- Test Class for RoutingTableCollectionFirst
+ Test Class for SubnetCollectionNext
"""
- def test_routing_table_collection_first_serialization(self):
+ def test_subnet_collection_next_serialization(self):
"""
- Test serialization/deserialization for RoutingTableCollectionFirst
+ Test serialization/deserialization for SubnetCollectionNext
"""
- # Construct a json representation of a RoutingTableCollectionFirst model
- routing_table_collection_first_model_json = {}
- routing_table_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?limit=20'
+ # Construct a json representation of a SubnetCollectionNext model
+ subnet_collection_next_model_json = {}
+ subnet_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of RoutingTableCollectionFirst by calling from_dict on the json representation
- routing_table_collection_first_model = RoutingTableCollectionFirst.from_dict(routing_table_collection_first_model_json)
- assert routing_table_collection_first_model != False
+ # Construct a model instance of SubnetCollectionNext by calling from_dict on the json representation
+ subnet_collection_next_model = SubnetCollectionNext.from_dict(subnet_collection_next_model_json)
+ assert subnet_collection_next_model != False
- # Construct a model instance of RoutingTableCollectionFirst by calling from_dict on the json representation
- routing_table_collection_first_model_dict = RoutingTableCollectionFirst.from_dict(routing_table_collection_first_model_json).__dict__
- routing_table_collection_first_model2 = RoutingTableCollectionFirst(**routing_table_collection_first_model_dict)
+ # Construct a model instance of SubnetCollectionNext by calling from_dict on the json representation
+ subnet_collection_next_model_dict = SubnetCollectionNext.from_dict(subnet_collection_next_model_json).__dict__
+ subnet_collection_next_model2 = SubnetCollectionNext(**subnet_collection_next_model_dict)
# Verify the model instances are equivalent
- assert routing_table_collection_first_model == routing_table_collection_first_model2
+ assert subnet_collection_next_model == subnet_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- routing_table_collection_first_model_json2 = routing_table_collection_first_model.to_dict()
- assert routing_table_collection_first_model_json2 == routing_table_collection_first_model_json
+ subnet_collection_next_model_json2 = subnet_collection_next_model.to_dict()
+ assert subnet_collection_next_model_json2 == subnet_collection_next_model_json
-class TestModel_RoutingTableCollectionNext():
+class TestModel_SubnetPatch():
"""
- Test Class for RoutingTableCollectionNext
+ Test Class for SubnetPatch
"""
- def test_routing_table_collection_next_serialization(self):
+ def test_subnet_patch_serialization(self):
"""
- Test serialization/deserialization for RoutingTableCollectionNext
+ Test serialization/deserialization for SubnetPatch
"""
- # Construct a json representation of a RoutingTableCollectionNext model
- routing_table_collection_next_model_json = {}
- routing_table_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of RoutingTableCollectionNext by calling from_dict on the json representation
- routing_table_collection_next_model = RoutingTableCollectionNext.from_dict(routing_table_collection_next_model_json)
- assert routing_table_collection_next_model != False
+ network_acl_identity_model = {} # NetworkACLIdentityById
+ network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- # Construct a model instance of RoutingTableCollectionNext by calling from_dict on the json representation
- routing_table_collection_next_model_dict = RoutingTableCollectionNext.from_dict(routing_table_collection_next_model_json).__dict__
- routing_table_collection_next_model2 = RoutingTableCollectionNext(**routing_table_collection_next_model_dict)
+ subnet_public_gateway_patch_model = {} # SubnetPublicGatewayPatchPublicGatewayIdentityById
+ subnet_public_gateway_patch_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+
+ routing_table_identity_model = {} # RoutingTableIdentityById
+ routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840'
+
+ # Construct a json representation of a SubnetPatch model
+ subnet_patch_model_json = {}
+ subnet_patch_model_json['name'] = 'my-subnet'
+ subnet_patch_model_json['network_acl'] = network_acl_identity_model
+ subnet_patch_model_json['public_gateway'] = subnet_public_gateway_patch_model
+ subnet_patch_model_json['routing_table'] = routing_table_identity_model
+
+ # Construct a model instance of SubnetPatch by calling from_dict on the json representation
+ subnet_patch_model = SubnetPatch.from_dict(subnet_patch_model_json)
+ assert subnet_patch_model != False
+
+ # Construct a model instance of SubnetPatch by calling from_dict on the json representation
+ subnet_patch_model_dict = SubnetPatch.from_dict(subnet_patch_model_json).__dict__
+ subnet_patch_model2 = SubnetPatch(**subnet_patch_model_dict)
# Verify the model instances are equivalent
- assert routing_table_collection_next_model == routing_table_collection_next_model2
+ assert subnet_patch_model == subnet_patch_model2
# Convert model instance back to dict and verify no loss of data
- routing_table_collection_next_model_json2 = routing_table_collection_next_model.to_dict()
- assert routing_table_collection_next_model_json2 == routing_table_collection_next_model_json
+ subnet_patch_model_json2 = subnet_patch_model.to_dict()
+ assert subnet_patch_model_json2 == subnet_patch_model_json
-class TestModel_RoutingTablePatch():
+class TestModel_SubnetReference():
"""
- Test Class for RoutingTablePatch
+ Test Class for SubnetReference
"""
- def test_routing_table_patch_serialization(self):
+ def test_subnet_reference_serialization(self):
"""
- Test serialization/deserialization for RoutingTablePatch
+ Test serialization/deserialization for SubnetReference
"""
- # Construct a json representation of a RoutingTablePatch model
- routing_table_patch_model_json = {}
- routing_table_patch_model_json['name'] = 'my-routing-table-2'
- routing_table_patch_model_json['route_direct_link_ingress'] = True
- routing_table_patch_model_json['route_transit_gateway_ingress'] = True
- routing_table_patch_model_json['route_vpc_zone_ingress'] = True
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of RoutingTablePatch by calling from_dict on the json representation
- routing_table_patch_model = RoutingTablePatch.from_dict(routing_table_patch_model_json)
- assert routing_table_patch_model != False
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of RoutingTablePatch by calling from_dict on the json representation
- routing_table_patch_model_dict = RoutingTablePatch.from_dict(routing_table_patch_model_json).__dict__
- routing_table_patch_model2 = RoutingTablePatch(**routing_table_patch_model_dict)
+ # Construct a json representation of a SubnetReference model
+ subnet_reference_model_json = {}
+ subnet_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model_json['deleted'] = subnet_reference_deleted_model
+ subnet_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
+ subnet_reference_model_json['name'] = 'my-subnet'
+
+ # Construct a model instance of SubnetReference by calling from_dict on the json representation
+ subnet_reference_model = SubnetReference.from_dict(subnet_reference_model_json)
+ assert subnet_reference_model != False
+
+ # Construct a model instance of SubnetReference by calling from_dict on the json representation
+ subnet_reference_model_dict = SubnetReference.from_dict(subnet_reference_model_json).__dict__
+ subnet_reference_model2 = SubnetReference(**subnet_reference_model_dict)
# Verify the model instances are equivalent
- assert routing_table_patch_model == routing_table_patch_model2
+ assert subnet_reference_model == subnet_reference_model2
# Convert model instance back to dict and verify no loss of data
- routing_table_patch_model_json2 = routing_table_patch_model.to_dict()
- assert routing_table_patch_model_json2 == routing_table_patch_model_json
+ subnet_reference_model_json2 = subnet_reference_model.to_dict()
+ assert subnet_reference_model_json2 == subnet_reference_model_json
-class TestModel_RoutingTableReference():
+class TestModel_SubnetReferenceDeleted():
"""
- Test Class for RoutingTableReference
+ Test Class for SubnetReferenceDeleted
"""
- def test_routing_table_reference_serialization(self):
+ def test_subnet_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for RoutingTableReference
+ Test serialization/deserialization for SubnetReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
- routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a RoutingTableReference model
- routing_table_reference_model_json = {}
- routing_table_reference_model_json['deleted'] = routing_table_reference_deleted_model
- routing_table_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
- routing_table_reference_model_json['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- routing_table_reference_model_json['name'] = 'my-routing-table-1'
- routing_table_reference_model_json['resource_type'] = 'routing_table'
+ # Construct a json representation of a SubnetReferenceDeleted model
+ subnet_reference_deleted_model_json = {}
+ subnet_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of RoutingTableReference by calling from_dict on the json representation
- routing_table_reference_model = RoutingTableReference.from_dict(routing_table_reference_model_json)
- assert routing_table_reference_model != False
+ # Construct a model instance of SubnetReferenceDeleted by calling from_dict on the json representation
+ subnet_reference_deleted_model = SubnetReferenceDeleted.from_dict(subnet_reference_deleted_model_json)
+ assert subnet_reference_deleted_model != False
- # Construct a model instance of RoutingTableReference by calling from_dict on the json representation
- routing_table_reference_model_dict = RoutingTableReference.from_dict(routing_table_reference_model_json).__dict__
- routing_table_reference_model2 = RoutingTableReference(**routing_table_reference_model_dict)
+ # Construct a model instance of SubnetReferenceDeleted by calling from_dict on the json representation
+ subnet_reference_deleted_model_dict = SubnetReferenceDeleted.from_dict(subnet_reference_deleted_model_json).__dict__
+ subnet_reference_deleted_model2 = SubnetReferenceDeleted(**subnet_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert routing_table_reference_model == routing_table_reference_model2
+ assert subnet_reference_deleted_model == subnet_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- routing_table_reference_model_json2 = routing_table_reference_model.to_dict()
- assert routing_table_reference_model_json2 == routing_table_reference_model_json
+ subnet_reference_deleted_model_json2 = subnet_reference_deleted_model.to_dict()
+ assert subnet_reference_deleted_model_json2 == subnet_reference_deleted_model_json
-class TestModel_RoutingTableReferenceDeleted():
+class TestModel_VCPU():
"""
- Test Class for RoutingTableReferenceDeleted
+ Test Class for VCPU
"""
- def test_routing_table_reference_deleted_serialization(self):
+ def test_vcpu_serialization(self):
"""
- Test serialization/deserialization for RoutingTableReferenceDeleted
+ Test serialization/deserialization for VCPU
"""
- # Construct a json representation of a RoutingTableReferenceDeleted model
- routing_table_reference_deleted_model_json = {}
- routing_table_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a VCPU model
+ vcpu_model_json = {}
+ vcpu_model_json['architecture'] = 'amd64'
+ vcpu_model_json['count'] = 4
- # Construct a model instance of RoutingTableReferenceDeleted by calling from_dict on the json representation
- routing_table_reference_deleted_model = RoutingTableReferenceDeleted.from_dict(routing_table_reference_deleted_model_json)
- assert routing_table_reference_deleted_model != False
+ # Construct a model instance of VCPU by calling from_dict on the json representation
+ vcpu_model = VCPU.from_dict(vcpu_model_json)
+ assert vcpu_model != False
- # Construct a model instance of RoutingTableReferenceDeleted by calling from_dict on the json representation
- routing_table_reference_deleted_model_dict = RoutingTableReferenceDeleted.from_dict(routing_table_reference_deleted_model_json).__dict__
- routing_table_reference_deleted_model2 = RoutingTableReferenceDeleted(**routing_table_reference_deleted_model_dict)
+ # Construct a model instance of VCPU by calling from_dict on the json representation
+ vcpu_model_dict = VCPU.from_dict(vcpu_model_json).__dict__
+ vcpu_model2 = VCPU(**vcpu_model_dict)
# Verify the model instances are equivalent
- assert routing_table_reference_deleted_model == routing_table_reference_deleted_model2
+ assert vcpu_model == vcpu_model2
# Convert model instance back to dict and verify no loss of data
- routing_table_reference_deleted_model_json2 = routing_table_reference_deleted_model.to_dict()
- assert routing_table_reference_deleted_model_json2 == routing_table_reference_deleted_model_json
+ vcpu_model_json2 = vcpu_model.to_dict()
+ assert vcpu_model_json2 == vcpu_model_json
-class TestModel_SecurityGroup():
+class TestModel_VPC():
"""
- Test Class for SecurityGroup
+ Test Class for VPC
"""
- def test_security_group_serialization(self):
+ def test_vpc_serialization(self):
"""
- Test serialization/deserialization for SecurityGroup
+ Test serialization/deserialization for VPC
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
- network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- network_interface_reference_model = {} # NetworkInterfaceReference
- network_interface_reference_model['deleted'] = network_interface_reference_deleted_model
- network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- network_interface_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- network_interface_reference_model['name'] = 'my-network-interface'
- network_interface_reference_model['primary_ipv4_address'] = '192.168.3.4'
- network_interface_reference_model['resource_type'] = 'network_interface'
+ zone_reference_model = {} # ZoneReference
+ zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model['name'] = 'us-south-1'
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ vpccse_source_ip_model = {} # VPCCSESourceIP
+ vpccse_source_ip_model['ip'] = ip_model
+ vpccse_source_ip_model['zone'] = zone_reference_model
- security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
- security_group_rule_remote_model['address'] = '192.168.3.4'
+ network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
+ network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll
- security_group_rule_model['direction'] = 'inbound'
- security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_model['ip_version'] = 'ipv4'
- security_group_rule_model['remote'] = security_group_rule_remote_model
- security_group_rule_model['protocol'] = 'all'
+ network_acl_reference_model = {} # NetworkACLReference
+ network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['deleted'] = network_acl_reference_deleted_model
+ network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['name'] = 'my-network-acl'
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
+ routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
- 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['resource_type'] = 'network_interface'
+ routing_table_reference_model = {} # RoutingTableReference
+ routing_table_reference_model['deleted'] = routing_table_reference_deleted_model
+ routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
+ routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ routing_table_reference_model['name'] = 'my-routing-table-1'
+ routing_table_reference_model['resource_type'] = 'routing_table'
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_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'
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
- # Construct a json representation of a SecurityGroup model
- security_group_model_json = {}
- security_group_model_json['created_at'] = "2019-01-01T12:00:00Z"
- security_group_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_model_json['name'] = 'my-security-group'
- security_group_model_json['network_interfaces'] = [network_interface_reference_model]
- security_group_model_json['resource_group'] = resource_group_reference_model
- security_group_model_json['rules'] = [security_group_rule_model]
- security_group_model_json['targets'] = [security_group_target_reference_model]
- security_group_model_json['vpc'] = vpc_reference_model
+ resource_group_reference_model = {} # ResourceGroupReference
+ resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
+ resource_group_reference_model['name'] = 'my-resource-group'
- # Construct a model instance of SecurityGroup by calling from_dict on the json representation
- security_group_model = SecurityGroup.from_dict(security_group_model_json)
- assert security_group_model != False
+ # Construct a json representation of a VPC model
+ vpc_model_json = {}
+ vpc_model_json['classic_access'] = False
+ vpc_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ vpc_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_model_json['cse_source_ips'] = [vpccse_source_ip_model]
+ vpc_model_json['default_network_acl'] = network_acl_reference_model
+ vpc_model_json['default_routing_table'] = routing_table_reference_model
+ vpc_model_json['default_security_group'] = security_group_reference_model
+ vpc_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_model_json['name'] = 'my-vpc'
+ vpc_model_json['resource_group'] = resource_group_reference_model
+ vpc_model_json['status'] = 'available'
- # Construct a model instance of SecurityGroup by calling from_dict on the json representation
- security_group_model_dict = SecurityGroup.from_dict(security_group_model_json).__dict__
- security_group_model2 = SecurityGroup(**security_group_model_dict)
+ # Construct a model instance of VPC by calling from_dict on the json representation
+ vpc_model = VPC.from_dict(vpc_model_json)
+ assert vpc_model != False
+
+ # Construct a model instance of VPC by calling from_dict on the json representation
+ vpc_model_dict = VPC.from_dict(vpc_model_json).__dict__
+ vpc_model2 = VPC(**vpc_model_dict)
# Verify the model instances are equivalent
- assert security_group_model == security_group_model2
+ assert vpc_model == vpc_model2
# Convert model instance back to dict and verify no loss of data
- security_group_model_json2 = security_group_model.to_dict()
- assert security_group_model_json2 == security_group_model_json
+ vpc_model_json2 = vpc_model.to_dict()
+ assert vpc_model_json2 == vpc_model_json
-class TestModel_SecurityGroupCollection():
+class TestModel_VPCCSESourceIP():
"""
- Test Class for SecurityGroupCollection
+ Test Class for VPCCSESourceIP
"""
- def test_security_group_collection_serialization(self):
+ def test_vpccse_source_ip_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupCollection
+ Test serialization/deserialization for VPCCSESourceIP
"""
# Construct dict forms of any model objects needed in order to build this model.
- security_group_collection_first_model = {} # SecurityGroupCollectionFirst
- security_group_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20'
-
- security_group_collection_next_model = {} # SecurityGroupCollectionNext
- security_group_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- network_interface_reference_deleted_model = {} # NetworkInterfaceReferenceDeleted
- network_interface_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- network_interface_reference_model = {} # NetworkInterfaceReference
- network_interface_reference_model['deleted'] = network_interface_reference_deleted_model
- network_interface_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
- network_interface_reference_model['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
- network_interface_reference_model['name'] = 'my-network-interface'
- network_interface_reference_model['primary_ipv4_address'] = '192.168.3.4'
- network_interface_reference_model['resource_type'] = 'network_interface'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- 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'
- security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
- security_group_rule_remote_model['address'] = '192.168.3.4'
+ # Construct a json representation of a VPCCSESourceIP model
+ vpccse_source_ip_model_json = {}
+ vpccse_source_ip_model_json['ip'] = ip_model
+ vpccse_source_ip_model_json['zone'] = zone_reference_model
- security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll
- security_group_rule_model['direction'] = 'inbound'
- security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_model['ip_version'] = 'ipv4'
- security_group_rule_model['remote'] = security_group_rule_remote_model
- security_group_rule_model['protocol'] = 'all'
+ # Construct a model instance of VPCCSESourceIP by calling from_dict on the json representation
+ vpccse_source_ip_model = VPCCSESourceIP.from_dict(vpccse_source_ip_model_json)
+ assert vpccse_source_ip_model != False
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of VPCCSESourceIP by calling from_dict on the json representation
+ vpccse_source_ip_model_dict = VPCCSESourceIP.from_dict(vpccse_source_ip_model_json).__dict__
+ vpccse_source_ip_model2 = VPCCSESourceIP(**vpccse_source_ip_model_dict)
- security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
- 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['resource_type'] = 'network_interface'
+ # Verify the model instances are equivalent
+ assert vpccse_source_ip_model == vpccse_source_ip_model2
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ vpccse_source_ip_model_json2 = vpccse_source_ip_model.to_dict()
+ assert vpccse_source_ip_model_json2 == vpccse_source_ip_model_json
- 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'
+class TestModel_VPCCollection():
+ """
+ Test Class for VPCCollection
+ """
- security_group_model = {} # SecurityGroup
- security_group_model['created_at'] = "2019-01-01T12:00:00Z"
- security_group_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_model['name'] = 'my-security-group'
- security_group_model['network_interfaces'] = [network_interface_reference_model]
- security_group_model['resource_group'] = resource_group_reference_model
- security_group_model['rules'] = [security_group_rule_model]
- security_group_model['targets'] = [security_group_target_reference_model]
- security_group_model['vpc'] = vpc_reference_model
+ def test_vpc_collection_serialization(self):
+ """
+ Test serialization/deserialization for VPCCollection
+ """
- # Construct a json representation of a SecurityGroupCollection model
- security_group_collection_model_json = {}
- security_group_collection_model_json['first'] = security_group_collection_first_model
- security_group_collection_model_json['limit'] = 20
- security_group_collection_model_json['next'] = security_group_collection_next_model
- security_group_collection_model_json['security_groups'] = [security_group_model]
- security_group_collection_model_json['total_count'] = 132
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of SecurityGroupCollection by calling from_dict on the json representation
- security_group_collection_model = SecurityGroupCollection.from_dict(security_group_collection_model_json)
- assert security_group_collection_model != False
+ vpc_collection_first_model = {} # VPCCollectionFirst
+ vpc_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20'
- # Construct a model instance of SecurityGroupCollection by calling from_dict on the json representation
- security_group_collection_model_dict = SecurityGroupCollection.from_dict(security_group_collection_model_json).__dict__
- security_group_collection_model2 = SecurityGroupCollection(**security_group_collection_model_dict)
+ vpc_collection_next_model = {} # VPCCollectionNext
+ vpc_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Verify the model instances are equivalent
- assert security_group_collection_model == security_group_collection_model2
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- # Convert model instance back to dict and verify no loss of data
- security_group_collection_model_json2 = security_group_collection_model.to_dict()
- assert security_group_collection_model_json2 == security_group_collection_model_json
+ 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'
-class TestModel_SecurityGroupCollectionFirst():
- """
- Test Class for SecurityGroupCollectionFirst
- """
+ vpccse_source_ip_model = {} # VPCCSESourceIP
+ vpccse_source_ip_model['ip'] = ip_model
+ vpccse_source_ip_model['zone'] = zone_reference_model
- def test_security_group_collection_first_serialization(self):
- """
- Test serialization/deserialization for SecurityGroupCollectionFirst
- """
+ network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
+ network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a SecurityGroupCollectionFirst model
- security_group_collection_first_model_json = {}
- security_group_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?limit=20'
+ network_acl_reference_model = {} # NetworkACLReference
+ network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['deleted'] = network_acl_reference_deleted_model
+ network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ network_acl_reference_model['name'] = 'my-network-acl'
- # Construct a model instance of SecurityGroupCollectionFirst by calling from_dict on the json representation
- security_group_collection_first_model = SecurityGroupCollectionFirst.from_dict(security_group_collection_first_model_json)
- assert security_group_collection_first_model != False
+ routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
+ routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of SecurityGroupCollectionFirst by calling from_dict on the json representation
- security_group_collection_first_model_dict = SecurityGroupCollectionFirst.from_dict(security_group_collection_first_model_json).__dict__
- security_group_collection_first_model2 = SecurityGroupCollectionFirst(**security_group_collection_first_model_dict)
+ routing_table_reference_model = {} # RoutingTableReference
+ routing_table_reference_model['deleted'] = routing_table_reference_deleted_model
+ routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
+ routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
+ routing_table_reference_model['name'] = 'my-routing-table-1'
+ routing_table_reference_model['resource_type'] = 'routing_table'
- # Verify the model instances are equivalent
- assert security_group_collection_first_model == security_group_collection_first_model2
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- security_group_collection_first_model_json2 = security_group_collection_first_model.to_dict()
- assert security_group_collection_first_model_json2 == security_group_collection_first_model_json
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
-class TestModel_SecurityGroupCollectionNext():
- """
- Test Class for SecurityGroupCollectionNext
- """
+ 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'
- def test_security_group_collection_next_serialization(self):
- """
- Test serialization/deserialization for SecurityGroupCollectionNext
- """
+ vpc_model = {} # VPC
+ vpc_model['classic_access'] = False
+ vpc_model['created_at'] = "2019-01-01T12:00:00Z"
+ vpc_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_model['cse_source_ips'] = [vpccse_source_ip_model]
+ vpc_model['default_network_acl'] = network_acl_reference_model
+ vpc_model['default_routing_table'] = routing_table_reference_model
+ vpc_model['default_security_group'] = security_group_reference_model
+ vpc_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_model['name'] = 'my-vpc'
+ vpc_model['resource_group'] = resource_group_reference_model
+ vpc_model['status'] = 'available'
- # Construct a json representation of a SecurityGroupCollectionNext model
- security_group_collection_next_model_json = {}
- security_group_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a VPCCollection model
+ vpc_collection_model_json = {}
+ vpc_collection_model_json['first'] = vpc_collection_first_model
+ vpc_collection_model_json['limit'] = 20
+ vpc_collection_model_json['next'] = vpc_collection_next_model
+ vpc_collection_model_json['total_count'] = 132
+ vpc_collection_model_json['vpcs'] = [vpc_model]
- # Construct a model instance of SecurityGroupCollectionNext by calling from_dict on the json representation
- security_group_collection_next_model = SecurityGroupCollectionNext.from_dict(security_group_collection_next_model_json)
- assert security_group_collection_next_model != False
+ # Construct a model instance of VPCCollection by calling from_dict on the json representation
+ vpc_collection_model = VPCCollection.from_dict(vpc_collection_model_json)
+ assert vpc_collection_model != False
- # Construct a model instance of SecurityGroupCollectionNext by calling from_dict on the json representation
- security_group_collection_next_model_dict = SecurityGroupCollectionNext.from_dict(security_group_collection_next_model_json).__dict__
- security_group_collection_next_model2 = SecurityGroupCollectionNext(**security_group_collection_next_model_dict)
+ # Construct a model instance of VPCCollection by calling from_dict on the json representation
+ vpc_collection_model_dict = VPCCollection.from_dict(vpc_collection_model_json).__dict__
+ vpc_collection_model2 = VPCCollection(**vpc_collection_model_dict)
# Verify the model instances are equivalent
- assert security_group_collection_next_model == security_group_collection_next_model2
+ assert vpc_collection_model == vpc_collection_model2
# Convert model instance back to dict and verify no loss of data
- security_group_collection_next_model_json2 = security_group_collection_next_model.to_dict()
- assert security_group_collection_next_model_json2 == security_group_collection_next_model_json
+ vpc_collection_model_json2 = vpc_collection_model.to_dict()
+ assert vpc_collection_model_json2 == vpc_collection_model_json
-class TestModel_SecurityGroupPatch():
+class TestModel_VPCCollectionFirst():
"""
- Test Class for SecurityGroupPatch
+ Test Class for VPCCollectionFirst
"""
- def test_security_group_patch_serialization(self):
+ def test_vpc_collection_first_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupPatch
+ Test serialization/deserialization for VPCCollectionFirst
"""
- # Construct a json representation of a SecurityGroupPatch model
- security_group_patch_model_json = {}
- security_group_patch_model_json['name'] = 'my-security-group'
+ # Construct a json representation of a VPCCollectionFirst model
+ vpc_collection_first_model_json = {}
+ vpc_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20'
- # Construct a model instance of SecurityGroupPatch by calling from_dict on the json representation
- security_group_patch_model = SecurityGroupPatch.from_dict(security_group_patch_model_json)
- assert security_group_patch_model != False
+ # Construct a model instance of VPCCollectionFirst by calling from_dict on the json representation
+ vpc_collection_first_model = VPCCollectionFirst.from_dict(vpc_collection_first_model_json)
+ assert vpc_collection_first_model != False
- # Construct a model instance of SecurityGroupPatch by calling from_dict on the json representation
- security_group_patch_model_dict = SecurityGroupPatch.from_dict(security_group_patch_model_json).__dict__
- security_group_patch_model2 = SecurityGroupPatch(**security_group_patch_model_dict)
+ # Construct a model instance of VPCCollectionFirst by calling from_dict on the json representation
+ vpc_collection_first_model_dict = VPCCollectionFirst.from_dict(vpc_collection_first_model_json).__dict__
+ vpc_collection_first_model2 = VPCCollectionFirst(**vpc_collection_first_model_dict)
# Verify the model instances are equivalent
- assert security_group_patch_model == security_group_patch_model2
+ assert vpc_collection_first_model == vpc_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- security_group_patch_model_json2 = security_group_patch_model.to_dict()
- assert security_group_patch_model_json2 == security_group_patch_model_json
+ vpc_collection_first_model_json2 = vpc_collection_first_model.to_dict()
+ assert vpc_collection_first_model_json2 == vpc_collection_first_model_json
-class TestModel_SecurityGroupReference():
+class TestModel_VPCCollectionNext():
"""
- Test Class for SecurityGroupReference
+ Test Class for VPCCollectionNext
"""
- def test_security_group_reference_serialization(self):
+ def test_vpc_collection_next_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupReference
+ Test serialization/deserialization for VPCCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a SecurityGroupReference model
- security_group_reference_model_json = {}
- security_group_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model_json['deleted'] = security_group_reference_deleted_model
- security_group_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model_json['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model_json['name'] = 'my-security-group'
+ # Construct a json representation of a VPCCollectionNext model
+ vpc_collection_next_model_json = {}
+ vpc_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of SecurityGroupReference by calling from_dict on the json representation
- security_group_reference_model = SecurityGroupReference.from_dict(security_group_reference_model_json)
- assert security_group_reference_model != False
+ # Construct a model instance of VPCCollectionNext by calling from_dict on the json representation
+ vpc_collection_next_model = VPCCollectionNext.from_dict(vpc_collection_next_model_json)
+ assert vpc_collection_next_model != False
- # Construct a model instance of SecurityGroupReference by calling from_dict on the json representation
- security_group_reference_model_dict = SecurityGroupReference.from_dict(security_group_reference_model_json).__dict__
- security_group_reference_model2 = SecurityGroupReference(**security_group_reference_model_dict)
+ # Construct a model instance of VPCCollectionNext by calling from_dict on the json representation
+ vpc_collection_next_model_dict = VPCCollectionNext.from_dict(vpc_collection_next_model_json).__dict__
+ vpc_collection_next_model2 = VPCCollectionNext(**vpc_collection_next_model_dict)
# Verify the model instances are equivalent
- assert security_group_reference_model == security_group_reference_model2
+ assert vpc_collection_next_model == vpc_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- security_group_reference_model_json2 = security_group_reference_model.to_dict()
- assert security_group_reference_model_json2 == security_group_reference_model_json
+ vpc_collection_next_model_json2 = vpc_collection_next_model.to_dict()
+ assert vpc_collection_next_model_json2 == vpc_collection_next_model_json
-class TestModel_SecurityGroupReferenceDeleted():
+class TestModel_VPCPatch():
"""
- Test Class for SecurityGroupReferenceDeleted
+ Test Class for VPCPatch
"""
- def test_security_group_reference_deleted_serialization(self):
+ def test_vpc_patch_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupReferenceDeleted
+ Test serialization/deserialization for VPCPatch
"""
- # Construct a json representation of a SecurityGroupReferenceDeleted model
- security_group_reference_deleted_model_json = {}
- security_group_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a VPCPatch model
+ vpc_patch_model_json = {}
+ vpc_patch_model_json['name'] = 'my-vpc'
- # Construct a model instance of SecurityGroupReferenceDeleted by calling from_dict on the json representation
- security_group_reference_deleted_model = SecurityGroupReferenceDeleted.from_dict(security_group_reference_deleted_model_json)
- assert security_group_reference_deleted_model != False
+ # Construct a model instance of VPCPatch by calling from_dict on the json representation
+ vpc_patch_model = VPCPatch.from_dict(vpc_patch_model_json)
+ assert vpc_patch_model != False
- # Construct a model instance of SecurityGroupReferenceDeleted by calling from_dict on the json representation
- security_group_reference_deleted_model_dict = SecurityGroupReferenceDeleted.from_dict(security_group_reference_deleted_model_json).__dict__
- security_group_reference_deleted_model2 = SecurityGroupReferenceDeleted(**security_group_reference_deleted_model_dict)
+ # Construct a model instance of VPCPatch by calling from_dict on the json representation
+ vpc_patch_model_dict = VPCPatch.from_dict(vpc_patch_model_json).__dict__
+ vpc_patch_model2 = VPCPatch(**vpc_patch_model_dict)
# Verify the model instances are equivalent
- assert security_group_reference_deleted_model == security_group_reference_deleted_model2
+ assert vpc_patch_model == vpc_patch_model2
# Convert model instance back to dict and verify no loss of data
- security_group_reference_deleted_model_json2 = security_group_reference_deleted_model.to_dict()
- assert security_group_reference_deleted_model_json2 == security_group_reference_deleted_model_json
+ vpc_patch_model_json2 = vpc_patch_model.to_dict()
+ assert vpc_patch_model_json2 == vpc_patch_model_json
-class TestModel_SecurityGroupRuleCollection():
+class TestModel_VPCReference():
"""
- Test Class for SecurityGroupRuleCollection
+ Test Class for VPCReference
"""
- def test_security_group_rule_collection_serialization(self):
+ def test_vpc_reference_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRuleCollection
+ Test serialization/deserialization for VPCReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- security_group_rule_remote_model = {} # SecurityGroupRuleRemoteIP
- security_group_rule_remote_model['address'] = '192.168.3.4'
-
- security_group_rule_model = {} # SecurityGroupRuleSecurityGroupRuleProtocolAll
- security_group_rule_model['direction'] = 'inbound'
- security_group_rule_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/rules/6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_model['id'] = '6f2a6efe-21e2-401c-b237-620aa26ba16a'
- security_group_rule_model['ip_version'] = 'ipv4'
- security_group_rule_model['remote'] = security_group_rule_remote_model
- security_group_rule_model['protocol'] = 'all'
+ vpc_reference_deleted_model = {} # VPCReferenceDeleted
+ vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a SecurityGroupRuleCollection model
- security_group_rule_collection_model_json = {}
- security_group_rule_collection_model_json['rules'] = [security_group_rule_model]
+ # Construct a json representation of a VPCReference model
+ vpc_reference_model_json = {}
+ vpc_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model_json['deleted'] = vpc_reference_deleted_model
+ vpc_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
+ vpc_reference_model_json['name'] = 'my-vpc'
- # Construct a model instance of SecurityGroupRuleCollection by calling from_dict on the json representation
- security_group_rule_collection_model = SecurityGroupRuleCollection.from_dict(security_group_rule_collection_model_json)
- assert security_group_rule_collection_model != False
+ # Construct a model instance of VPCReference by calling from_dict on the json representation
+ vpc_reference_model = VPCReference.from_dict(vpc_reference_model_json)
+ assert vpc_reference_model != False
- # Construct a model instance of SecurityGroupRuleCollection by calling from_dict on the json representation
- security_group_rule_collection_model_dict = SecurityGroupRuleCollection.from_dict(security_group_rule_collection_model_json).__dict__
- security_group_rule_collection_model2 = SecurityGroupRuleCollection(**security_group_rule_collection_model_dict)
+ # Construct a model instance of VPCReference by calling from_dict on the json representation
+ vpc_reference_model_dict = VPCReference.from_dict(vpc_reference_model_json).__dict__
+ vpc_reference_model2 = VPCReference(**vpc_reference_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_collection_model == security_group_rule_collection_model2
+ assert vpc_reference_model == vpc_reference_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_collection_model_json2 = security_group_rule_collection_model.to_dict()
- assert security_group_rule_collection_model_json2 == security_group_rule_collection_model_json
+ vpc_reference_model_json2 = vpc_reference_model.to_dict()
+ assert vpc_reference_model_json2 == vpc_reference_model_json
-class TestModel_SecurityGroupRulePatch():
+class TestModel_VPCReferenceDeleted():
"""
- Test Class for SecurityGroupRulePatch
+ Test Class for VPCReferenceDeleted
"""
- def test_security_group_rule_patch_serialization(self):
+ def test_vpc_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupRulePatch
+ Test serialization/deserialization for VPCReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- security_group_rule_remote_patch_model = {} # SecurityGroupRuleRemotePatchCIDR
- security_group_rule_remote_patch_model['cidr_block'] = '10.0.0.0/16'
-
- # Construct a json representation of a SecurityGroupRulePatch model
- security_group_rule_patch_model_json = {}
- security_group_rule_patch_model_json['code'] = 0
- security_group_rule_patch_model_json['direction'] = 'inbound'
- security_group_rule_patch_model_json['ip_version'] = 'ipv4'
- security_group_rule_patch_model_json['port_max'] = 22
- security_group_rule_patch_model_json['port_min'] = 22
- security_group_rule_patch_model_json['remote'] = security_group_rule_remote_patch_model
- security_group_rule_patch_model_json['type'] = 8
+ # Construct a json representation of a VPCReferenceDeleted model
+ vpc_reference_deleted_model_json = {}
+ vpc_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of SecurityGroupRulePatch by calling from_dict on the json representation
- security_group_rule_patch_model = SecurityGroupRulePatch.from_dict(security_group_rule_patch_model_json)
- assert security_group_rule_patch_model != False
+ # Construct a model instance of VPCReferenceDeleted by calling from_dict on the json representation
+ vpc_reference_deleted_model = VPCReferenceDeleted.from_dict(vpc_reference_deleted_model_json)
+ assert vpc_reference_deleted_model != False
- # Construct a model instance of SecurityGroupRulePatch by calling from_dict on the json representation
- security_group_rule_patch_model_dict = SecurityGroupRulePatch.from_dict(security_group_rule_patch_model_json).__dict__
- security_group_rule_patch_model2 = SecurityGroupRulePatch(**security_group_rule_patch_model_dict)
+ # Construct a model instance of VPCReferenceDeleted by calling from_dict on the json representation
+ vpc_reference_deleted_model_dict = VPCReferenceDeleted.from_dict(vpc_reference_deleted_model_json).__dict__
+ vpc_reference_deleted_model2 = VPCReferenceDeleted(**vpc_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert security_group_rule_patch_model == security_group_rule_patch_model2
+ assert vpc_reference_deleted_model == vpc_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- security_group_rule_patch_model_json2 = security_group_rule_patch_model.to_dict()
- assert security_group_rule_patch_model_json2 == security_group_rule_patch_model_json
+ vpc_reference_deleted_model_json2 = vpc_reference_deleted_model.to_dict()
+ assert vpc_reference_deleted_model_json2 == vpc_reference_deleted_model_json
-class TestModel_SecurityGroupTargetCollection():
+class TestModel_VPNGatewayCollection():
"""
- Test Class for SecurityGroupTargetCollection
+ Test Class for VPNGatewayCollection
"""
- def test_security_group_target_collection_serialization(self):
+ def test_vpn_gateway_collection_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetCollection
+ Test serialization/deserialization for VPNGatewayCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- security_group_target_collection_first_model = {} # SecurityGroupTargetCollectionFirst
- security_group_target_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20'
+ vpn_gateway_collection_first_model = {} # VPNGatewayCollectionFirst
+ vpn_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20'
- security_group_target_collection_next_model = {} # SecurityGroupTargetCollectionNext
- security_group_target_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ vpn_gateway_collection_next_model = {} # VPNGatewayCollectionNext
+ vpn_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
- network_interface_reference_target_context_deleted_model = {} # NetworkInterfaceReferenceTargetContextDeleted
- network_interface_reference_target_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- security_group_target_reference_model = {} # SecurityGroupTargetReferenceNetworkInterfaceReferenceTargetContext
- 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['resource_type'] = 'network_interface'
+ vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
+ vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
+ vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
+ vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
- # Construct a json representation of a SecurityGroupTargetCollection model
- security_group_target_collection_model_json = {}
- security_group_target_collection_model_json['first'] = security_group_target_collection_first_model
- security_group_target_collection_model_json['limit'] = 20
- security_group_target_collection_model_json['next'] = security_group_target_collection_next_model
- security_group_target_collection_model_json['targets'] = [security_group_target_reference_model]
- security_group_target_collection_model_json['total_count'] = 132
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- # Construct a model instance of SecurityGroupTargetCollection by calling from_dict on the json representation
- security_group_target_collection_model = SecurityGroupTargetCollection.from_dict(security_group_target_collection_model_json)
- assert security_group_target_collection_model != False
+ vpn_gateway_member_model = {} # VPNGatewayMember
+ vpn_gateway_member_model['private_ip'] = ip_model
+ vpn_gateway_member_model['public_ip'] = ip_model
+ vpn_gateway_member_model['role'] = 'active'
+ vpn_gateway_member_model['status'] = 'available'
- # Construct a model instance of SecurityGroupTargetCollection by calling from_dict on the json representation
- security_group_target_collection_model_dict = SecurityGroupTargetCollection.from_dict(security_group_target_collection_model_json).__dict__
- security_group_target_collection_model2 = SecurityGroupTargetCollection(**security_group_target_collection_model_dict)
+ 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'
+
+ 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'
+
+ vpn_gateway_model = {} # VPNGatewayRouteMode
+ vpn_gateway_model['connections'] = [vpn_gateway_connection_reference_model]
+ vpn_gateway_model['created_at'] = "2019-01-01T12:00:00Z"
+ vpn_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ vpn_gateway_model['members'] = [vpn_gateway_member_model]
+ vpn_gateway_model['name'] = 'my-vpn-gateway'
+ vpn_gateway_model['resource_group'] = resource_group_reference_model
+ vpn_gateway_model['resource_type'] = 'vpn_gateway'
+ vpn_gateway_model['status'] = 'available'
+ vpn_gateway_model['subnet'] = subnet_reference_model
+ vpn_gateway_model['mode'] = 'route'
+
+ # Construct a json representation of a VPNGatewayCollection model
+ vpn_gateway_collection_model_json = {}
+ vpn_gateway_collection_model_json['first'] = vpn_gateway_collection_first_model
+ vpn_gateway_collection_model_json['limit'] = 20
+ vpn_gateway_collection_model_json['next'] = vpn_gateway_collection_next_model
+ vpn_gateway_collection_model_json['total_count'] = 132
+ vpn_gateway_collection_model_json['vpn_gateways'] = [vpn_gateway_model]
+
+ # Construct a model instance of VPNGatewayCollection by calling from_dict on the json representation
+ vpn_gateway_collection_model = VPNGatewayCollection.from_dict(vpn_gateway_collection_model_json)
+ assert vpn_gateway_collection_model != False
+
+ # Construct a model instance of VPNGatewayCollection by calling from_dict on the json representation
+ vpn_gateway_collection_model_dict = VPNGatewayCollection.from_dict(vpn_gateway_collection_model_json).__dict__
+ vpn_gateway_collection_model2 = VPNGatewayCollection(**vpn_gateway_collection_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_collection_model == security_group_target_collection_model2
+ assert vpn_gateway_collection_model == vpn_gateway_collection_model2
# Convert model instance back to dict and verify no loss of data
- security_group_target_collection_model_json2 = security_group_target_collection_model.to_dict()
- assert security_group_target_collection_model_json2 == security_group_target_collection_model_json
+ vpn_gateway_collection_model_json2 = vpn_gateway_collection_model.to_dict()
+ assert vpn_gateway_collection_model_json2 == vpn_gateway_collection_model_json
-class TestModel_SecurityGroupTargetCollectionFirst():
+class TestModel_VPNGatewayCollectionFirst():
"""
- Test Class for SecurityGroupTargetCollectionFirst
+ Test Class for VPNGatewayCollectionFirst
"""
- def test_security_group_target_collection_first_serialization(self):
+ def test_vpn_gateway_collection_first_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetCollectionFirst
+ Test serialization/deserialization for VPNGatewayCollectionFirst
"""
- # Construct a json representation of a SecurityGroupTargetCollectionFirst model
- security_group_target_collection_first_model_json = {}
- security_group_target_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?limit=20'
+ # Construct a json representation of a VPNGatewayCollectionFirst model
+ vpn_gateway_collection_first_model_json = {}
+ vpn_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20'
- # Construct a model instance of SecurityGroupTargetCollectionFirst by calling from_dict on the json representation
- security_group_target_collection_first_model = SecurityGroupTargetCollectionFirst.from_dict(security_group_target_collection_first_model_json)
- assert security_group_target_collection_first_model != False
+ # Construct a model instance of VPNGatewayCollectionFirst by calling from_dict on the json representation
+ vpn_gateway_collection_first_model = VPNGatewayCollectionFirst.from_dict(vpn_gateway_collection_first_model_json)
+ assert vpn_gateway_collection_first_model != False
- # Construct a model instance of SecurityGroupTargetCollectionFirst by calling from_dict on the json representation
- security_group_target_collection_first_model_dict = SecurityGroupTargetCollectionFirst.from_dict(security_group_target_collection_first_model_json).__dict__
- security_group_target_collection_first_model2 = SecurityGroupTargetCollectionFirst(**security_group_target_collection_first_model_dict)
+ # Construct a model instance of VPNGatewayCollectionFirst by calling from_dict on the json representation
+ vpn_gateway_collection_first_model_dict = VPNGatewayCollectionFirst.from_dict(vpn_gateway_collection_first_model_json).__dict__
+ vpn_gateway_collection_first_model2 = VPNGatewayCollectionFirst(**vpn_gateway_collection_first_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_collection_first_model == security_group_target_collection_first_model2
+ assert vpn_gateway_collection_first_model == vpn_gateway_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- security_group_target_collection_first_model_json2 = security_group_target_collection_first_model.to_dict()
- assert security_group_target_collection_first_model_json2 == security_group_target_collection_first_model_json
+ vpn_gateway_collection_first_model_json2 = vpn_gateway_collection_first_model.to_dict()
+ assert vpn_gateway_collection_first_model_json2 == vpn_gateway_collection_first_model_json
-class TestModel_SecurityGroupTargetCollectionNext():
+class TestModel_VPNGatewayCollectionNext():
"""
- Test Class for SecurityGroupTargetCollectionNext
+ Test Class for VPNGatewayCollectionNext
"""
- def test_security_group_target_collection_next_serialization(self):
+ def test_vpn_gateway_collection_next_serialization(self):
"""
- Test serialization/deserialization for SecurityGroupTargetCollectionNext
+ Test serialization/deserialization for VPNGatewayCollectionNext
"""
- # Construct a json representation of a SecurityGroupTargetCollectionNext model
- security_group_target_collection_next_model_json = {}
- security_group_target_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271/targets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a VPNGatewayCollectionNext model
+ vpn_gateway_collection_next_model_json = {}
+ vpn_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
- # Construct a model instance of SecurityGroupTargetCollectionNext by calling from_dict on the json representation
- security_group_target_collection_next_model = SecurityGroupTargetCollectionNext.from_dict(security_group_target_collection_next_model_json)
- assert security_group_target_collection_next_model != False
+ # Construct a model instance of VPNGatewayCollectionNext by calling from_dict on the json representation
+ vpn_gateway_collection_next_model = VPNGatewayCollectionNext.from_dict(vpn_gateway_collection_next_model_json)
+ assert vpn_gateway_collection_next_model != False
- # Construct a model instance of SecurityGroupTargetCollectionNext by calling from_dict on the json representation
- security_group_target_collection_next_model_dict = SecurityGroupTargetCollectionNext.from_dict(security_group_target_collection_next_model_json).__dict__
- security_group_target_collection_next_model2 = SecurityGroupTargetCollectionNext(**security_group_target_collection_next_model_dict)
+ # Construct a model instance of VPNGatewayCollectionNext by calling from_dict on the json representation
+ vpn_gateway_collection_next_model_dict = VPNGatewayCollectionNext.from_dict(vpn_gateway_collection_next_model_json).__dict__
+ vpn_gateway_collection_next_model2 = VPNGatewayCollectionNext(**vpn_gateway_collection_next_model_dict)
# Verify the model instances are equivalent
- assert security_group_target_collection_next_model == security_group_target_collection_next_model2
+ assert vpn_gateway_collection_next_model == vpn_gateway_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- security_group_target_collection_next_model_json2 = security_group_target_collection_next_model.to_dict()
- assert security_group_target_collection_next_model_json2 == security_group_target_collection_next_model_json
+ vpn_gateway_collection_next_model_json2 = vpn_gateway_collection_next_model.to_dict()
+ assert vpn_gateway_collection_next_model_json2 == vpn_gateway_collection_next_model_json
-class TestModel_Snapshot():
+class TestModel_VPNGatewayConnectionCollection():
"""
- Test Class for Snapshot
+ Test Class for VPNGatewayConnectionCollection
"""
- def test_snapshot_serialization(self):
+ def test_vpn_gateway_connection_collection_serialization(self):
"""
- Test serialization/deserialization for Snapshot
+ Test serialization/deserialization for VPNGatewayConnectionCollection
"""
# 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'
+ vpn_gateway_connection_dpd_model = {} # VPNGatewayConnectionDPD
+ vpn_gateway_connection_dpd_model['action'] = 'restart'
+ vpn_gateway_connection_dpd_model['interval'] = 30
+ vpn_gateway_connection_dpd_model['timeout'] = 120
- operating_system_model = {} # OperatingSystem
- operating_system_model['architecture'] = 'amd64'
- operating_system_model['dedicated_host_only'] = False
- operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
- operating_system_model['family'] = 'Ubuntu Server'
- operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- operating_system_model['name'] = 'ubuntu-16-amd64'
- operating_system_model['vendor'] = 'Canonical'
- operating_system_model['version'] = '16.04 LTS'
+ ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted
+ ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- 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'
+ ike_policy_reference_model = {} # IKEPolicyReference
+ ike_policy_reference_model['deleted'] = ike_policy_reference_deleted_model
+ ike_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ ike_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ ike_policy_reference_model['name'] = 'my-ike-policy'
+ ike_policy_reference_model['resource_type'] = 'ike_policy'
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted
+ i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- image_reference_model = {} # ImageReference
- image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['deleted'] = image_reference_deleted_model
- image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['name'] = 'my-image'
+ i_psec_policy_reference_model = {} # IPsecPolicyReference
+ i_psec_policy_reference_model['deleted'] = i_psec_policy_reference_deleted_model
+ i_psec_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ i_psec_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
+ i_psec_policy_reference_model['name'] = 'my-ipsec-policy'
+ i_psec_policy_reference_model['resource_type'] = 'ipsec_policy'
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- volume_reference_model = {} # VolumeReference
- volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['deleted'] = volume_reference_deleted_model
- volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['name'] = 'my-volume'
+ vpn_gateway_connection_static_route_mode_tunnel_model = {} # VPNGatewayConnectionStaticRouteModeTunnel
+ vpn_gateway_connection_static_route_mode_tunnel_model['public_ip'] = ip_model
+ vpn_gateway_connection_static_route_mode_tunnel_model['status'] = 'down'
- # Construct a json representation of a Snapshot model
- snapshot_model_json = {}
- snapshot_model_json['bootable'] = True
- snapshot_model_json['created_at'] = "2019-01-01T12:00:00Z"
- snapshot_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_model_json['deletable'] = True
- snapshot_model_json['encryption'] = 'provider_managed'
- snapshot_model_json['encryption_key'] = encryption_key_reference_model
- snapshot_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_model_json['lifecycle_state'] = 'stable'
- snapshot_model_json['minimum_capacity'] = 1
- snapshot_model_json['name'] = 'my-snapshot'
- snapshot_model_json['operating_system'] = operating_system_model
- snapshot_model_json['resource_group'] = resource_group_reference_model
- snapshot_model_json['resource_type'] = 'snapshot'
- snapshot_model_json['size'] = 1
- snapshot_model_json['source_image'] = image_reference_model
- snapshot_model_json['source_volume'] = volume_reference_model
+ vpn_gateway_connection_model = {} # VPNGatewayConnectionStaticRouteMode
+ vpn_gateway_connection_model['admin_state_up'] = True
+ vpn_gateway_connection_model['authentication_mode'] = 'psk'
+ vpn_gateway_connection_model['created_at'] = "2019-01-01T12:00:00Z"
+ vpn_gateway_connection_model['dead_peer_detection'] = vpn_gateway_connection_dpd_model
+ vpn_gateway_connection_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
+ vpn_gateway_connection_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ vpn_gateway_connection_model['ike_policy'] = ike_policy_reference_model
+ vpn_gateway_connection_model['ipsec_policy'] = i_psec_policy_reference_model
+ vpn_gateway_connection_model['mode'] = 'route'
+ vpn_gateway_connection_model['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_model['peer_address'] = '169.21.50.5'
+ vpn_gateway_connection_model['psk'] = 'lkj14b1oi0alcniejkso'
+ vpn_gateway_connection_model['resource_type'] = 'vpn_gateway_connection'
+ vpn_gateway_connection_model['status'] = 'down'
+ vpn_gateway_connection_model['routing_protocol'] = 'none'
+ vpn_gateway_connection_model['tunnels'] = [vpn_gateway_connection_static_route_mode_tunnel_model]
- # Construct a model instance of Snapshot by calling from_dict on the json representation
- snapshot_model = Snapshot.from_dict(snapshot_model_json)
- assert snapshot_model != False
+ # Construct a json representation of a VPNGatewayConnectionCollection model
+ vpn_gateway_connection_collection_model_json = {}
+ vpn_gateway_connection_collection_model_json['connections'] = [vpn_gateway_connection_model]
- # Construct a model instance of Snapshot by calling from_dict on the json representation
- snapshot_model_dict = Snapshot.from_dict(snapshot_model_json).__dict__
- snapshot_model2 = Snapshot(**snapshot_model_dict)
+ # Construct a model instance of VPNGatewayConnectionCollection by calling from_dict on the json representation
+ vpn_gateway_connection_collection_model = VPNGatewayConnectionCollection.from_dict(vpn_gateway_connection_collection_model_json)
+ assert vpn_gateway_connection_collection_model != False
+
+ # Construct a model instance of VPNGatewayConnectionCollection by calling from_dict on the json representation
+ vpn_gateway_connection_collection_model_dict = VPNGatewayConnectionCollection.from_dict(vpn_gateway_connection_collection_model_json).__dict__
+ vpn_gateway_connection_collection_model2 = VPNGatewayConnectionCollection(**vpn_gateway_connection_collection_model_dict)
# Verify the model instances are equivalent
- assert snapshot_model == snapshot_model2
+ assert vpn_gateway_connection_collection_model == vpn_gateway_connection_collection_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_model_json2 = snapshot_model.to_dict()
- assert snapshot_model_json2 == snapshot_model_json
+ vpn_gateway_connection_collection_model_json2 = vpn_gateway_connection_collection_model.to_dict()
+ assert vpn_gateway_connection_collection_model_json2 == vpn_gateway_connection_collection_model_json
-class TestModel_SnapshotCollection():
+class TestModel_VPNGatewayConnectionDPD():
"""
- Test Class for SnapshotCollection
+ Test Class for VPNGatewayConnectionDPD
"""
- def test_snapshot_collection_serialization(self):
+ def test_vpn_gateway_connection_dpd_serialization(self):
"""
- Test serialization/deserialization for SnapshotCollection
+ Test serialization/deserialization for VPNGatewayConnectionDPD
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- snapshot_collection_first_model = {} # SnapshotCollectionFirst
- snapshot_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20'
-
- snapshot_collection_next_model = {} # SnapshotCollectionNext
- snapshot_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- 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'
-
- operating_system_model = {} # OperatingSystem
- operating_system_model['architecture'] = 'amd64'
- operating_system_model['dedicated_host_only'] = False
- operating_system_model['display_name'] = 'Ubuntu Server 16.04 LTS amd64'
- operating_system_model['family'] = 'Ubuntu Server'
- operating_system_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- operating_system_model['name'] = 'ubuntu-16-amd64'
- operating_system_model['vendor'] = 'Canonical'
- operating_system_model['version'] = '16.04 LTS'
+ # Construct a json representation of a VPNGatewayConnectionDPD model
+ vpn_gateway_connection_dpd_model_json = {}
+ vpn_gateway_connection_dpd_model_json['action'] = 'restart'
+ vpn_gateway_connection_dpd_model_json['interval'] = 30
+ vpn_gateway_connection_dpd_model_json['timeout'] = 120
- 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'
+ # Construct a model instance of VPNGatewayConnectionDPD by calling from_dict on the json representation
+ vpn_gateway_connection_dpd_model = VPNGatewayConnectionDPD.from_dict(vpn_gateway_connection_dpd_model_json)
+ assert vpn_gateway_connection_dpd_model != False
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of VPNGatewayConnectionDPD by calling from_dict on the json representation
+ vpn_gateway_connection_dpd_model_dict = VPNGatewayConnectionDPD.from_dict(vpn_gateway_connection_dpd_model_json).__dict__
+ vpn_gateway_connection_dpd_model2 = VPNGatewayConnectionDPD(**vpn_gateway_connection_dpd_model_dict)
- image_reference_model = {} # ImageReference
- image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['deleted'] = image_reference_deleted_model
- image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['name'] = 'my-image'
+ # Verify the model instances are equivalent
+ assert vpn_gateway_connection_dpd_model == vpn_gateway_connection_dpd_model2
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ vpn_gateway_connection_dpd_model_json2 = vpn_gateway_connection_dpd_model.to_dict()
+ assert vpn_gateway_connection_dpd_model_json2 == vpn_gateway_connection_dpd_model_json
- volume_reference_model = {} # VolumeReference
- volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['deleted'] = volume_reference_deleted_model
- volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['name'] = 'my-volume'
+class TestModel_VPNGatewayConnectionDPDPatch():
+ """
+ Test Class for VPNGatewayConnectionDPDPatch
+ """
- snapshot_model = {} # Snapshot
- snapshot_model['bootable'] = True
- snapshot_model['created_at'] = "2019-01-01T12:00:00Z"
- snapshot_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_model['deletable'] = True
- snapshot_model['encryption'] = 'provider_managed'
- snapshot_model['encryption_key'] = encryption_key_reference_model
- snapshot_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_model['lifecycle_state'] = 'stable'
- snapshot_model['minimum_capacity'] = 1
- snapshot_model['name'] = 'my-snapshot'
- snapshot_model['operating_system'] = operating_system_model
- snapshot_model['resource_group'] = resource_group_reference_model
- snapshot_model['resource_type'] = 'snapshot'
- snapshot_model['size'] = 1
- snapshot_model['source_image'] = image_reference_model
- snapshot_model['source_volume'] = volume_reference_model
+ def test_vpn_gateway_connection_dpd_patch_serialization(self):
+ """
+ Test serialization/deserialization for VPNGatewayConnectionDPDPatch
+ """
- # Construct a json representation of a SnapshotCollection model
- snapshot_collection_model_json = {}
- snapshot_collection_model_json['first'] = snapshot_collection_first_model
- snapshot_collection_model_json['limit'] = 20
- snapshot_collection_model_json['next'] = snapshot_collection_next_model
- snapshot_collection_model_json['snapshots'] = [snapshot_model]
- snapshot_collection_model_json['total_count'] = 132
+ # Construct a json representation of a VPNGatewayConnectionDPDPatch model
+ vpn_gateway_connection_dpd_patch_model_json = {}
+ vpn_gateway_connection_dpd_patch_model_json['action'] = 'restart'
+ vpn_gateway_connection_dpd_patch_model_json['interval'] = 30
+ vpn_gateway_connection_dpd_patch_model_json['timeout'] = 120
- # Construct a model instance of SnapshotCollection by calling from_dict on the json representation
- snapshot_collection_model = SnapshotCollection.from_dict(snapshot_collection_model_json)
- assert snapshot_collection_model != False
+ # Construct a model instance of VPNGatewayConnectionDPDPatch by calling from_dict on the json representation
+ vpn_gateway_connection_dpd_patch_model = VPNGatewayConnectionDPDPatch.from_dict(vpn_gateway_connection_dpd_patch_model_json)
+ assert vpn_gateway_connection_dpd_patch_model != False
- # Construct a model instance of SnapshotCollection by calling from_dict on the json representation
- snapshot_collection_model_dict = SnapshotCollection.from_dict(snapshot_collection_model_json).__dict__
- snapshot_collection_model2 = SnapshotCollection(**snapshot_collection_model_dict)
+ # Construct a model instance of VPNGatewayConnectionDPDPatch by calling from_dict on the json representation
+ vpn_gateway_connection_dpd_patch_model_dict = VPNGatewayConnectionDPDPatch.from_dict(vpn_gateway_connection_dpd_patch_model_json).__dict__
+ vpn_gateway_connection_dpd_patch_model2 = VPNGatewayConnectionDPDPatch(**vpn_gateway_connection_dpd_patch_model_dict)
# Verify the model instances are equivalent
- assert snapshot_collection_model == snapshot_collection_model2
+ assert vpn_gateway_connection_dpd_patch_model == vpn_gateway_connection_dpd_patch_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_collection_model_json2 = snapshot_collection_model.to_dict()
- assert snapshot_collection_model_json2 == snapshot_collection_model_json
+ vpn_gateway_connection_dpd_patch_model_json2 = vpn_gateway_connection_dpd_patch_model.to_dict()
+ assert vpn_gateway_connection_dpd_patch_model_json2 == vpn_gateway_connection_dpd_patch_model_json
-class TestModel_SnapshotCollectionFirst():
+class TestModel_VPNGatewayConnectionDPDPrototype():
"""
- Test Class for SnapshotCollectionFirst
+ Test Class for VPNGatewayConnectionDPDPrototype
"""
- def test_snapshot_collection_first_serialization(self):
+ def test_vpn_gateway_connection_dpd_prototype_serialization(self):
"""
- Test serialization/deserialization for SnapshotCollectionFirst
+ Test serialization/deserialization for VPNGatewayConnectionDPDPrototype
"""
- # Construct a json representation of a SnapshotCollectionFirst model
- snapshot_collection_first_model_json = {}
- snapshot_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?limit=20'
+ # Construct a json representation of a VPNGatewayConnectionDPDPrototype model
+ vpn_gateway_connection_dpd_prototype_model_json = {}
+ vpn_gateway_connection_dpd_prototype_model_json['action'] = 'restart'
+ vpn_gateway_connection_dpd_prototype_model_json['interval'] = 30
+ vpn_gateway_connection_dpd_prototype_model_json['timeout'] = 120
- # Construct a model instance of SnapshotCollectionFirst by calling from_dict on the json representation
- snapshot_collection_first_model = SnapshotCollectionFirst.from_dict(snapshot_collection_first_model_json)
- assert snapshot_collection_first_model != False
+ # Construct a model instance of VPNGatewayConnectionDPDPrototype by calling from_dict on the json representation
+ vpn_gateway_connection_dpd_prototype_model = VPNGatewayConnectionDPDPrototype.from_dict(vpn_gateway_connection_dpd_prototype_model_json)
+ assert vpn_gateway_connection_dpd_prototype_model != False
- # Construct a model instance of SnapshotCollectionFirst by calling from_dict on the json representation
- snapshot_collection_first_model_dict = SnapshotCollectionFirst.from_dict(snapshot_collection_first_model_json).__dict__
- snapshot_collection_first_model2 = SnapshotCollectionFirst(**snapshot_collection_first_model_dict)
+ # Construct a model instance of VPNGatewayConnectionDPDPrototype by calling from_dict on the json representation
+ vpn_gateway_connection_dpd_prototype_model_dict = VPNGatewayConnectionDPDPrototype.from_dict(vpn_gateway_connection_dpd_prototype_model_json).__dict__
+ vpn_gateway_connection_dpd_prototype_model2 = VPNGatewayConnectionDPDPrototype(**vpn_gateway_connection_dpd_prototype_model_dict)
# Verify the model instances are equivalent
- assert snapshot_collection_first_model == snapshot_collection_first_model2
+ assert vpn_gateway_connection_dpd_prototype_model == vpn_gateway_connection_dpd_prototype_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_collection_first_model_json2 = snapshot_collection_first_model.to_dict()
- assert snapshot_collection_first_model_json2 == snapshot_collection_first_model_json
+ vpn_gateway_connection_dpd_prototype_model_json2 = vpn_gateway_connection_dpd_prototype_model.to_dict()
+ assert vpn_gateway_connection_dpd_prototype_model_json2 == vpn_gateway_connection_dpd_prototype_model_json
-class TestModel_SnapshotCollectionNext():
+class TestModel_VPNGatewayConnectionLocalCIDRs():
"""
- Test Class for SnapshotCollectionNext
+ Test Class for VPNGatewayConnectionLocalCIDRs
"""
- def test_snapshot_collection_next_serialization(self):
+ def test_vpn_gateway_connection_local_cid_rs_serialization(self):
"""
- Test serialization/deserialization for SnapshotCollectionNext
+ Test serialization/deserialization for VPNGatewayConnectionLocalCIDRs
"""
- # Construct a json representation of a SnapshotCollectionNext model
- snapshot_collection_next_model_json = {}
- snapshot_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a VPNGatewayConnectionLocalCIDRs model
+ vpn_gateway_connection_local_cid_rs_model_json = {}
+ vpn_gateway_connection_local_cid_rs_model_json['local_cidrs'] = ['192.168.1.0/24']
- # Construct a model instance of SnapshotCollectionNext by calling from_dict on the json representation
- snapshot_collection_next_model = SnapshotCollectionNext.from_dict(snapshot_collection_next_model_json)
- assert snapshot_collection_next_model != False
+ # Construct a model instance of VPNGatewayConnectionLocalCIDRs by calling from_dict on the json representation
+ vpn_gateway_connection_local_cid_rs_model = VPNGatewayConnectionLocalCIDRs.from_dict(vpn_gateway_connection_local_cid_rs_model_json)
+ assert vpn_gateway_connection_local_cid_rs_model != False
- # Construct a model instance of SnapshotCollectionNext by calling from_dict on the json representation
- snapshot_collection_next_model_dict = SnapshotCollectionNext.from_dict(snapshot_collection_next_model_json).__dict__
- snapshot_collection_next_model2 = SnapshotCollectionNext(**snapshot_collection_next_model_dict)
+ # Construct a model instance of VPNGatewayConnectionLocalCIDRs by calling from_dict on the json representation
+ vpn_gateway_connection_local_cid_rs_model_dict = VPNGatewayConnectionLocalCIDRs.from_dict(vpn_gateway_connection_local_cid_rs_model_json).__dict__
+ vpn_gateway_connection_local_cid_rs_model2 = VPNGatewayConnectionLocalCIDRs(**vpn_gateway_connection_local_cid_rs_model_dict)
# Verify the model instances are equivalent
- assert snapshot_collection_next_model == snapshot_collection_next_model2
+ assert vpn_gateway_connection_local_cid_rs_model == vpn_gateway_connection_local_cid_rs_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_collection_next_model_json2 = snapshot_collection_next_model.to_dict()
- assert snapshot_collection_next_model_json2 == snapshot_collection_next_model_json
+ vpn_gateway_connection_local_cid_rs_model_json2 = vpn_gateway_connection_local_cid_rs_model.to_dict()
+ assert vpn_gateway_connection_local_cid_rs_model_json2 == vpn_gateway_connection_local_cid_rs_model_json
-class TestModel_SnapshotPatch():
+class TestModel_VPNGatewayConnectionPeerCIDRs():
"""
- Test Class for SnapshotPatch
+ Test Class for VPNGatewayConnectionPeerCIDRs
"""
- def test_snapshot_patch_serialization(self):
+ def test_vpn_gateway_connection_peer_cid_rs_serialization(self):
"""
- Test serialization/deserialization for SnapshotPatch
+ Test serialization/deserialization for VPNGatewayConnectionPeerCIDRs
"""
- # Construct a json representation of a SnapshotPatch model
- snapshot_patch_model_json = {}
- snapshot_patch_model_json['name'] = 'my-snapshot'
+ # Construct a json representation of a VPNGatewayConnectionPeerCIDRs model
+ vpn_gateway_connection_peer_cid_rs_model_json = {}
+ vpn_gateway_connection_peer_cid_rs_model_json['peer_cidrs'] = ['10.45.1.0/24']
- # Construct a model instance of SnapshotPatch by calling from_dict on the json representation
- snapshot_patch_model = SnapshotPatch.from_dict(snapshot_patch_model_json)
- assert snapshot_patch_model != False
+ # Construct a model instance of VPNGatewayConnectionPeerCIDRs by calling from_dict on the json representation
+ vpn_gateway_connection_peer_cid_rs_model = VPNGatewayConnectionPeerCIDRs.from_dict(vpn_gateway_connection_peer_cid_rs_model_json)
+ assert vpn_gateway_connection_peer_cid_rs_model != False
- # Construct a model instance of SnapshotPatch by calling from_dict on the json representation
- snapshot_patch_model_dict = SnapshotPatch.from_dict(snapshot_patch_model_json).__dict__
- snapshot_patch_model2 = SnapshotPatch(**snapshot_patch_model_dict)
+ # Construct a model instance of VPNGatewayConnectionPeerCIDRs by calling from_dict on the json representation
+ vpn_gateway_connection_peer_cid_rs_model_dict = VPNGatewayConnectionPeerCIDRs.from_dict(vpn_gateway_connection_peer_cid_rs_model_json).__dict__
+ vpn_gateway_connection_peer_cid_rs_model2 = VPNGatewayConnectionPeerCIDRs(**vpn_gateway_connection_peer_cid_rs_model_dict)
# Verify the model instances are equivalent
- assert snapshot_patch_model == snapshot_patch_model2
+ assert vpn_gateway_connection_peer_cid_rs_model == vpn_gateway_connection_peer_cid_rs_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_patch_model_json2 = snapshot_patch_model.to_dict()
- assert snapshot_patch_model_json2 == snapshot_patch_model_json
+ vpn_gateway_connection_peer_cid_rs_model_json2 = vpn_gateway_connection_peer_cid_rs_model.to_dict()
+ assert vpn_gateway_connection_peer_cid_rs_model_json2 == vpn_gateway_connection_peer_cid_rs_model_json
-class TestModel_SnapshotReference():
+class TestModel_VPNGatewayConnectionReference():
"""
- Test Class for SnapshotReference
+ Test Class for VPNGatewayConnectionReference
"""
- def test_snapshot_reference_serialization(self):
+ def test_vpn_gateway_connection_reference_serialization(self):
"""
- Test serialization/deserialization for SnapshotReference
+ Test serialization/deserialization for VPNGatewayConnectionReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
- snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
+ vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a SnapshotReference model
- snapshot_reference_model_json = {}
- snapshot_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_reference_model_json['deleted'] = snapshot_reference_deleted_model
- snapshot_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_reference_model_json['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_reference_model_json['name'] = 'my-snapshot'
- snapshot_reference_model_json['resource_type'] = 'snapshot'
+ # Construct a json representation of a VPNGatewayConnectionReference model
+ vpn_gateway_connection_reference_model_json = {}
+ vpn_gateway_connection_reference_model_json['deleted'] = vpn_gateway_connection_reference_deleted_model
+ vpn_gateway_connection_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
+ vpn_gateway_connection_reference_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
+ vpn_gateway_connection_reference_model_json['name'] = 'my-vpn-connection'
+ vpn_gateway_connection_reference_model_json['resource_type'] = 'vpn_gateway_connection'
- # Construct a model instance of SnapshotReference by calling from_dict on the json representation
- snapshot_reference_model = SnapshotReference.from_dict(snapshot_reference_model_json)
- assert snapshot_reference_model != False
+ # Construct a model instance of VPNGatewayConnectionReference by calling from_dict on the json representation
+ vpn_gateway_connection_reference_model = VPNGatewayConnectionReference.from_dict(vpn_gateway_connection_reference_model_json)
+ assert vpn_gateway_connection_reference_model != False
- # Construct a model instance of SnapshotReference by calling from_dict on the json representation
- snapshot_reference_model_dict = SnapshotReference.from_dict(snapshot_reference_model_json).__dict__
- snapshot_reference_model2 = SnapshotReference(**snapshot_reference_model_dict)
+ # Construct a model instance of VPNGatewayConnectionReference by calling from_dict on the json representation
+ vpn_gateway_connection_reference_model_dict = VPNGatewayConnectionReference.from_dict(vpn_gateway_connection_reference_model_json).__dict__
+ vpn_gateway_connection_reference_model2 = VPNGatewayConnectionReference(**vpn_gateway_connection_reference_model_dict)
# Verify the model instances are equivalent
- assert snapshot_reference_model == snapshot_reference_model2
+ assert vpn_gateway_connection_reference_model == vpn_gateway_connection_reference_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_reference_model_json2 = snapshot_reference_model.to_dict()
- assert snapshot_reference_model_json2 == snapshot_reference_model_json
+ vpn_gateway_connection_reference_model_json2 = vpn_gateway_connection_reference_model.to_dict()
+ assert vpn_gateway_connection_reference_model_json2 == vpn_gateway_connection_reference_model_json
-class TestModel_SnapshotReferenceDeleted():
+class TestModel_VPNGatewayConnectionReferenceDeleted():
"""
- Test Class for SnapshotReferenceDeleted
+ Test Class for VPNGatewayConnectionReferenceDeleted
"""
- def test_snapshot_reference_deleted_serialization(self):
+ def test_vpn_gateway_connection_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for SnapshotReferenceDeleted
+ Test serialization/deserialization for VPNGatewayConnectionReferenceDeleted
"""
- # Construct a json representation of a SnapshotReferenceDeleted model
- snapshot_reference_deleted_model_json = {}
- snapshot_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a VPNGatewayConnectionReferenceDeleted model
+ vpn_gateway_connection_reference_deleted_model_json = {}
+ vpn_gateway_connection_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of SnapshotReferenceDeleted by calling from_dict on the json representation
- snapshot_reference_deleted_model = SnapshotReferenceDeleted.from_dict(snapshot_reference_deleted_model_json)
- assert snapshot_reference_deleted_model != False
+ # Construct a model instance of VPNGatewayConnectionReferenceDeleted by calling from_dict on the json representation
+ vpn_gateway_connection_reference_deleted_model = VPNGatewayConnectionReferenceDeleted.from_dict(vpn_gateway_connection_reference_deleted_model_json)
+ assert vpn_gateway_connection_reference_deleted_model != False
- # Construct a model instance of SnapshotReferenceDeleted by calling from_dict on the json representation
- snapshot_reference_deleted_model_dict = SnapshotReferenceDeleted.from_dict(snapshot_reference_deleted_model_json).__dict__
- snapshot_reference_deleted_model2 = SnapshotReferenceDeleted(**snapshot_reference_deleted_model_dict)
+ # Construct a model instance of VPNGatewayConnectionReferenceDeleted by calling from_dict on the json representation
+ vpn_gateway_connection_reference_deleted_model_dict = VPNGatewayConnectionReferenceDeleted.from_dict(vpn_gateway_connection_reference_deleted_model_json).__dict__
+ vpn_gateway_connection_reference_deleted_model2 = VPNGatewayConnectionReferenceDeleted(**vpn_gateway_connection_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert snapshot_reference_deleted_model == snapshot_reference_deleted_model2
+ assert vpn_gateway_connection_reference_deleted_model == vpn_gateway_connection_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- snapshot_reference_deleted_model_json2 = snapshot_reference_deleted_model.to_dict()
- assert snapshot_reference_deleted_model_json2 == snapshot_reference_deleted_model_json
+ vpn_gateway_connection_reference_deleted_model_json2 = vpn_gateway_connection_reference_deleted_model.to_dict()
+ assert vpn_gateway_connection_reference_deleted_model_json2 == vpn_gateway_connection_reference_deleted_model_json
-class TestModel_Subnet():
+class TestModel_VPNGatewayConnectionStaticRouteModeTunnel():
"""
- Test Class for Subnet
+ Test Class for VPNGatewayConnectionStaticRouteModeTunnel
"""
- def test_subnet_serialization(self):
+ def test_vpn_gateway_connection_static_route_mode_tunnel_serialization(self):
"""
- Test serialization/deserialization for Subnet
+ Test serialization/deserialization for VPNGatewayConnectionStaticRouteModeTunnel
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
- network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- network_acl_reference_model = {} # NetworkACLReference
- network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['deleted'] = network_acl_reference_deleted_model
- network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['name'] = 'my-network-acl'
+ # Construct a json representation of a VPNGatewayConnectionStaticRouteModeTunnel model
+ vpn_gateway_connection_static_route_mode_tunnel_model_json = {}
+ vpn_gateway_connection_static_route_mode_tunnel_model_json['public_ip'] = ip_model
+ vpn_gateway_connection_static_route_mode_tunnel_model_json['status'] = 'down'
- public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted
- public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of VPNGatewayConnectionStaticRouteModeTunnel by calling from_dict on the json representation
+ vpn_gateway_connection_static_route_mode_tunnel_model = VPNGatewayConnectionStaticRouteModeTunnel.from_dict(vpn_gateway_connection_static_route_mode_tunnel_model_json)
+ assert vpn_gateway_connection_static_route_mode_tunnel_model != False
- public_gateway_reference_model = {} # PublicGatewayReference
- public_gateway_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_reference_model['deleted'] = public_gateway_reference_deleted_model
- public_gateway_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_reference_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_reference_model['name'] = 'my-public-gateway'
- public_gateway_reference_model['resource_type'] = 'public_gateway'
+ # Construct a model instance of VPNGatewayConnectionStaticRouteModeTunnel by calling from_dict on the json representation
+ vpn_gateway_connection_static_route_mode_tunnel_model_dict = VPNGatewayConnectionStaticRouteModeTunnel.from_dict(vpn_gateway_connection_static_route_mode_tunnel_model_json).__dict__
+ vpn_gateway_connection_static_route_mode_tunnel_model2 = VPNGatewayConnectionStaticRouteModeTunnel(**vpn_gateway_connection_static_route_mode_tunnel_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert vpn_gateway_connection_static_route_mode_tunnel_model == vpn_gateway_connection_static_route_mode_tunnel_model2
- routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
- routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Convert model instance back to dict and verify no loss of data
+ vpn_gateway_connection_static_route_mode_tunnel_model_json2 = vpn_gateway_connection_static_route_mode_tunnel_model.to_dict()
+ assert vpn_gateway_connection_static_route_mode_tunnel_model_json2 == vpn_gateway_connection_static_route_mode_tunnel_model_json
- routing_table_reference_model = {} # RoutingTableReference
- routing_table_reference_model['deleted'] = routing_table_reference_deleted_model
- routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
- routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- routing_table_reference_model['name'] = 'my-routing-table-1'
- routing_table_reference_model['resource_type'] = 'routing_table'
+class TestModel_VPNGatewayMember():
+ """
+ Test Class for VPNGatewayMember
+ """
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ def test_vpn_gateway_member_serialization(self):
+ """
+ Test serialization/deserialization for VPNGatewayMember
+ """
- 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'
+ # Construct dict forms of any model objects needed in order to build this model.
- zone_reference_model = {} # ZoneReference
- zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model['name'] = 'us-south-1'
+ ip_model = {} # IP
+ ip_model['address'] = '192.168.3.4'
- # Construct a json representation of a Subnet model
- subnet_model_json = {}
- subnet_model_json['available_ipv4_address_count'] = 15
- subnet_model_json['created_at'] = "2019-01-01T12:00:00Z"
- subnet_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_model_json['ip_version'] = 'ipv4'
- subnet_model_json['ipv4_cidr_block'] = '10.0.0.0/24'
- subnet_model_json['name'] = 'my-subnet'
- subnet_model_json['network_acl'] = network_acl_reference_model
- subnet_model_json['public_gateway'] = public_gateway_reference_model
- subnet_model_json['resource_group'] = resource_group_reference_model
- subnet_model_json['routing_table'] = routing_table_reference_model
- subnet_model_json['status'] = 'available'
- subnet_model_json['total_ipv4_address_count'] = 256
- subnet_model_json['vpc'] = vpc_reference_model
- subnet_model_json['zone'] = zone_reference_model
+ # Construct a json representation of a VPNGatewayMember model
+ vpn_gateway_member_model_json = {}
+ vpn_gateway_member_model_json['private_ip'] = ip_model
+ vpn_gateway_member_model_json['public_ip'] = ip_model
+ vpn_gateway_member_model_json['role'] = 'active'
+ vpn_gateway_member_model_json['status'] = 'available'
- # Construct a model instance of Subnet by calling from_dict on the json representation
- subnet_model = Subnet.from_dict(subnet_model_json)
- assert subnet_model != False
+ # Construct a model instance of VPNGatewayMember by calling from_dict on the json representation
+ vpn_gateway_member_model = VPNGatewayMember.from_dict(vpn_gateway_member_model_json)
+ assert vpn_gateway_member_model != False
- # Construct a model instance of Subnet by calling from_dict on the json representation
- subnet_model_dict = Subnet.from_dict(subnet_model_json).__dict__
- subnet_model2 = Subnet(**subnet_model_dict)
+ # Construct a model instance of VPNGatewayMember by calling from_dict on the json representation
+ vpn_gateway_member_model_dict = VPNGatewayMember.from_dict(vpn_gateway_member_model_json).__dict__
+ vpn_gateway_member_model2 = VPNGatewayMember(**vpn_gateway_member_model_dict)
# Verify the model instances are equivalent
- assert subnet_model == subnet_model2
+ assert vpn_gateway_member_model == vpn_gateway_member_model2
# Convert model instance back to dict and verify no loss of data
- subnet_model_json2 = subnet_model.to_dict()
- assert subnet_model_json2 == subnet_model_json
+ vpn_gateway_member_model_json2 = vpn_gateway_member_model.to_dict()
+ assert vpn_gateway_member_model_json2 == vpn_gateway_member_model_json
-class TestModel_SubnetCollection():
+class TestModel_VPNGatewayPatch():
"""
- Test Class for SubnetCollection
+ Test Class for VPNGatewayPatch
"""
- def test_subnet_collection_serialization(self):
+ def test_vpn_gateway_patch_serialization(self):
"""
- Test serialization/deserialization for SubnetCollection
+ Test serialization/deserialization for VPNGatewayPatch
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- subnet_collection_first_model = {} # SubnetCollectionFirst
- subnet_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20'
-
- subnet_collection_next_model = {} # SubnetCollectionNext
- subnet_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
- network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- network_acl_reference_model = {} # NetworkACLReference
- network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['deleted'] = network_acl_reference_deleted_model
- network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['name'] = 'my-network-acl'
-
- public_gateway_reference_deleted_model = {} # PublicGatewayReferenceDeleted
- public_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a VPNGatewayPatch model
+ vpn_gateway_patch_model_json = {}
+ vpn_gateway_patch_model_json['name'] = 'my-vpn-gateway'
- public_gateway_reference_model = {} # PublicGatewayReference
- public_gateway_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_reference_model['deleted'] = public_gateway_reference_deleted_model
- public_gateway_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_reference_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
- public_gateway_reference_model['name'] = 'my-public-gateway'
- public_gateway_reference_model['resource_type'] = 'public_gateway'
+ # Construct a model instance of VPNGatewayPatch by calling from_dict on the json representation
+ vpn_gateway_patch_model = VPNGatewayPatch.from_dict(vpn_gateway_patch_model_json)
+ assert vpn_gateway_patch_model != False
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ # Construct a model instance of VPNGatewayPatch by calling from_dict on the json representation
+ vpn_gateway_patch_model_dict = VPNGatewayPatch.from_dict(vpn_gateway_patch_model_json).__dict__
+ vpn_gateway_patch_model2 = VPNGatewayPatch(**vpn_gateway_patch_model_dict)
- routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
- routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert vpn_gateway_patch_model == vpn_gateway_patch_model2
- routing_table_reference_model = {} # RoutingTableReference
- routing_table_reference_model['deleted'] = routing_table_reference_deleted_model
- routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
- routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- routing_table_reference_model['name'] = 'my-routing-table-1'
- routing_table_reference_model['resource_type'] = 'routing_table'
+ # Convert model instance back to dict and verify no loss of data
+ vpn_gateway_patch_model_json2 = vpn_gateway_patch_model.to_dict()
+ assert vpn_gateway_patch_model_json2 == vpn_gateway_patch_model_json
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_Volume():
+ """
+ Test Class for Volume
+ """
- 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'
+ def test_volume_serialization(self):
+ """
+ Test serialization/deserialization for Volume
+ """
- 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 dict forms of any model objects needed in order to build this model.
- subnet_model = {} # Subnet
- subnet_model['available_ipv4_address_count'] = 15
- subnet_model['created_at'] = "2019-01-01T12:00:00Z"
- subnet_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_model['ip_version'] = 'ipv4'
- subnet_model['ipv4_cidr_block'] = '10.0.0.0/24'
- subnet_model['name'] = 'my-subnet'
- subnet_model['network_acl'] = network_acl_reference_model
- subnet_model['public_gateway'] = public_gateway_reference_model
- subnet_model['resource_group'] = resource_group_reference_model
- subnet_model['routing_table'] = routing_table_reference_model
- subnet_model['status'] = 'available'
- subnet_model['total_ipv4_address_count'] = 256
- subnet_model['vpc'] = vpc_reference_model
- subnet_model['zone'] = zone_reference_model
+ encryption_key_reference_model = {} # EncryptionKeyReference
+ encryption_key_reference_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Construct a json representation of a SubnetCollection model
- subnet_collection_model_json = {}
- subnet_collection_model_json['first'] = subnet_collection_first_model
- subnet_collection_model_json['limit'] = 20
- subnet_collection_model_json['next'] = subnet_collection_next_model
- subnet_collection_model_json['subnets'] = [subnet_model]
- subnet_collection_model_json['total_count'] = 132
+ operating_system_reference_model = {} # OperatingSystemReference
+ operating_system_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ operating_system_reference_model['name'] = 'ubuntu-16-amd64'
- # Construct a model instance of SubnetCollection by calling from_dict on the json representation
- subnet_collection_model = SubnetCollection.from_dict(subnet_collection_model_json)
- assert subnet_collection_model != False
+ volume_profile_reference_model = {} # VolumeProfileReference
+ volume_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
+ volume_profile_reference_model['name'] = 'general-purpose'
- # Construct a model instance of SubnetCollection by calling from_dict on the json representation
- subnet_collection_model_dict = SubnetCollection.from_dict(subnet_collection_model_json).__dict__
- subnet_collection_model2 = SubnetCollection(**subnet_collection_model_dict)
+ 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'
- # Verify the model instances are equivalent
- assert subnet_collection_model == subnet_collection_model2
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- subnet_collection_model_json2 = subnet_collection_model.to_dict()
- assert subnet_collection_model_json2 == subnet_collection_model_json
+ image_reference_model = {} # ImageReference
+ image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['deleted'] = image_reference_deleted_model
+ image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['name'] = 'my-image'
-class TestModel_SubnetCollectionFirst():
- """
- Test Class for SubnetCollectionFirst
- """
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_subnet_collection_first_serialization(self):
- """
- Test serialization/deserialization for SubnetCollectionFirst
- """
+ snapshot_reference_model = {} # SnapshotReference
+ snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_reference_model['deleted'] = snapshot_reference_deleted_model
+ snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_reference_model['name'] = 'my-snapshot'
+ snapshot_reference_model['resource_type'] = 'snapshot'
- # Construct a json representation of a SubnetCollectionFirst model
- subnet_collection_first_model_json = {}
- subnet_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?limit=20'
+ volume_status_reason_model = {} # VolumeStatusReason
+ volume_status_reason_model['code'] = 'encryption_key_deleted'
+ volume_status_reason_model['message'] = 'testString'
+ volume_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
- # Construct a model instance of SubnetCollectionFirst by calling from_dict on the json representation
- subnet_collection_first_model = SubnetCollectionFirst.from_dict(subnet_collection_first_model_json)
- assert subnet_collection_first_model != False
+ volume_attachment_reference_volume_context_deleted_model = {} # VolumeAttachmentReferenceVolumeContextDeleted
+ volume_attachment_reference_volume_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of SubnetCollectionFirst by calling from_dict on the json representation
- subnet_collection_first_model_dict = SubnetCollectionFirst.from_dict(subnet_collection_first_model_json).__dict__
- subnet_collection_first_model2 = SubnetCollectionFirst(**subnet_collection_first_model_dict)
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- # Verify the model instances are equivalent
- assert subnet_collection_first_model == subnet_collection_first_model2
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- subnet_collection_first_model_json2 = subnet_collection_first_model.to_dict()
- assert subnet_collection_first_model_json2 == subnet_collection_first_model_json
+ instance_reference_model = {} # InstanceReference
+ instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['deleted'] = instance_reference_deleted_model
+ instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['name'] = 'my-instance'
-class TestModel_SubnetCollectionNext():
- """
- Test Class for SubnetCollectionNext
- """
+ volume_attachment_reference_volume_context_model = {} # VolumeAttachmentReferenceVolumeContext
+ volume_attachment_reference_volume_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_reference_volume_context_model['deleted'] = volume_attachment_reference_volume_context_deleted_model
+ volume_attachment_reference_volume_context_model['device'] = volume_attachment_device_model
+ volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_volume_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_volume_context_model['instance'] = instance_reference_model
+ volume_attachment_reference_volume_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_reference_volume_context_model['type'] = 'boot'
- def test_subnet_collection_next_serialization(self):
- """
- Test serialization/deserialization for SubnetCollectionNext
- """
+ 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 SubnetCollectionNext model
- subnet_collection_next_model_json = {}
- subnet_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a Volume model
+ volume_model_json = {}
+ volume_model_json['active'] = True
+ volume_model_json['bandwidth'] = 1000
+ volume_model_json['busy'] = True
+ volume_model_json['capacity'] = 1000
+ volume_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ volume_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model_json['encryption'] = 'provider_managed'
+ volume_model_json['encryption_key'] = encryption_key_reference_model
+ volume_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model_json['iops'] = 10000
+ volume_model_json['name'] = 'my-volume'
+ volume_model_json['operating_system'] = operating_system_reference_model
+ volume_model_json['profile'] = volume_profile_reference_model
+ volume_model_json['resource_group'] = resource_group_reference_model
+ volume_model_json['source_image'] = image_reference_model
+ volume_model_json['source_snapshot'] = snapshot_reference_model
+ volume_model_json['status'] = 'available'
+ volume_model_json['status_reasons'] = [volume_status_reason_model]
+ volume_model_json['volume_attachments'] = [volume_attachment_reference_volume_context_model]
+ volume_model_json['zone'] = zone_reference_model
- # Construct a model instance of SubnetCollectionNext by calling from_dict on the json representation
- subnet_collection_next_model = SubnetCollectionNext.from_dict(subnet_collection_next_model_json)
- assert subnet_collection_next_model != False
+ # Construct a model instance of Volume by calling from_dict on the json representation
+ volume_model = Volume.from_dict(volume_model_json)
+ assert volume_model != False
- # Construct a model instance of SubnetCollectionNext by calling from_dict on the json representation
- subnet_collection_next_model_dict = SubnetCollectionNext.from_dict(subnet_collection_next_model_json).__dict__
- subnet_collection_next_model2 = SubnetCollectionNext(**subnet_collection_next_model_dict)
+ # Construct a model instance of Volume by calling from_dict on the json representation
+ volume_model_dict = Volume.from_dict(volume_model_json).__dict__
+ volume_model2 = Volume(**volume_model_dict)
# Verify the model instances are equivalent
- assert subnet_collection_next_model == subnet_collection_next_model2
+ assert volume_model == volume_model2
# Convert model instance back to dict and verify no loss of data
- subnet_collection_next_model_json2 = subnet_collection_next_model.to_dict()
- assert subnet_collection_next_model_json2 == subnet_collection_next_model_json
+ volume_model_json2 = volume_model.to_dict()
+ assert volume_model_json2 == volume_model_json
-class TestModel_SubnetPatch():
+class TestModel_VolumeAttachment():
"""
- Test Class for SubnetPatch
+ Test Class for VolumeAttachment
"""
- def test_subnet_patch_serialization(self):
+ def test_volume_attachment_serialization(self):
"""
- Test serialization/deserialization for SubnetPatch
+ Test serialization/deserialization for VolumeAttachment
"""
# Construct dict forms of any model objects needed in order to build this model.
- network_acl_identity_model = {} # NetworkACLIdentityById
- network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- public_gateway_identity_model = {} # PublicGatewayIdentityById
- public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- routing_table_identity_model = {} # RoutingTableIdentityById
- routing_table_identity_model['id'] = '6885e83f-03b2-4603-8a86-db2a0f55c840'
+ volume_reference_model = {} # VolumeReference
+ volume_reference_model['crn'] = 'crn:[...]'
+ volume_reference_model['deleted'] = volume_reference_deleted_model
+ volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ca4b6df3-f5a8-4667-b5f2-f3b9b4160781'
+ volume_reference_model['id'] = 'ca4b6df3-f5a8-4667-b5f2-f3b9b4160781'
+ volume_reference_model['name'] = 'my-data-volume'
- # Construct a json representation of a SubnetPatch model
- subnet_patch_model_json = {}
- subnet_patch_model_json['name'] = 'my-subnet'
- subnet_patch_model_json['network_acl'] = network_acl_identity_model
- subnet_patch_model_json['public_gateway'] = public_gateway_identity_model
- subnet_patch_model_json['routing_table'] = routing_table_identity_model
+ # Construct a json representation of a VolumeAttachment model
+ volume_attachment_model_json = {}
+ volume_attachment_model_json['bandwidth'] = 250
+ volume_attachment_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ volume_attachment_model_json['delete_volume_on_instance_delete'] = True
+ volume_attachment_model_json['device'] = volume_attachment_device_model
+ volume_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_model_json['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_model_json['name'] = 'my-volume-attachment'
+ volume_attachment_model_json['status'] = 'attached'
+ volume_attachment_model_json['type'] = 'boot'
+ volume_attachment_model_json['volume'] = volume_reference_model
- # Construct a model instance of SubnetPatch by calling from_dict on the json representation
- subnet_patch_model = SubnetPatch.from_dict(subnet_patch_model_json)
- assert subnet_patch_model != False
+ # Construct a model instance of VolumeAttachment by calling from_dict on the json representation
+ volume_attachment_model = VolumeAttachment.from_dict(volume_attachment_model_json)
+ assert volume_attachment_model != False
- # Construct a model instance of SubnetPatch by calling from_dict on the json representation
- subnet_patch_model_dict = SubnetPatch.from_dict(subnet_patch_model_json).__dict__
- subnet_patch_model2 = SubnetPatch(**subnet_patch_model_dict)
+ # Construct a model instance of VolumeAttachment by calling from_dict on the json representation
+ volume_attachment_model_dict = VolumeAttachment.from_dict(volume_attachment_model_json).__dict__
+ volume_attachment_model2 = VolumeAttachment(**volume_attachment_model_dict)
# Verify the model instances are equivalent
- assert subnet_patch_model == subnet_patch_model2
+ assert volume_attachment_model == volume_attachment_model2
# Convert model instance back to dict and verify no loss of data
- subnet_patch_model_json2 = subnet_patch_model.to_dict()
- assert subnet_patch_model_json2 == subnet_patch_model_json
+ volume_attachment_model_json2 = volume_attachment_model.to_dict()
+ assert volume_attachment_model_json2 == volume_attachment_model_json
-class TestModel_SubnetReference():
+class TestModel_VolumeAttachmentCollection():
"""
- Test Class for SubnetReference
+ Test Class for VolumeAttachmentCollection
"""
- def test_subnet_reference_serialization(self):
+ def test_volume_attachment_collection_serialization(self):
"""
- Test serialization/deserialization for SubnetReference
+ Test serialization/deserialization for VolumeAttachmentCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- # Construct a json representation of a SubnetReference model
- subnet_reference_model_json = {}
- subnet_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::subnet:7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model_json['deleted'] = subnet_reference_deleted_model
- subnet_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/subnets/7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model_json['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- subnet_reference_model_json['name'] = 'my-subnet'
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of SubnetReference by calling from_dict on the json representation
- subnet_reference_model = SubnetReference.from_dict(subnet_reference_model_json)
- assert subnet_reference_model != False
+ volume_reference_model = {} # VolumeReference
+ volume_reference_model['crn'] = 'crn:[...]'
+ volume_reference_model['deleted'] = volume_reference_deleted_model
+ volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6'
+ volume_reference_model['id'] = 'ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6'
+ volume_reference_model['name'] = 'my-boot-volume'
- # Construct a model instance of SubnetReference by calling from_dict on the json representation
- subnet_reference_model_dict = SubnetReference.from_dict(subnet_reference_model_json).__dict__
- subnet_reference_model2 = SubnetReference(**subnet_reference_model_dict)
+ volume_attachment_model = {} # VolumeAttachment
+ volume_attachment_model['bandwidth'] = 250
+ volume_attachment_model['created_at'] = "2019-02-28T16:32:05Z"
+ volume_attachment_model['delete_volume_on_instance_delete'] = False
+ volume_attachment_model['device'] = volume_attachment_device_model
+ volume_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/8f06378c-ed0e-481e-b98c-9a6dfbee1ed5/volume_attachments/fdb3642d-c849-4c29-97a9-03b868616f88'
+ volume_attachment_model['id'] = 'fdb3642d-c849-4c29-97a9-03b868616f88'
+ volume_attachment_model['name'] = 'my-boot-volume-attachment'
+ volume_attachment_model['status'] = 'attached'
+ volume_attachment_model['type'] = 'boot'
+ volume_attachment_model['volume'] = volume_reference_model
+
+ # Construct a json representation of a VolumeAttachmentCollection model
+ volume_attachment_collection_model_json = {}
+ volume_attachment_collection_model_json['volume_attachments'] = [volume_attachment_model]
+
+ # Construct a model instance of VolumeAttachmentCollection by calling from_dict on the json representation
+ volume_attachment_collection_model = VolumeAttachmentCollection.from_dict(volume_attachment_collection_model_json)
+ assert volume_attachment_collection_model != False
+
+ # Construct a model instance of VolumeAttachmentCollection by calling from_dict on the json representation
+ volume_attachment_collection_model_dict = VolumeAttachmentCollection.from_dict(volume_attachment_collection_model_json).__dict__
+ volume_attachment_collection_model2 = VolumeAttachmentCollection(**volume_attachment_collection_model_dict)
# Verify the model instances are equivalent
- assert subnet_reference_model == subnet_reference_model2
+ assert volume_attachment_collection_model == volume_attachment_collection_model2
# Convert model instance back to dict and verify no loss of data
- subnet_reference_model_json2 = subnet_reference_model.to_dict()
- assert subnet_reference_model_json2 == subnet_reference_model_json
+ volume_attachment_collection_model_json2 = volume_attachment_collection_model.to_dict()
+ assert volume_attachment_collection_model_json2 == volume_attachment_collection_model_json
-class TestModel_SubnetReferenceDeleted():
+class TestModel_VolumeAttachmentDevice():
"""
- Test Class for SubnetReferenceDeleted
+ Test Class for VolumeAttachmentDevice
"""
- def test_subnet_reference_deleted_serialization(self):
+ def test_volume_attachment_device_serialization(self):
"""
- Test serialization/deserialization for SubnetReferenceDeleted
+ Test serialization/deserialization for VolumeAttachmentDevice
"""
- # Construct a json representation of a SubnetReferenceDeleted model
- subnet_reference_deleted_model_json = {}
- subnet_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a VolumeAttachmentDevice model
+ volume_attachment_device_model_json = {}
+ volume_attachment_device_model_json['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- # Construct a model instance of SubnetReferenceDeleted by calling from_dict on the json representation
- subnet_reference_deleted_model = SubnetReferenceDeleted.from_dict(subnet_reference_deleted_model_json)
- assert subnet_reference_deleted_model != False
+ # Construct a model instance of VolumeAttachmentDevice by calling from_dict on the json representation
+ volume_attachment_device_model = VolumeAttachmentDevice.from_dict(volume_attachment_device_model_json)
+ assert volume_attachment_device_model != False
- # Construct a model instance of SubnetReferenceDeleted by calling from_dict on the json representation
- subnet_reference_deleted_model_dict = SubnetReferenceDeleted.from_dict(subnet_reference_deleted_model_json).__dict__
- subnet_reference_deleted_model2 = SubnetReferenceDeleted(**subnet_reference_deleted_model_dict)
+ # Construct a model instance of VolumeAttachmentDevice by calling from_dict on the json representation
+ volume_attachment_device_model_dict = VolumeAttachmentDevice.from_dict(volume_attachment_device_model_json).__dict__
+ volume_attachment_device_model2 = VolumeAttachmentDevice(**volume_attachment_device_model_dict)
# Verify the model instances are equivalent
- assert subnet_reference_deleted_model == subnet_reference_deleted_model2
+ assert volume_attachment_device_model == volume_attachment_device_model2
# Convert model instance back to dict and verify no loss of data
- subnet_reference_deleted_model_json2 = subnet_reference_deleted_model.to_dict()
- assert subnet_reference_deleted_model_json2 == subnet_reference_deleted_model_json
+ volume_attachment_device_model_json2 = volume_attachment_device_model.to_dict()
+ assert volume_attachment_device_model_json2 == volume_attachment_device_model_json
-class TestModel_VCPU():
+class TestModel_VolumeAttachmentPatch():
"""
- Test Class for VCPU
+ Test Class for VolumeAttachmentPatch
"""
- def test_vcpu_serialization(self):
+ def test_volume_attachment_patch_serialization(self):
"""
- Test serialization/deserialization for VCPU
+ Test serialization/deserialization for VolumeAttachmentPatch
"""
- # Construct a json representation of a VCPU model
- vcpu_model_json = {}
- vcpu_model_json['architecture'] = 'amd64'
- vcpu_model_json['count'] = 4
+ # Construct a json representation of a VolumeAttachmentPatch model
+ volume_attachment_patch_model_json = {}
+ volume_attachment_patch_model_json['delete_volume_on_instance_delete'] = True
+ volume_attachment_patch_model_json['name'] = 'my-volume-attachment'
- # Construct a model instance of VCPU by calling from_dict on the json representation
- vcpu_model = VCPU.from_dict(vcpu_model_json)
- assert vcpu_model != False
+ # Construct a model instance of VolumeAttachmentPatch by calling from_dict on the json representation
+ volume_attachment_patch_model = VolumeAttachmentPatch.from_dict(volume_attachment_patch_model_json)
+ assert volume_attachment_patch_model != False
- # Construct a model instance of VCPU by calling from_dict on the json representation
- vcpu_model_dict = VCPU.from_dict(vcpu_model_json).__dict__
- vcpu_model2 = VCPU(**vcpu_model_dict)
+ # Construct a model instance of VolumeAttachmentPatch by calling from_dict on the json representation
+ volume_attachment_patch_model_dict = VolumeAttachmentPatch.from_dict(volume_attachment_patch_model_json).__dict__
+ volume_attachment_patch_model2 = VolumeAttachmentPatch(**volume_attachment_patch_model_dict)
# Verify the model instances are equivalent
- assert vcpu_model == vcpu_model2
+ assert volume_attachment_patch_model == volume_attachment_patch_model2
# Convert model instance back to dict and verify no loss of data
- vcpu_model_json2 = vcpu_model.to_dict()
- assert vcpu_model_json2 == vcpu_model_json
+ volume_attachment_patch_model_json2 = volume_attachment_patch_model.to_dict()
+ assert volume_attachment_patch_model_json2 == volume_attachment_patch_model_json
-class TestModel_VPC():
+class TestModel_VolumeAttachmentPrototypeInstanceByImageContext():
"""
- Test Class for VPC
+ Test Class for VolumeAttachmentPrototypeInstanceByImageContext
"""
- def test_vpc_serialization(self):
+ def test_volume_attachment_prototype_instance_by_image_context_serialization(self):
"""
- Test serialization/deserialization for VPC
+ Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByImageContext
"""
# Construct dict forms of any model objects needed in order to build this model.
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
-
- zone_reference_model = {} # ZoneReference
- zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model['name'] = 'us-south-1'
-
- vpccse_source_ip_model = {} # VPCCSESourceIP
- vpccse_source_ip_model['ip'] = ip_model
- vpccse_source_ip_model['zone'] = zone_reference_model
-
- network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
- network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- network_acl_reference_model = {} # NetworkACLReference
- network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['deleted'] = network_acl_reference_deleted_model
- network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['name'] = 'my-network-acl'
-
- routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
- routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- routing_table_reference_model = {} # RoutingTableReference
- routing_table_reference_model['deleted'] = routing_table_reference_deleted_model
- routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
- routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- routing_table_reference_model['name'] = 'my-routing-table-1'
- routing_table_reference_model['resource_type'] = 'routing_table'
-
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ 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'
- security_group_reference_model = {} # SecurityGroupReference
- security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['deleted'] = security_group_reference_deleted_model
- security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['name'] = 'my-security-group'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
+ volume_prototype_instance_by_image_context_model['capacity'] = 38
+ volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model['iops'] = 10000
+ volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
- # Construct a json representation of a VPC model
- vpc_model_json = {}
- vpc_model_json['classic_access'] = False
- vpc_model_json['created_at'] = "2019-01-01T12:00:00Z"
- vpc_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_model_json['cse_source_ips'] = [vpccse_source_ip_model]
- vpc_model_json['default_network_acl'] = network_acl_reference_model
- vpc_model_json['default_routing_table'] = routing_table_reference_model
- vpc_model_json['default_security_group'] = security_group_reference_model
- vpc_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_model_json['name'] = 'my-vpc'
- vpc_model_json['resource_group'] = resource_group_reference_model
- vpc_model_json['status'] = 'available'
+ # Construct a json representation of a VolumeAttachmentPrototypeInstanceByImageContext model
+ volume_attachment_prototype_instance_by_image_context_model_json = {}
+ volume_attachment_prototype_instance_by_image_context_model_json['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_by_image_context_model_json['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_image_context_model_json['volume'] = volume_prototype_instance_by_image_context_model
- # Construct a model instance of VPC by calling from_dict on the json representation
- vpc_model = VPC.from_dict(vpc_model_json)
- assert vpc_model != False
+ # Construct a model instance of VolumeAttachmentPrototypeInstanceByImageContext by calling from_dict on the json representation
+ volume_attachment_prototype_instance_by_image_context_model = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(volume_attachment_prototype_instance_by_image_context_model_json)
+ assert volume_attachment_prototype_instance_by_image_context_model != False
- # Construct a model instance of VPC by calling from_dict on the json representation
- vpc_model_dict = VPC.from_dict(vpc_model_json).__dict__
- vpc_model2 = VPC(**vpc_model_dict)
+ # Construct a model instance of VolumeAttachmentPrototypeInstanceByImageContext by calling from_dict on the json representation
+ volume_attachment_prototype_instance_by_image_context_model_dict = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(volume_attachment_prototype_instance_by_image_context_model_json).__dict__
+ volume_attachment_prototype_instance_by_image_context_model2 = VolumeAttachmentPrototypeInstanceByImageContext(**volume_attachment_prototype_instance_by_image_context_model_dict)
# Verify the model instances are equivalent
- assert vpc_model == vpc_model2
+ assert volume_attachment_prototype_instance_by_image_context_model == volume_attachment_prototype_instance_by_image_context_model2
# Convert model instance back to dict and verify no loss of data
- vpc_model_json2 = vpc_model.to_dict()
- assert vpc_model_json2 == vpc_model_json
+ volume_attachment_prototype_instance_by_image_context_model_json2 = volume_attachment_prototype_instance_by_image_context_model.to_dict()
+ assert volume_attachment_prototype_instance_by_image_context_model_json2 == volume_attachment_prototype_instance_by_image_context_model_json
-class TestModel_VPCCSESourceIP():
+class TestModel_VolumeAttachmentPrototypeInstanceByVolumeContext():
"""
- Test Class for VPCCSESourceIP
+ Test Class for VolumeAttachmentPrototypeInstanceByVolumeContext
"""
- def test_vpccse_source_ip_serialization(self):
+ def test_volume_attachment_prototype_instance_by_volume_context_serialization(self):
"""
- Test serialization/deserialization for VPCCSESourceIP
+ Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByVolumeContext
"""
# Construct dict forms of any model objects needed in order to build this model.
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ 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'
- 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'
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a json representation of a VPCCSESourceIP model
- vpccse_source_ip_model_json = {}
- vpccse_source_ip_model_json['ip'] = ip_model
- vpccse_source_ip_model_json['zone'] = zone_reference_model
+ snapshot_identity_model = {} # SnapshotIdentityById
+ snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
- # Construct a model instance of VPCCSESourceIP by calling from_dict on the json representation
- vpccse_source_ip_model = VPCCSESourceIP.from_dict(vpccse_source_ip_model_json)
- assert vpccse_source_ip_model != False
+ volume_attachment_volume_prototype_instance_by_volume_context_model = {} # VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext
+ volume_attachment_volume_prototype_instance_by_volume_context_model['capacity'] = 38
+ volume_attachment_volume_prototype_instance_by_volume_context_model['encryption_key'] = encryption_key_identity_model
+ volume_attachment_volume_prototype_instance_by_volume_context_model['iops'] = 10000
+ volume_attachment_volume_prototype_instance_by_volume_context_model['name'] = 'my-volume'
+ volume_attachment_volume_prototype_instance_by_volume_context_model['profile'] = volume_profile_identity_model
+ volume_attachment_volume_prototype_instance_by_volume_context_model['source_snapshot'] = snapshot_identity_model
- # Construct a model instance of VPCCSESourceIP by calling from_dict on the json representation
- vpccse_source_ip_model_dict = VPCCSESourceIP.from_dict(vpccse_source_ip_model_json).__dict__
- vpccse_source_ip_model2 = VPCCSESourceIP(**vpccse_source_ip_model_dict)
+ # Construct a json representation of a VolumeAttachmentPrototypeInstanceByVolumeContext model
+ volume_attachment_prototype_instance_by_volume_context_model_json = {}
+ volume_attachment_prototype_instance_by_volume_context_model_json['delete_volume_on_instance_delete'] = False
+ volume_attachment_prototype_instance_by_volume_context_model_json['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_by_volume_context_model_json['volume'] = volume_attachment_volume_prototype_instance_by_volume_context_model
+
+ # Construct a model instance of VolumeAttachmentPrototypeInstanceByVolumeContext by calling from_dict on the json representation
+ volume_attachment_prototype_instance_by_volume_context_model = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(volume_attachment_prototype_instance_by_volume_context_model_json)
+ assert volume_attachment_prototype_instance_by_volume_context_model != False
+
+ # Construct a model instance of VolumeAttachmentPrototypeInstanceByVolumeContext by calling from_dict on the json representation
+ volume_attachment_prototype_instance_by_volume_context_model_dict = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(volume_attachment_prototype_instance_by_volume_context_model_json).__dict__
+ volume_attachment_prototype_instance_by_volume_context_model2 = VolumeAttachmentPrototypeInstanceByVolumeContext(**volume_attachment_prototype_instance_by_volume_context_model_dict)
# Verify the model instances are equivalent
- assert vpccse_source_ip_model == vpccse_source_ip_model2
+ assert volume_attachment_prototype_instance_by_volume_context_model == volume_attachment_prototype_instance_by_volume_context_model2
# Convert model instance back to dict and verify no loss of data
- vpccse_source_ip_model_json2 = vpccse_source_ip_model.to_dict()
- assert vpccse_source_ip_model_json2 == vpccse_source_ip_model_json
+ volume_attachment_prototype_instance_by_volume_context_model_json2 = volume_attachment_prototype_instance_by_volume_context_model.to_dict()
+ assert volume_attachment_prototype_instance_by_volume_context_model_json2 == volume_attachment_prototype_instance_by_volume_context_model_json
-class TestModel_VPCCollection():
+class TestModel_VolumeAttachmentPrototypeInstanceContext():
"""
- Test Class for VPCCollection
+ Test Class for VolumeAttachmentPrototypeInstanceContext
"""
- def test_vpc_collection_serialization(self):
+ def test_volume_attachment_prototype_instance_context_serialization(self):
"""
- Test serialization/deserialization for VPCCollection
+ Test serialization/deserialization for VolumeAttachmentPrototypeInstanceContext
"""
# Construct dict forms of any model objects needed in order to build this model.
- vpc_collection_first_model = {} # VPCCollectionFirst
- vpc_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20'
-
- vpc_collection_next_model = {} # VPCCollectionNext
- vpc_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
-
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
-
- zone_reference_model = {} # ZoneReference
- zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model['name'] = 'us-south-1'
-
- vpccse_source_ip_model = {} # VPCCSESourceIP
- vpccse_source_ip_model['ip'] = ip_model
- vpccse_source_ip_model['zone'] = zone_reference_model
-
- network_acl_reference_deleted_model = {} # NetworkACLReferenceDeleted
- network_acl_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- network_acl_reference_model = {} # NetworkACLReference
- network_acl_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::network-acl:a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['deleted'] = network_acl_reference_deleted_model
- network_acl_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/network_acls/a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- network_acl_reference_model['name'] = 'my-network-acl'
-
- routing_table_reference_deleted_model = {} # RoutingTableReferenceDeleted
- routing_table_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- routing_table_reference_model = {} # RoutingTableReference
- routing_table_reference_model['deleted'] = routing_table_reference_deleted_model
- routing_table_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/982d72b7-db1b-4606-afb2-ed6bd4b0bed1/routing_tables/6885e83f-03b2-4603-8a86-db2a0f55c840'
- routing_table_reference_model['id'] = '1a15dca5-7e33-45e1-b7c5-bc690e569531'
- routing_table_reference_model['name'] = 'my-routing-table-1'
- routing_table_reference_model['resource_type'] = 'routing_table'
-
- security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
- security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- security_group_reference_model = {} # SecurityGroupReference
- security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['deleted'] = security_group_reference_deleted_model
- security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- security_group_reference_model['name'] = 'my-security-group'
-
- 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'
-
- vpc_model = {} # VPC
- vpc_model['classic_access'] = False
- vpc_model['created_at'] = "2019-01-01T12:00:00Z"
- vpc_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_model['cse_source_ips'] = [vpccse_source_ip_model]
- vpc_model['default_network_acl'] = network_acl_reference_model
- vpc_model['default_routing_table'] = routing_table_reference_model
- vpc_model['default_security_group'] = security_group_reference_model
- vpc_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_model['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_model['name'] = 'my-vpc'
- vpc_model['resource_group'] = resource_group_reference_model
- vpc_model['status'] = 'available'
+ volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById
+ volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- # Construct a json representation of a VPCCollection model
- vpc_collection_model_json = {}
- vpc_collection_model_json['first'] = vpc_collection_first_model
- vpc_collection_model_json['limit'] = 20
- vpc_collection_model_json['next'] = vpc_collection_next_model
- vpc_collection_model_json['total_count'] = 132
- vpc_collection_model_json['vpcs'] = [vpc_model]
+ # Construct a json representation of a VolumeAttachmentPrototypeInstanceContext model
+ volume_attachment_prototype_instance_context_model_json = {}
+ volume_attachment_prototype_instance_context_model_json['delete_volume_on_instance_delete'] = True
+ volume_attachment_prototype_instance_context_model_json['name'] = 'my-volume-attachment'
+ volume_attachment_prototype_instance_context_model_json['volume'] = volume_attachment_volume_prototype_instance_context_model
- # Construct a model instance of VPCCollection by calling from_dict on the json representation
- vpc_collection_model = VPCCollection.from_dict(vpc_collection_model_json)
- assert vpc_collection_model != False
+ # Construct a model instance of VolumeAttachmentPrototypeInstanceContext by calling from_dict on the json representation
+ volume_attachment_prototype_instance_context_model = VolumeAttachmentPrototypeInstanceContext.from_dict(volume_attachment_prototype_instance_context_model_json)
+ assert volume_attachment_prototype_instance_context_model != False
- # Construct a model instance of VPCCollection by calling from_dict on the json representation
- vpc_collection_model_dict = VPCCollection.from_dict(vpc_collection_model_json).__dict__
- vpc_collection_model2 = VPCCollection(**vpc_collection_model_dict)
+ # Construct a model instance of VolumeAttachmentPrototypeInstanceContext by calling from_dict on the json representation
+ volume_attachment_prototype_instance_context_model_dict = VolumeAttachmentPrototypeInstanceContext.from_dict(volume_attachment_prototype_instance_context_model_json).__dict__
+ volume_attachment_prototype_instance_context_model2 = VolumeAttachmentPrototypeInstanceContext(**volume_attachment_prototype_instance_context_model_dict)
# Verify the model instances are equivalent
- assert vpc_collection_model == vpc_collection_model2
+ assert volume_attachment_prototype_instance_context_model == volume_attachment_prototype_instance_context_model2
# Convert model instance back to dict and verify no loss of data
- vpc_collection_model_json2 = vpc_collection_model.to_dict()
- assert vpc_collection_model_json2 == vpc_collection_model_json
+ volume_attachment_prototype_instance_context_model_json2 = volume_attachment_prototype_instance_context_model.to_dict()
+ assert volume_attachment_prototype_instance_context_model_json2 == volume_attachment_prototype_instance_context_model_json
-class TestModel_VPCCollectionFirst():
+class TestModel_VolumeAttachmentReferenceInstanceContext():
"""
- Test Class for VPCCollectionFirst
+ Test Class for VolumeAttachmentReferenceInstanceContext
"""
- def test_vpc_collection_first_serialization(self):
+ def test_volume_attachment_reference_instance_context_serialization(self):
"""
- Test serialization/deserialization for VPCCollectionFirst
+ Test serialization/deserialization for VolumeAttachmentReferenceInstanceContext
"""
- # Construct a json representation of a VPCCollectionFirst model
- vpc_collection_first_model_json = {}
- vpc_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?limit=20'
-
- # Construct a model instance of VPCCollectionFirst by calling from_dict on the json representation
- vpc_collection_first_model = VPCCollectionFirst.from_dict(vpc_collection_first_model_json)
- assert vpc_collection_first_model != False
-
- # Construct a model instance of VPCCollectionFirst by calling from_dict on the json representation
- vpc_collection_first_model_dict = VPCCollectionFirst.from_dict(vpc_collection_first_model_json).__dict__
- vpc_collection_first_model2 = VPCCollectionFirst(**vpc_collection_first_model_dict)
-
- # Verify the model instances are equivalent
- assert vpc_collection_first_model == vpc_collection_first_model2
+ # Construct dict forms of any model objects needed in order to build this model.
- # Convert model instance back to dict and verify no loss of data
- vpc_collection_first_model_json2 = vpc_collection_first_model.to_dict()
- assert vpc_collection_first_model_json2 == vpc_collection_first_model_json
+ volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted
+ volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_VPCCollectionNext():
- """
- Test Class for VPCCollectionNext
- """
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- def test_vpc_collection_next_serialization(self):
- """
- Test serialization/deserialization for VPCCollectionNext
- """
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a VPCCollectionNext model
- vpc_collection_next_model_json = {}
- vpc_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ volume_reference_model = {} # VolumeReference
+ volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['deleted'] = volume_reference_deleted_model
+ volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model['name'] = 'my-volume'
- # Construct a model instance of VPCCollectionNext by calling from_dict on the json representation
- vpc_collection_next_model = VPCCollectionNext.from_dict(vpc_collection_next_model_json)
- assert vpc_collection_next_model != False
+ # Construct a json representation of a VolumeAttachmentReferenceInstanceContext model
+ volume_attachment_reference_instance_context_model_json = {}
+ volume_attachment_reference_instance_context_model_json['deleted'] = volume_attachment_reference_instance_context_deleted_model
+ volume_attachment_reference_instance_context_model_json['device'] = volume_attachment_device_model
+ volume_attachment_reference_instance_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_instance_context_model_json['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_instance_context_model_json['name'] = 'my-volume-attachment'
+ volume_attachment_reference_instance_context_model_json['volume'] = volume_reference_model
- # Construct a model instance of VPCCollectionNext by calling from_dict on the json representation
- vpc_collection_next_model_dict = VPCCollectionNext.from_dict(vpc_collection_next_model_json).__dict__
- vpc_collection_next_model2 = VPCCollectionNext(**vpc_collection_next_model_dict)
+ # Construct a model instance of VolumeAttachmentReferenceInstanceContext by calling from_dict on the json representation
+ volume_attachment_reference_instance_context_model = VolumeAttachmentReferenceInstanceContext.from_dict(volume_attachment_reference_instance_context_model_json)
+ assert volume_attachment_reference_instance_context_model != False
+
+ # Construct a model instance of VolumeAttachmentReferenceInstanceContext by calling from_dict on the json representation
+ volume_attachment_reference_instance_context_model_dict = VolumeAttachmentReferenceInstanceContext.from_dict(volume_attachment_reference_instance_context_model_json).__dict__
+ volume_attachment_reference_instance_context_model2 = VolumeAttachmentReferenceInstanceContext(**volume_attachment_reference_instance_context_model_dict)
# Verify the model instances are equivalent
- assert vpc_collection_next_model == vpc_collection_next_model2
+ assert volume_attachment_reference_instance_context_model == volume_attachment_reference_instance_context_model2
# Convert model instance back to dict and verify no loss of data
- vpc_collection_next_model_json2 = vpc_collection_next_model.to_dict()
- assert vpc_collection_next_model_json2 == vpc_collection_next_model_json
+ volume_attachment_reference_instance_context_model_json2 = volume_attachment_reference_instance_context_model.to_dict()
+ assert volume_attachment_reference_instance_context_model_json2 == volume_attachment_reference_instance_context_model_json
-class TestModel_VPCPatch():
+class TestModel_VolumeAttachmentReferenceInstanceContextDeleted():
"""
- Test Class for VPCPatch
+ Test Class for VolumeAttachmentReferenceInstanceContextDeleted
"""
- def test_vpc_patch_serialization(self):
+ def test_volume_attachment_reference_instance_context_deleted_serialization(self):
"""
- Test serialization/deserialization for VPCPatch
+ Test serialization/deserialization for VolumeAttachmentReferenceInstanceContextDeleted
"""
- # Construct a json representation of a VPCPatch model
- vpc_patch_model_json = {}
- vpc_patch_model_json['name'] = 'my-vpc'
+ # Construct a json representation of a VolumeAttachmentReferenceInstanceContextDeleted model
+ volume_attachment_reference_instance_context_deleted_model_json = {}
+ volume_attachment_reference_instance_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of VPCPatch by calling from_dict on the json representation
- vpc_patch_model = VPCPatch.from_dict(vpc_patch_model_json)
- assert vpc_patch_model != False
+ # Construct a model instance of VolumeAttachmentReferenceInstanceContextDeleted by calling from_dict on the json representation
+ volume_attachment_reference_instance_context_deleted_model = VolumeAttachmentReferenceInstanceContextDeleted.from_dict(volume_attachment_reference_instance_context_deleted_model_json)
+ assert volume_attachment_reference_instance_context_deleted_model != False
- # Construct a model instance of VPCPatch by calling from_dict on the json representation
- vpc_patch_model_dict = VPCPatch.from_dict(vpc_patch_model_json).__dict__
- vpc_patch_model2 = VPCPatch(**vpc_patch_model_dict)
+ # Construct a model instance of VolumeAttachmentReferenceInstanceContextDeleted by calling from_dict on the json representation
+ volume_attachment_reference_instance_context_deleted_model_dict = VolumeAttachmentReferenceInstanceContextDeleted.from_dict(volume_attachment_reference_instance_context_deleted_model_json).__dict__
+ volume_attachment_reference_instance_context_deleted_model2 = VolumeAttachmentReferenceInstanceContextDeleted(**volume_attachment_reference_instance_context_deleted_model_dict)
# Verify the model instances are equivalent
- assert vpc_patch_model == vpc_patch_model2
+ assert volume_attachment_reference_instance_context_deleted_model == volume_attachment_reference_instance_context_deleted_model2
# Convert model instance back to dict and verify no loss of data
- vpc_patch_model_json2 = vpc_patch_model.to_dict()
- assert vpc_patch_model_json2 == vpc_patch_model_json
+ volume_attachment_reference_instance_context_deleted_model_json2 = volume_attachment_reference_instance_context_deleted_model.to_dict()
+ assert volume_attachment_reference_instance_context_deleted_model_json2 == volume_attachment_reference_instance_context_deleted_model_json
-class TestModel_VPCReference():
+class TestModel_VolumeAttachmentReferenceVolumeContext():
"""
- Test Class for VPCReference
+ Test Class for VolumeAttachmentReferenceVolumeContext
"""
- def test_vpc_reference_serialization(self):
+ def test_volume_attachment_reference_volume_context_serialization(self):
"""
- Test serialization/deserialization for VPCReference
+ Test serialization/deserialization for VolumeAttachmentReferenceVolumeContext
"""
# Construct dict forms of any model objects needed in order to build this model.
- vpc_reference_deleted_model = {} # VPCReferenceDeleted
- vpc_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_attachment_reference_volume_context_deleted_model = {} # VolumeAttachmentReferenceVolumeContextDeleted
+ volume_attachment_reference_volume_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a VPCReference model
- vpc_reference_model_json = {}
- vpc_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpc:4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model_json['deleted'] = vpc_reference_deleted_model
- vpc_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpcs/4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model_json['id'] = '4727d842-f94f-4a2d-824a-9bc9b02c523b'
- vpc_reference_model_json['name'] = 'my-vpc'
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- # Construct a model instance of VPCReference by calling from_dict on the json representation
- vpc_reference_model = VPCReference.from_dict(vpc_reference_model_json)
- assert vpc_reference_model != False
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of VPCReference by calling from_dict on the json representation
- vpc_reference_model_dict = VPCReference.from_dict(vpc_reference_model_json).__dict__
- vpc_reference_model2 = VPCReference(**vpc_reference_model_dict)
+ instance_reference_model = {} # InstanceReference
+ instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['deleted'] = instance_reference_deleted_model
+ instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['name'] = 'my-instance'
+
+ # Construct a json representation of a VolumeAttachmentReferenceVolumeContext model
+ volume_attachment_reference_volume_context_model_json = {}
+ volume_attachment_reference_volume_context_model_json['delete_volume_on_instance_delete'] = True
+ volume_attachment_reference_volume_context_model_json['deleted'] = volume_attachment_reference_volume_context_deleted_model
+ volume_attachment_reference_volume_context_model_json['device'] = volume_attachment_device_model
+ volume_attachment_reference_volume_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_volume_context_model_json['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_volume_context_model_json['instance'] = instance_reference_model
+ volume_attachment_reference_volume_context_model_json['name'] = 'my-volume-attachment'
+ volume_attachment_reference_volume_context_model_json['type'] = 'boot'
+
+ # Construct a model instance of VolumeAttachmentReferenceVolumeContext by calling from_dict on the json representation
+ volume_attachment_reference_volume_context_model = VolumeAttachmentReferenceVolumeContext.from_dict(volume_attachment_reference_volume_context_model_json)
+ assert volume_attachment_reference_volume_context_model != False
+
+ # Construct a model instance of VolumeAttachmentReferenceVolumeContext by calling from_dict on the json representation
+ volume_attachment_reference_volume_context_model_dict = VolumeAttachmentReferenceVolumeContext.from_dict(volume_attachment_reference_volume_context_model_json).__dict__
+ volume_attachment_reference_volume_context_model2 = VolumeAttachmentReferenceVolumeContext(**volume_attachment_reference_volume_context_model_dict)
# Verify the model instances are equivalent
- assert vpc_reference_model == vpc_reference_model2
+ assert volume_attachment_reference_volume_context_model == volume_attachment_reference_volume_context_model2
# Convert model instance back to dict and verify no loss of data
- vpc_reference_model_json2 = vpc_reference_model.to_dict()
- assert vpc_reference_model_json2 == vpc_reference_model_json
+ volume_attachment_reference_volume_context_model_json2 = volume_attachment_reference_volume_context_model.to_dict()
+ assert volume_attachment_reference_volume_context_model_json2 == volume_attachment_reference_volume_context_model_json
-class TestModel_VPCReferenceDeleted():
+class TestModel_VolumeAttachmentReferenceVolumeContextDeleted():
"""
- Test Class for VPCReferenceDeleted
+ Test Class for VolumeAttachmentReferenceVolumeContextDeleted
"""
- def test_vpc_reference_deleted_serialization(self):
+ def test_volume_attachment_reference_volume_context_deleted_serialization(self):
"""
- Test serialization/deserialization for VPCReferenceDeleted
+ Test serialization/deserialization for VolumeAttachmentReferenceVolumeContextDeleted
"""
- # Construct a json representation of a VPCReferenceDeleted model
- vpc_reference_deleted_model_json = {}
- vpc_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a VolumeAttachmentReferenceVolumeContextDeleted model
+ volume_attachment_reference_volume_context_deleted_model_json = {}
+ volume_attachment_reference_volume_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of VPCReferenceDeleted by calling from_dict on the json representation
- vpc_reference_deleted_model = VPCReferenceDeleted.from_dict(vpc_reference_deleted_model_json)
- assert vpc_reference_deleted_model != False
+ # Construct a model instance of VolumeAttachmentReferenceVolumeContextDeleted by calling from_dict on the json representation
+ volume_attachment_reference_volume_context_deleted_model = VolumeAttachmentReferenceVolumeContextDeleted.from_dict(volume_attachment_reference_volume_context_deleted_model_json)
+ assert volume_attachment_reference_volume_context_deleted_model != False
- # Construct a model instance of VPCReferenceDeleted by calling from_dict on the json representation
- vpc_reference_deleted_model_dict = VPCReferenceDeleted.from_dict(vpc_reference_deleted_model_json).__dict__
- vpc_reference_deleted_model2 = VPCReferenceDeleted(**vpc_reference_deleted_model_dict)
+ # Construct a model instance of VolumeAttachmentReferenceVolumeContextDeleted by calling from_dict on the json representation
+ volume_attachment_reference_volume_context_deleted_model_dict = VolumeAttachmentReferenceVolumeContextDeleted.from_dict(volume_attachment_reference_volume_context_deleted_model_json).__dict__
+ volume_attachment_reference_volume_context_deleted_model2 = VolumeAttachmentReferenceVolumeContextDeleted(**volume_attachment_reference_volume_context_deleted_model_dict)
# Verify the model instances are equivalent
- assert vpc_reference_deleted_model == vpc_reference_deleted_model2
+ assert volume_attachment_reference_volume_context_deleted_model == volume_attachment_reference_volume_context_deleted_model2
# Convert model instance back to dict and verify no loss of data
- vpc_reference_deleted_model_json2 = vpc_reference_deleted_model.to_dict()
- assert vpc_reference_deleted_model_json2 == vpc_reference_deleted_model_json
+ volume_attachment_reference_volume_context_deleted_model_json2 = volume_attachment_reference_volume_context_deleted_model.to_dict()
+ assert volume_attachment_reference_volume_context_deleted_model_json2 == volume_attachment_reference_volume_context_deleted_model_json
-class TestModel_VPNGatewayCollection():
+class TestModel_VolumeCollection():
"""
- Test Class for VPNGatewayCollection
+ Test Class for VolumeCollection
"""
- def test_vpn_gateway_collection_serialization(self):
+ def test_volume_collection_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayCollection
+ Test serialization/deserialization for VolumeCollection
"""
# Construct dict forms of any model objects needed in order to build this model.
- vpn_gateway_collection_first_model = {} # VPNGatewayCollectionFirst
- vpn_gateway_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20'
-
- vpn_gateway_collection_next_model = {} # VPNGatewayCollectionNext
- vpn_gateway_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
+ volume_collection_first_model = {} # VolumeCollectionFirst
+ volume_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20'
- vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
- vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ volume_collection_next_model = {} # VolumeCollectionNext
+ volume_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- vpn_gateway_connection_reference_model = {} # VPNGatewayConnectionReference
- vpn_gateway_connection_reference_model['deleted'] = vpn_gateway_connection_reference_deleted_model
- vpn_gateway_connection_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
- vpn_gateway_connection_reference_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- vpn_gateway_connection_reference_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_reference_model['resource_type'] = 'vpn_gateway_connection'
+ 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'
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ operating_system_reference_model = {} # OperatingSystemReference
+ operating_system_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
+ operating_system_reference_model['name'] = 'ubuntu-16-amd64'
- vpn_gateway_member_model = {} # VPNGatewayMember
- vpn_gateway_member_model['private_ip'] = ip_model
- vpn_gateway_member_model['public_ip'] = ip_model
- vpn_gateway_member_model['role'] = 'active'
- vpn_gateway_member_model['status'] = 'available'
+ volume_profile_reference_model = {} # VolumeProfileReference
+ volume_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
+ volume_profile_reference_model['name'] = 'general-purpose'
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'
- subnet_reference_deleted_model = {} # SubnetReferenceDeleted
- subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ image_reference_deleted_model = {} # ImageReferenceDeleted
+ image_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'
+ image_reference_model = {} # ImageReference
+ image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['deleted'] = image_reference_deleted_model
+ image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
+ image_reference_model['name'] = 'my-image'
- vpn_gateway_model = {} # VPNGatewayRouteMode
- vpn_gateway_model['connections'] = [vpn_gateway_connection_reference_model]
- vpn_gateway_model['created_at'] = "2019-01-01T12:00:00Z"
- vpn_gateway_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::vpn:ddf51bec-3424-11e8-b467-0ed5f89f718b'
- vpn_gateway_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- vpn_gateway_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- vpn_gateway_model['members'] = [vpn_gateway_member_model]
- vpn_gateway_model['name'] = 'my-vpn-gateway'
- vpn_gateway_model['resource_group'] = resource_group_reference_model
- vpn_gateway_model['resource_type'] = 'vpn_gateway'
- vpn_gateway_model['status'] = 'available'
- vpn_gateway_model['subnet'] = subnet_reference_model
- vpn_gateway_model['mode'] = 'route'
+ snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
+ snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a VPNGatewayCollection model
- vpn_gateway_collection_model_json = {}
- vpn_gateway_collection_model_json['first'] = vpn_gateway_collection_first_model
- vpn_gateway_collection_model_json['limit'] = 20
- vpn_gateway_collection_model_json['next'] = vpn_gateway_collection_next_model
- vpn_gateway_collection_model_json['total_count'] = 132
- vpn_gateway_collection_model_json['vpn_gateways'] = [vpn_gateway_model]
+ snapshot_reference_model = {} # SnapshotReference
+ snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_reference_model['deleted'] = snapshot_reference_deleted_model
+ snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
+ snapshot_reference_model['name'] = 'my-snapshot'
+ snapshot_reference_model['resource_type'] = 'snapshot'
- # Construct a model instance of VPNGatewayCollection by calling from_dict on the json representation
- vpn_gateway_collection_model = VPNGatewayCollection.from_dict(vpn_gateway_collection_model_json)
- assert vpn_gateway_collection_model != False
+ volume_status_reason_model = {} # VolumeStatusReason
+ volume_status_reason_model['code'] = 'encryption_key_deleted'
+ volume_status_reason_model['message'] = 'testString'
+ volume_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
- # Construct a model instance of VPNGatewayCollection by calling from_dict on the json representation
- vpn_gateway_collection_model_dict = VPNGatewayCollection.from_dict(vpn_gateway_collection_model_json).__dict__
- vpn_gateway_collection_model2 = VPNGatewayCollection(**vpn_gateway_collection_model_dict)
+ volume_attachment_reference_volume_context_deleted_model = {} # VolumeAttachmentReferenceVolumeContextDeleted
+ volume_attachment_reference_volume_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Verify the model instances are equivalent
- assert vpn_gateway_collection_model == vpn_gateway_collection_model2
+ volume_attachment_device_model = {} # VolumeAttachmentDevice
+ volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
- # Convert model instance back to dict and verify no loss of data
- vpn_gateway_collection_model_json2 = vpn_gateway_collection_model.to_dict()
- assert vpn_gateway_collection_model_json2 == vpn_gateway_collection_model_json
+ instance_reference_deleted_model = {} # InstanceReferenceDeleted
+ instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-class TestModel_VPNGatewayCollectionFirst():
- """
- Test Class for VPNGatewayCollectionFirst
- """
+ instance_reference_model = {} # InstanceReference
+ instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['deleted'] = instance_reference_deleted_model
+ instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+ instance_reference_model['name'] = 'my-instance'
- def test_vpn_gateway_collection_first_serialization(self):
- """
- Test serialization/deserialization for VPNGatewayCollectionFirst
- """
+ volume_attachment_reference_volume_context_model = {} # VolumeAttachmentReferenceVolumeContext
+ volume_attachment_reference_volume_context_model['delete_volume_on_instance_delete'] = True
+ volume_attachment_reference_volume_context_model['deleted'] = volume_attachment_reference_volume_context_deleted_model
+ volume_attachment_reference_volume_context_model['device'] = volume_attachment_device_model
+ volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_volume_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
+ volume_attachment_reference_volume_context_model['instance'] = instance_reference_model
+ volume_attachment_reference_volume_context_model['name'] = 'my-volume-attachment'
+ volume_attachment_reference_volume_context_model['type'] = 'boot'
- # Construct a json representation of a VPNGatewayCollectionFirst model
- vpn_gateway_collection_first_model_json = {}
- vpn_gateway_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?limit=20'
+ 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 model instance of VPNGatewayCollectionFirst by calling from_dict on the json representation
- vpn_gateway_collection_first_model = VPNGatewayCollectionFirst.from_dict(vpn_gateway_collection_first_model_json)
- assert vpn_gateway_collection_first_model != False
+ volume_model = {} # Volume
+ volume_model['active'] = True
+ volume_model['bandwidth'] = 1000
+ volume_model['busy'] = True
+ volume_model['capacity'] = 1000
+ volume_model['created_at'] = "2019-01-01T12:00:00Z"
+ volume_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model['encryption'] = 'provider_managed'
+ volume_model['encryption_key'] = encryption_key_reference_model
+ volume_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_model['iops'] = 10000
+ volume_model['name'] = 'my-volume'
+ volume_model['operating_system'] = operating_system_reference_model
+ volume_model['profile'] = volume_profile_reference_model
+ volume_model['resource_group'] = resource_group_reference_model
+ volume_model['source_image'] = image_reference_model
+ volume_model['source_snapshot'] = snapshot_reference_model
+ volume_model['status'] = 'available'
+ volume_model['status_reasons'] = [volume_status_reason_model]
+ volume_model['volume_attachments'] = [volume_attachment_reference_volume_context_model]
+ volume_model['zone'] = zone_reference_model
- # Construct a model instance of VPNGatewayCollectionFirst by calling from_dict on the json representation
- vpn_gateway_collection_first_model_dict = VPNGatewayCollectionFirst.from_dict(vpn_gateway_collection_first_model_json).__dict__
- vpn_gateway_collection_first_model2 = VPNGatewayCollectionFirst(**vpn_gateway_collection_first_model_dict)
+ # Construct a json representation of a VolumeCollection model
+ volume_collection_model_json = {}
+ volume_collection_model_json['first'] = volume_collection_first_model
+ volume_collection_model_json['limit'] = 20
+ volume_collection_model_json['next'] = volume_collection_next_model
+ volume_collection_model_json['volumes'] = [volume_model]
+
+ # Construct a model instance of VolumeCollection by calling from_dict on the json representation
+ volume_collection_model = VolumeCollection.from_dict(volume_collection_model_json)
+ assert volume_collection_model != False
+
+ # Construct a model instance of VolumeCollection by calling from_dict on the json representation
+ volume_collection_model_dict = VolumeCollection.from_dict(volume_collection_model_json).__dict__
+ volume_collection_model2 = VolumeCollection(**volume_collection_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_collection_first_model == vpn_gateway_collection_first_model2
+ assert volume_collection_model == volume_collection_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_collection_first_model_json2 = vpn_gateway_collection_first_model.to_dict()
- assert vpn_gateway_collection_first_model_json2 == vpn_gateway_collection_first_model_json
+ volume_collection_model_json2 = volume_collection_model.to_dict()
+ assert volume_collection_model_json2 == volume_collection_model_json
-class TestModel_VPNGatewayCollectionNext():
+class TestModel_VolumeCollectionFirst():
"""
- Test Class for VPNGatewayCollectionNext
+ Test Class for VolumeCollectionFirst
"""
- def test_vpn_gateway_collection_next_serialization(self):
+ def test_volume_collection_first_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayCollectionNext
+ Test serialization/deserialization for VolumeCollectionFirst
"""
- # Construct a json representation of a VPNGatewayCollectionNext model
- vpn_gateway_collection_next_model_json = {}
- vpn_gateway_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways?start=9d5a91a3e2cbd233b5a5b33436855ed&limit=20'
+ # Construct a json representation of a VolumeCollectionFirst model
+ volume_collection_first_model_json = {}
+ volume_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20'
- # Construct a model instance of VPNGatewayCollectionNext by calling from_dict on the json representation
- vpn_gateway_collection_next_model = VPNGatewayCollectionNext.from_dict(vpn_gateway_collection_next_model_json)
- assert vpn_gateway_collection_next_model != False
+ # Construct a model instance of VolumeCollectionFirst by calling from_dict on the json representation
+ volume_collection_first_model = VolumeCollectionFirst.from_dict(volume_collection_first_model_json)
+ assert volume_collection_first_model != False
- # Construct a model instance of VPNGatewayCollectionNext by calling from_dict on the json representation
- vpn_gateway_collection_next_model_dict = VPNGatewayCollectionNext.from_dict(vpn_gateway_collection_next_model_json).__dict__
- vpn_gateway_collection_next_model2 = VPNGatewayCollectionNext(**vpn_gateway_collection_next_model_dict)
+ # Construct a model instance of VolumeCollectionFirst by calling from_dict on the json representation
+ volume_collection_first_model_dict = VolumeCollectionFirst.from_dict(volume_collection_first_model_json).__dict__
+ volume_collection_first_model2 = VolumeCollectionFirst(**volume_collection_first_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_collection_next_model == vpn_gateway_collection_next_model2
+ assert volume_collection_first_model == volume_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_collection_next_model_json2 = vpn_gateway_collection_next_model.to_dict()
- assert vpn_gateway_collection_next_model_json2 == vpn_gateway_collection_next_model_json
+ volume_collection_first_model_json2 = volume_collection_first_model.to_dict()
+ assert volume_collection_first_model_json2 == volume_collection_first_model_json
-class TestModel_VPNGatewayConnectionCollection():
+class TestModel_VolumeCollectionNext():
"""
- Test Class for VPNGatewayConnectionCollection
+ Test Class for VolumeCollectionNext
"""
- def test_vpn_gateway_connection_collection_serialization(self):
+ def test_volume_collection_next_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionCollection
+ Test serialization/deserialization for VolumeCollectionNext
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- vpn_gateway_connection_dpd_model = {} # VPNGatewayConnectionDPD
- vpn_gateway_connection_dpd_model['action'] = 'restart'
- vpn_gateway_connection_dpd_model['interval'] = 30
- vpn_gateway_connection_dpd_model['timeout'] = 120
-
- ike_policy_reference_deleted_model = {} # IKEPolicyReferenceDeleted
- ike_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- ike_policy_reference_model = {} # IKEPolicyReference
- ike_policy_reference_model['deleted'] = ike_policy_reference_deleted_model
- ike_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ike_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- ike_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- ike_policy_reference_model['name'] = 'my-ike-policy'
- ike_policy_reference_model['resource_type'] = 'ike_policy'
-
- i_psec_policy_reference_deleted_model = {} # IPsecPolicyReferenceDeleted
- i_psec_policy_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- i_psec_policy_reference_model = {} # IPsecPolicyReference
- i_psec_policy_reference_model['deleted'] = i_psec_policy_reference_deleted_model
- i_psec_policy_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/ipsec_policies/ddf51bec-3424-11e8-b467-0ed5f89f718b'
- i_psec_policy_reference_model['id'] = 'ddf51bec-3424-11e8-b467-0ed5f89f718b'
- i_psec_policy_reference_model['name'] = 'my-ipsec-policy'
- i_psec_policy_reference_model['resource_type'] = 'ipsec_policy'
-
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
-
- vpn_gateway_connection_static_route_mode_tunnel_model = {} # VPNGatewayConnectionStaticRouteModeTunnel
- vpn_gateway_connection_static_route_mode_tunnel_model['public_ip'] = ip_model
- vpn_gateway_connection_static_route_mode_tunnel_model['status'] = 'down'
-
- vpn_gateway_connection_model = {} # VPNGatewayConnectionStaticRouteMode
- vpn_gateway_connection_model['admin_state_up'] = True
- vpn_gateway_connection_model['authentication_mode'] = 'psk'
- vpn_gateway_connection_model['created_at'] = "2019-01-01T12:00:00Z"
- vpn_gateway_connection_model['dead_peer_detection'] = vpn_gateway_connection_dpd_model
- vpn_gateway_connection_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
- vpn_gateway_connection_model['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- vpn_gateway_connection_model['ike_policy'] = ike_policy_reference_model
- vpn_gateway_connection_model['ipsec_policy'] = i_psec_policy_reference_model
- vpn_gateway_connection_model['mode'] = 'route'
- vpn_gateway_connection_model['name'] = 'my-vpn-connection'
- vpn_gateway_connection_model['peer_address'] = '169.21.50.5'
- vpn_gateway_connection_model['psk'] = 'lkj14b1oi0alcniejkso'
- vpn_gateway_connection_model['resource_type'] = 'vpn_gateway_connection'
- vpn_gateway_connection_model['status'] = 'down'
- vpn_gateway_connection_model['routing_protocol'] = 'none'
- vpn_gateway_connection_model['tunnels'] = [vpn_gateway_connection_static_route_mode_tunnel_model]
-
- # Construct a json representation of a VPNGatewayConnectionCollection model
- vpn_gateway_connection_collection_model_json = {}
- vpn_gateway_connection_collection_model_json['connections'] = [vpn_gateway_connection_model]
+ # Construct a json representation of a VolumeCollectionNext model
+ volume_collection_next_model_json = {}
+ volume_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of VPNGatewayConnectionCollection by calling from_dict on the json representation
- vpn_gateway_connection_collection_model = VPNGatewayConnectionCollection.from_dict(vpn_gateway_connection_collection_model_json)
- assert vpn_gateway_connection_collection_model != False
+ # Construct a model instance of VolumeCollectionNext by calling from_dict on the json representation
+ volume_collection_next_model = VolumeCollectionNext.from_dict(volume_collection_next_model_json)
+ assert volume_collection_next_model != False
- # Construct a model instance of VPNGatewayConnectionCollection by calling from_dict on the json representation
- vpn_gateway_connection_collection_model_dict = VPNGatewayConnectionCollection.from_dict(vpn_gateway_connection_collection_model_json).__dict__
- vpn_gateway_connection_collection_model2 = VPNGatewayConnectionCollection(**vpn_gateway_connection_collection_model_dict)
+ # Construct a model instance of VolumeCollectionNext by calling from_dict on the json representation
+ volume_collection_next_model_dict = VolumeCollectionNext.from_dict(volume_collection_next_model_json).__dict__
+ volume_collection_next_model2 = VolumeCollectionNext(**volume_collection_next_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_collection_model == vpn_gateway_connection_collection_model2
+ assert volume_collection_next_model == volume_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_collection_model_json2 = vpn_gateway_connection_collection_model.to_dict()
- assert vpn_gateway_connection_collection_model_json2 == vpn_gateway_connection_collection_model_json
+ volume_collection_next_model_json2 = volume_collection_next_model.to_dict()
+ assert volume_collection_next_model_json2 == volume_collection_next_model_json
-class TestModel_VPNGatewayConnectionDPD():
+class TestModel_VolumePatch():
"""
- Test Class for VPNGatewayConnectionDPD
+ Test Class for VolumePatch
"""
- def test_vpn_gateway_connection_dpd_serialization(self):
+ def test_volume_patch_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionDPD
+ Test serialization/deserialization for VolumePatch
"""
- # Construct a json representation of a VPNGatewayConnectionDPD model
- vpn_gateway_connection_dpd_model_json = {}
- vpn_gateway_connection_dpd_model_json['action'] = 'restart'
- vpn_gateway_connection_dpd_model_json['interval'] = 30
- vpn_gateway_connection_dpd_model_json['timeout'] = 120
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNGatewayConnectionDPD by calling from_dict on the json representation
- vpn_gateway_connection_dpd_model = VPNGatewayConnectionDPD.from_dict(vpn_gateway_connection_dpd_model_json)
- assert vpn_gateway_connection_dpd_model != False
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
- # Construct a model instance of VPNGatewayConnectionDPD by calling from_dict on the json representation
- vpn_gateway_connection_dpd_model_dict = VPNGatewayConnectionDPD.from_dict(vpn_gateway_connection_dpd_model_json).__dict__
- vpn_gateway_connection_dpd_model2 = VPNGatewayConnectionDPD(**vpn_gateway_connection_dpd_model_dict)
+ # Construct a json representation of a VolumePatch model
+ volume_patch_model_json = {}
+ volume_patch_model_json['capacity'] = 100
+ volume_patch_model_json['iops'] = 10000
+ volume_patch_model_json['name'] = 'my-volume'
+ volume_patch_model_json['profile'] = volume_profile_identity_model
+
+ # Construct a model instance of VolumePatch by calling from_dict on the json representation
+ volume_patch_model = VolumePatch.from_dict(volume_patch_model_json)
+ assert volume_patch_model != False
+
+ # Construct a model instance of VolumePatch by calling from_dict on the json representation
+ volume_patch_model_dict = VolumePatch.from_dict(volume_patch_model_json).__dict__
+ volume_patch_model2 = VolumePatch(**volume_patch_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_dpd_model == vpn_gateway_connection_dpd_model2
+ assert volume_patch_model == volume_patch_model2
- # Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_dpd_model_json2 = vpn_gateway_connection_dpd_model.to_dict()
- assert vpn_gateway_connection_dpd_model_json2 == vpn_gateway_connection_dpd_model_json
+ # Convert model instance back to dict and verify no loss of data
+ volume_patch_model_json2 = volume_patch_model.to_dict()
+ assert volume_patch_model_json2 == volume_patch_model_json
-class TestModel_VPNGatewayConnectionDPDPatch():
+class TestModel_VolumeProfile():
"""
- Test Class for VPNGatewayConnectionDPDPatch
+ Test Class for VolumeProfile
"""
- def test_vpn_gateway_connection_dpd_patch_serialization(self):
+ def test_volume_profile_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionDPDPatch
+ Test serialization/deserialization for VolumeProfile
"""
- # Construct a json representation of a VPNGatewayConnectionDPDPatch model
- vpn_gateway_connection_dpd_patch_model_json = {}
- vpn_gateway_connection_dpd_patch_model_json['action'] = 'restart'
- vpn_gateway_connection_dpd_patch_model_json['interval'] = 30
- vpn_gateway_connection_dpd_patch_model_json['timeout'] = 120
+ # Construct a json representation of a VolumeProfile model
+ volume_profile_model_json = {}
+ volume_profile_model_json['family'] = 'tiered'
+ volume_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
+ volume_profile_model_json['name'] = 'general-purpose'
- # Construct a model instance of VPNGatewayConnectionDPDPatch by calling from_dict on the json representation
- vpn_gateway_connection_dpd_patch_model = VPNGatewayConnectionDPDPatch.from_dict(vpn_gateway_connection_dpd_patch_model_json)
- assert vpn_gateway_connection_dpd_patch_model != False
+ # Construct a model instance of VolumeProfile by calling from_dict on the json representation
+ volume_profile_model = VolumeProfile.from_dict(volume_profile_model_json)
+ assert volume_profile_model != False
- # Construct a model instance of VPNGatewayConnectionDPDPatch by calling from_dict on the json representation
- vpn_gateway_connection_dpd_patch_model_dict = VPNGatewayConnectionDPDPatch.from_dict(vpn_gateway_connection_dpd_patch_model_json).__dict__
- vpn_gateway_connection_dpd_patch_model2 = VPNGatewayConnectionDPDPatch(**vpn_gateway_connection_dpd_patch_model_dict)
+ # Construct a model instance of VolumeProfile by calling from_dict on the json representation
+ volume_profile_model_dict = VolumeProfile.from_dict(volume_profile_model_json).__dict__
+ volume_profile_model2 = VolumeProfile(**volume_profile_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_dpd_patch_model == vpn_gateway_connection_dpd_patch_model2
+ assert volume_profile_model == volume_profile_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_dpd_patch_model_json2 = vpn_gateway_connection_dpd_patch_model.to_dict()
- assert vpn_gateway_connection_dpd_patch_model_json2 == vpn_gateway_connection_dpd_patch_model_json
+ volume_profile_model_json2 = volume_profile_model.to_dict()
+ assert volume_profile_model_json2 == volume_profile_model_json
-class TestModel_VPNGatewayConnectionDPDPrototype():
+class TestModel_VolumeProfileCollection():
"""
- Test Class for VPNGatewayConnectionDPDPrototype
+ Test Class for VolumeProfileCollection
"""
- def test_vpn_gateway_connection_dpd_prototype_serialization(self):
+ def test_volume_profile_collection_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionDPDPrototype
+ Test serialization/deserialization for VolumeProfileCollection
"""
- # Construct a json representation of a VPNGatewayConnectionDPDPrototype model
- vpn_gateway_connection_dpd_prototype_model_json = {}
- vpn_gateway_connection_dpd_prototype_model_json['action'] = 'restart'
- vpn_gateway_connection_dpd_prototype_model_json['interval'] = 30
- vpn_gateway_connection_dpd_prototype_model_json['timeout'] = 120
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNGatewayConnectionDPDPrototype by calling from_dict on the json representation
- vpn_gateway_connection_dpd_prototype_model = VPNGatewayConnectionDPDPrototype.from_dict(vpn_gateway_connection_dpd_prototype_model_json)
- assert vpn_gateway_connection_dpd_prototype_model != False
+ volume_profile_collection_first_model = {} # VolumeProfileCollectionFirst
+ volume_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20'
- # Construct a model instance of VPNGatewayConnectionDPDPrototype by calling from_dict on the json representation
- vpn_gateway_connection_dpd_prototype_model_dict = VPNGatewayConnectionDPDPrototype.from_dict(vpn_gateway_connection_dpd_prototype_model_json).__dict__
- vpn_gateway_connection_dpd_prototype_model2 = VPNGatewayConnectionDPDPrototype(**vpn_gateway_connection_dpd_prototype_model_dict)
+ volume_profile_collection_next_model = {} # VolumeProfileCollectionNext
+ volume_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+
+ volume_profile_model = {} # VolumeProfile
+ volume_profile_model['family'] = 'tiered'
+ volume_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
+ volume_profile_model['name'] = 'general-purpose'
+
+ # Construct a json representation of a VolumeProfileCollection model
+ volume_profile_collection_model_json = {}
+ volume_profile_collection_model_json['first'] = volume_profile_collection_first_model
+ volume_profile_collection_model_json['limit'] = 20
+ volume_profile_collection_model_json['next'] = volume_profile_collection_next_model
+ volume_profile_collection_model_json['profiles'] = [volume_profile_model]
+ volume_profile_collection_model_json['total_count'] = 132
+
+ # Construct a model instance of VolumeProfileCollection by calling from_dict on the json representation
+ volume_profile_collection_model = VolumeProfileCollection.from_dict(volume_profile_collection_model_json)
+ assert volume_profile_collection_model != False
+
+ # Construct a model instance of VolumeProfileCollection by calling from_dict on the json representation
+ volume_profile_collection_model_dict = VolumeProfileCollection.from_dict(volume_profile_collection_model_json).__dict__
+ volume_profile_collection_model2 = VolumeProfileCollection(**volume_profile_collection_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_dpd_prototype_model == vpn_gateway_connection_dpd_prototype_model2
+ assert volume_profile_collection_model == volume_profile_collection_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_dpd_prototype_model_json2 = vpn_gateway_connection_dpd_prototype_model.to_dict()
- assert vpn_gateway_connection_dpd_prototype_model_json2 == vpn_gateway_connection_dpd_prototype_model_json
+ volume_profile_collection_model_json2 = volume_profile_collection_model.to_dict()
+ assert volume_profile_collection_model_json2 == volume_profile_collection_model_json
-class TestModel_VPNGatewayConnectionLocalCIDRs():
+class TestModel_VolumeProfileCollectionFirst():
"""
- Test Class for VPNGatewayConnectionLocalCIDRs
+ Test Class for VolumeProfileCollectionFirst
"""
- def test_vpn_gateway_connection_local_cid_rs_serialization(self):
+ def test_volume_profile_collection_first_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionLocalCIDRs
+ Test serialization/deserialization for VolumeProfileCollectionFirst
"""
- # Construct a json representation of a VPNGatewayConnectionLocalCIDRs model
- vpn_gateway_connection_local_cid_rs_model_json = {}
- vpn_gateway_connection_local_cid_rs_model_json['local_cidrs'] = ['192.168.1.0/24']
+ # Construct a json representation of a VolumeProfileCollectionFirst model
+ volume_profile_collection_first_model_json = {}
+ volume_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20'
- # Construct a model instance of VPNGatewayConnectionLocalCIDRs by calling from_dict on the json representation
- vpn_gateway_connection_local_cid_rs_model = VPNGatewayConnectionLocalCIDRs.from_dict(vpn_gateway_connection_local_cid_rs_model_json)
- assert vpn_gateway_connection_local_cid_rs_model != False
+ # Construct a model instance of VolumeProfileCollectionFirst by calling from_dict on the json representation
+ volume_profile_collection_first_model = VolumeProfileCollectionFirst.from_dict(volume_profile_collection_first_model_json)
+ assert volume_profile_collection_first_model != False
- # Construct a model instance of VPNGatewayConnectionLocalCIDRs by calling from_dict on the json representation
- vpn_gateway_connection_local_cid_rs_model_dict = VPNGatewayConnectionLocalCIDRs.from_dict(vpn_gateway_connection_local_cid_rs_model_json).__dict__
- vpn_gateway_connection_local_cid_rs_model2 = VPNGatewayConnectionLocalCIDRs(**vpn_gateway_connection_local_cid_rs_model_dict)
+ # Construct a model instance of VolumeProfileCollectionFirst by calling from_dict on the json representation
+ volume_profile_collection_first_model_dict = VolumeProfileCollectionFirst.from_dict(volume_profile_collection_first_model_json).__dict__
+ volume_profile_collection_first_model2 = VolumeProfileCollectionFirst(**volume_profile_collection_first_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_local_cid_rs_model == vpn_gateway_connection_local_cid_rs_model2
+ assert volume_profile_collection_first_model == volume_profile_collection_first_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_local_cid_rs_model_json2 = vpn_gateway_connection_local_cid_rs_model.to_dict()
- assert vpn_gateway_connection_local_cid_rs_model_json2 == vpn_gateway_connection_local_cid_rs_model_json
+ volume_profile_collection_first_model_json2 = volume_profile_collection_first_model.to_dict()
+ assert volume_profile_collection_first_model_json2 == volume_profile_collection_first_model_json
-class TestModel_VPNGatewayConnectionPeerCIDRs():
+class TestModel_VolumeProfileCollectionNext():
"""
- Test Class for VPNGatewayConnectionPeerCIDRs
+ Test Class for VolumeProfileCollectionNext
"""
- def test_vpn_gateway_connection_peer_cid_rs_serialization(self):
+ def test_volume_profile_collection_next_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionPeerCIDRs
+ Test serialization/deserialization for VolumeProfileCollectionNext
"""
- # Construct a json representation of a VPNGatewayConnectionPeerCIDRs model
- vpn_gateway_connection_peer_cid_rs_model_json = {}
- vpn_gateway_connection_peer_cid_rs_model_json['peer_cidrs'] = ['10.45.1.0/24']
+ # Construct a json representation of a VolumeProfileCollectionNext model
+ volume_profile_collection_next_model_json = {}
+ volume_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
- # Construct a model instance of VPNGatewayConnectionPeerCIDRs by calling from_dict on the json representation
- vpn_gateway_connection_peer_cid_rs_model = VPNGatewayConnectionPeerCIDRs.from_dict(vpn_gateway_connection_peer_cid_rs_model_json)
- assert vpn_gateway_connection_peer_cid_rs_model != False
+ # Construct a model instance of VolumeProfileCollectionNext by calling from_dict on the json representation
+ volume_profile_collection_next_model = VolumeProfileCollectionNext.from_dict(volume_profile_collection_next_model_json)
+ assert volume_profile_collection_next_model != False
- # Construct a model instance of VPNGatewayConnectionPeerCIDRs by calling from_dict on the json representation
- vpn_gateway_connection_peer_cid_rs_model_dict = VPNGatewayConnectionPeerCIDRs.from_dict(vpn_gateway_connection_peer_cid_rs_model_json).__dict__
- vpn_gateway_connection_peer_cid_rs_model2 = VPNGatewayConnectionPeerCIDRs(**vpn_gateway_connection_peer_cid_rs_model_dict)
+ # Construct a model instance of VolumeProfileCollectionNext by calling from_dict on the json representation
+ volume_profile_collection_next_model_dict = VolumeProfileCollectionNext.from_dict(volume_profile_collection_next_model_json).__dict__
+ volume_profile_collection_next_model2 = VolumeProfileCollectionNext(**volume_profile_collection_next_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_peer_cid_rs_model == vpn_gateway_connection_peer_cid_rs_model2
+ assert volume_profile_collection_next_model == volume_profile_collection_next_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_peer_cid_rs_model_json2 = vpn_gateway_connection_peer_cid_rs_model.to_dict()
- assert vpn_gateway_connection_peer_cid_rs_model_json2 == vpn_gateway_connection_peer_cid_rs_model_json
+ volume_profile_collection_next_model_json2 = volume_profile_collection_next_model.to_dict()
+ assert volume_profile_collection_next_model_json2 == volume_profile_collection_next_model_json
-class TestModel_VPNGatewayConnectionReference():
+class TestModel_VolumeProfileReference():
"""
- Test Class for VPNGatewayConnectionReference
+ Test Class for VolumeProfileReference
"""
- def test_vpn_gateway_connection_reference_serialization(self):
+ def test_volume_profile_reference_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionReference
+ Test serialization/deserialization for VolumeProfileReference
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- vpn_gateway_connection_reference_deleted_model = {} # VPNGatewayConnectionReferenceDeleted
- vpn_gateway_connection_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a VPNGatewayConnectionReference model
- vpn_gateway_connection_reference_model_json = {}
- vpn_gateway_connection_reference_model_json['deleted'] = vpn_gateway_connection_reference_deleted_model
- vpn_gateway_connection_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/vpn_gateways/ddf51bec-3424-11e8-b467-0ed5f89f718b/connections/93487806-7743-4c46-81d6-72869883ea0b'
- vpn_gateway_connection_reference_model_json['id'] = 'a10a5771-dc23-442c-8460-c3601d8542f7'
- vpn_gateway_connection_reference_model_json['name'] = 'my-vpn-connection'
- vpn_gateway_connection_reference_model_json['resource_type'] = 'vpn_gateway_connection'
+ # Construct a json representation of a VolumeProfileReference model
+ volume_profile_reference_model_json = {}
+ volume_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
+ volume_profile_reference_model_json['name'] = 'general-purpose'
- # Construct a model instance of VPNGatewayConnectionReference by calling from_dict on the json representation
- vpn_gateway_connection_reference_model = VPNGatewayConnectionReference.from_dict(vpn_gateway_connection_reference_model_json)
- assert vpn_gateway_connection_reference_model != False
+ # Construct a model instance of VolumeProfileReference by calling from_dict on the json representation
+ volume_profile_reference_model = VolumeProfileReference.from_dict(volume_profile_reference_model_json)
+ assert volume_profile_reference_model != False
- # Construct a model instance of VPNGatewayConnectionReference by calling from_dict on the json representation
- vpn_gateway_connection_reference_model_dict = VPNGatewayConnectionReference.from_dict(vpn_gateway_connection_reference_model_json).__dict__
- vpn_gateway_connection_reference_model2 = VPNGatewayConnectionReference(**vpn_gateway_connection_reference_model_dict)
+ # Construct a model instance of VolumeProfileReference by calling from_dict on the json representation
+ volume_profile_reference_model_dict = VolumeProfileReference.from_dict(volume_profile_reference_model_json).__dict__
+ volume_profile_reference_model2 = VolumeProfileReference(**volume_profile_reference_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_reference_model == vpn_gateway_connection_reference_model2
+ assert volume_profile_reference_model == volume_profile_reference_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_reference_model_json2 = vpn_gateway_connection_reference_model.to_dict()
- assert vpn_gateway_connection_reference_model_json2 == vpn_gateway_connection_reference_model_json
+ volume_profile_reference_model_json2 = volume_profile_reference_model.to_dict()
+ assert volume_profile_reference_model_json2 == volume_profile_reference_model_json
-class TestModel_VPNGatewayConnectionReferenceDeleted():
+class TestModel_VolumePrototypeInstanceByImageContext():
"""
- Test Class for VPNGatewayConnectionReferenceDeleted
+ Test Class for VolumePrototypeInstanceByImageContext
"""
- def test_vpn_gateway_connection_reference_deleted_serialization(self):
+ def test_volume_prototype_instance_by_image_context_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionReferenceDeleted
+ Test serialization/deserialization for VolumePrototypeInstanceByImageContext
"""
- # Construct a json representation of a VPNGatewayConnectionReferenceDeleted model
- vpn_gateway_connection_reference_deleted_model_json = {}
- vpn_gateway_connection_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VPNGatewayConnectionReferenceDeleted by calling from_dict on the json representation
- vpn_gateway_connection_reference_deleted_model = VPNGatewayConnectionReferenceDeleted.from_dict(vpn_gateway_connection_reference_deleted_model_json)
- assert vpn_gateway_connection_reference_deleted_model != False
+ encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
+ encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
- # Construct a model instance of VPNGatewayConnectionReferenceDeleted by calling from_dict on the json representation
- vpn_gateway_connection_reference_deleted_model_dict = VPNGatewayConnectionReferenceDeleted.from_dict(vpn_gateway_connection_reference_deleted_model_json).__dict__
- vpn_gateway_connection_reference_deleted_model2 = VPNGatewayConnectionReferenceDeleted(**vpn_gateway_connection_reference_deleted_model_dict)
+ volume_profile_identity_model = {} # VolumeProfileIdentityByName
+ volume_profile_identity_model['name'] = 'general-purpose'
+
+ # Construct a json representation of a VolumePrototypeInstanceByImageContext model
+ volume_prototype_instance_by_image_context_model_json = {}
+ volume_prototype_instance_by_image_context_model_json['capacity'] = 38
+ volume_prototype_instance_by_image_context_model_json['encryption_key'] = encryption_key_identity_model
+ volume_prototype_instance_by_image_context_model_json['iops'] = 10000
+ volume_prototype_instance_by_image_context_model_json['name'] = 'my-volume'
+ volume_prototype_instance_by_image_context_model_json['profile'] = volume_profile_identity_model
+
+ # Construct a model instance of VolumePrototypeInstanceByImageContext by calling from_dict on the json representation
+ volume_prototype_instance_by_image_context_model = VolumePrototypeInstanceByImageContext.from_dict(volume_prototype_instance_by_image_context_model_json)
+ assert volume_prototype_instance_by_image_context_model != False
+
+ # Construct a model instance of VolumePrototypeInstanceByImageContext by calling from_dict on the json representation
+ volume_prototype_instance_by_image_context_model_dict = VolumePrototypeInstanceByImageContext.from_dict(volume_prototype_instance_by_image_context_model_json).__dict__
+ volume_prototype_instance_by_image_context_model2 = VolumePrototypeInstanceByImageContext(**volume_prototype_instance_by_image_context_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_reference_deleted_model == vpn_gateway_connection_reference_deleted_model2
+ assert volume_prototype_instance_by_image_context_model == volume_prototype_instance_by_image_context_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_reference_deleted_model_json2 = vpn_gateway_connection_reference_deleted_model.to_dict()
- assert vpn_gateway_connection_reference_deleted_model_json2 == vpn_gateway_connection_reference_deleted_model_json
+ volume_prototype_instance_by_image_context_model_json2 = volume_prototype_instance_by_image_context_model.to_dict()
+ assert volume_prototype_instance_by_image_context_model_json2 == volume_prototype_instance_by_image_context_model_json
-class TestModel_VPNGatewayConnectionStaticRouteModeTunnel():
+class TestModel_VolumeReference():
"""
- Test Class for VPNGatewayConnectionStaticRouteModeTunnel
+ Test Class for VolumeReference
"""
- def test_vpn_gateway_connection_static_route_mode_tunnel_serialization(self):
+ def test_volume_reference_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayConnectionStaticRouteModeTunnel
+ Test serialization/deserialization for VolumeReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
+ volume_reference_deleted_model = {} # VolumeReferenceDeleted
+ volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a VPNGatewayConnectionStaticRouteModeTunnel model
- vpn_gateway_connection_static_route_mode_tunnel_model_json = {}
- vpn_gateway_connection_static_route_mode_tunnel_model_json['public_ip'] = ip_model
- vpn_gateway_connection_static_route_mode_tunnel_model_json['status'] = 'down'
+ # Construct a json representation of a VolumeReference model
+ volume_reference_model_json = {}
+ volume_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model_json['deleted'] = volume_reference_deleted_model
+ volume_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ volume_reference_model_json['name'] = 'my-volume'
- # Construct a model instance of VPNGatewayConnectionStaticRouteModeTunnel by calling from_dict on the json representation
- vpn_gateway_connection_static_route_mode_tunnel_model = VPNGatewayConnectionStaticRouteModeTunnel.from_dict(vpn_gateway_connection_static_route_mode_tunnel_model_json)
- assert vpn_gateway_connection_static_route_mode_tunnel_model != False
+ # Construct a model instance of VolumeReference by calling from_dict on the json representation
+ volume_reference_model = VolumeReference.from_dict(volume_reference_model_json)
+ assert volume_reference_model != False
- # Construct a model instance of VPNGatewayConnectionStaticRouteModeTunnel by calling from_dict on the json representation
- vpn_gateway_connection_static_route_mode_tunnel_model_dict = VPNGatewayConnectionStaticRouteModeTunnel.from_dict(vpn_gateway_connection_static_route_mode_tunnel_model_json).__dict__
- vpn_gateway_connection_static_route_mode_tunnel_model2 = VPNGatewayConnectionStaticRouteModeTunnel(**vpn_gateway_connection_static_route_mode_tunnel_model_dict)
+ # Construct a model instance of VolumeReference by calling from_dict on the json representation
+ volume_reference_model_dict = VolumeReference.from_dict(volume_reference_model_json).__dict__
+ volume_reference_model2 = VolumeReference(**volume_reference_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_connection_static_route_mode_tunnel_model == vpn_gateway_connection_static_route_mode_tunnel_model2
+ assert volume_reference_model == volume_reference_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_connection_static_route_mode_tunnel_model_json2 = vpn_gateway_connection_static_route_mode_tunnel_model.to_dict()
- assert vpn_gateway_connection_static_route_mode_tunnel_model_json2 == vpn_gateway_connection_static_route_mode_tunnel_model_json
+ volume_reference_model_json2 = volume_reference_model.to_dict()
+ assert volume_reference_model_json2 == volume_reference_model_json
-class TestModel_VPNGatewayMember():
+class TestModel_VolumeReferenceDeleted():
"""
- Test Class for VPNGatewayMember
+ Test Class for VolumeReferenceDeleted
"""
- def test_vpn_gateway_member_serialization(self):
+ def test_volume_reference_deleted_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayMember
+ Test serialization/deserialization for VolumeReferenceDeleted
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- ip_model = {} # IP
- ip_model['address'] = '192.168.3.4'
-
- # Construct a json representation of a VPNGatewayMember model
- vpn_gateway_member_model_json = {}
- vpn_gateway_member_model_json['private_ip'] = ip_model
- vpn_gateway_member_model_json['public_ip'] = ip_model
- vpn_gateway_member_model_json['role'] = 'active'
- vpn_gateway_member_model_json['status'] = 'available'
+ # Construct a json representation of a VolumeReferenceDeleted model
+ volume_reference_deleted_model_json = {}
+ volume_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of VPNGatewayMember by calling from_dict on the json representation
- vpn_gateway_member_model = VPNGatewayMember.from_dict(vpn_gateway_member_model_json)
- assert vpn_gateway_member_model != False
+ # Construct a model instance of VolumeReferenceDeleted by calling from_dict on the json representation
+ volume_reference_deleted_model = VolumeReferenceDeleted.from_dict(volume_reference_deleted_model_json)
+ assert volume_reference_deleted_model != False
- # Construct a model instance of VPNGatewayMember by calling from_dict on the json representation
- vpn_gateway_member_model_dict = VPNGatewayMember.from_dict(vpn_gateway_member_model_json).__dict__
- vpn_gateway_member_model2 = VPNGatewayMember(**vpn_gateway_member_model_dict)
+ # Construct a model instance of VolumeReferenceDeleted by calling from_dict on the json representation
+ volume_reference_deleted_model_dict = VolumeReferenceDeleted.from_dict(volume_reference_deleted_model_json).__dict__
+ volume_reference_deleted_model2 = VolumeReferenceDeleted(**volume_reference_deleted_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_member_model == vpn_gateway_member_model2
+ assert volume_reference_deleted_model == volume_reference_deleted_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_member_model_json2 = vpn_gateway_member_model.to_dict()
- assert vpn_gateway_member_model_json2 == vpn_gateway_member_model_json
+ volume_reference_deleted_model_json2 = volume_reference_deleted_model.to_dict()
+ assert volume_reference_deleted_model_json2 == volume_reference_deleted_model_json
-class TestModel_VPNGatewayPatch():
+class TestModel_VolumeStatusReason():
"""
- Test Class for VPNGatewayPatch
+ Test Class for VolumeStatusReason
"""
- def test_vpn_gateway_patch_serialization(self):
+ def test_volume_status_reason_serialization(self):
"""
- Test serialization/deserialization for VPNGatewayPatch
+ Test serialization/deserialization for VolumeStatusReason
"""
- # Construct a json representation of a VPNGatewayPatch model
- vpn_gateway_patch_model_json = {}
- vpn_gateway_patch_model_json['name'] = 'my-vpn-gateway'
+ # Construct a json representation of a VolumeStatusReason model
+ volume_status_reason_model_json = {}
+ volume_status_reason_model_json['code'] = 'encryption_key_deleted'
+ volume_status_reason_model_json['message'] = 'testString'
+ volume_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
- # Construct a model instance of VPNGatewayPatch by calling from_dict on the json representation
- vpn_gateway_patch_model = VPNGatewayPatch.from_dict(vpn_gateway_patch_model_json)
- assert vpn_gateway_patch_model != False
+ # Construct a model instance of VolumeStatusReason by calling from_dict on the json representation
+ volume_status_reason_model = VolumeStatusReason.from_dict(volume_status_reason_model_json)
+ assert volume_status_reason_model != False
- # Construct a model instance of VPNGatewayPatch by calling from_dict on the json representation
- vpn_gateway_patch_model_dict = VPNGatewayPatch.from_dict(vpn_gateway_patch_model_json).__dict__
- vpn_gateway_patch_model2 = VPNGatewayPatch(**vpn_gateway_patch_model_dict)
+ # Construct a model instance of VolumeStatusReason by calling from_dict on the json representation
+ volume_status_reason_model_dict = VolumeStatusReason.from_dict(volume_status_reason_model_json).__dict__
+ volume_status_reason_model2 = VolumeStatusReason(**volume_status_reason_model_dict)
# Verify the model instances are equivalent
- assert vpn_gateway_patch_model == vpn_gateway_patch_model2
+ assert volume_status_reason_model == volume_status_reason_model2
# Convert model instance back to dict and verify no loss of data
- vpn_gateway_patch_model_json2 = vpn_gateway_patch_model.to_dict()
- assert vpn_gateway_patch_model_json2 == vpn_gateway_patch_model_json
+ volume_status_reason_model_json2 = volume_status_reason_model.to_dict()
+ assert volume_status_reason_model_json2 == volume_status_reason_model_json
-class TestModel_Volume():
+class TestModel_Zone():
"""
- Test Class for Volume
+ Test Class for Zone
"""
- def test_volume_serialization(self):
+ def test_zone_serialization(self):
"""
- Test serialization/deserialization for Volume
+ Test serialization/deserialization for Zone
"""
# 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'
+ region_reference_model = {} # RegionReference
+ region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
+ region_reference_model['name'] = 'us-south'
- operating_system_reference_model = {} # OperatingSystemReference
- operating_system_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- operating_system_reference_model['name'] = 'ubuntu-16-amd64'
+ # Construct a json representation of a Zone model
+ zone_model_json = {}
+ zone_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_model_json['name'] = 'us-south-1'
+ zone_model_json['region'] = region_reference_model
+ zone_model_json['status'] = 'available'
- volume_profile_reference_model = {} # VolumeProfileReference
- volume_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
- volume_profile_reference_model['name'] = 'general-purpose'
+ # Construct a model instance of Zone by calling from_dict on the json representation
+ zone_model = Zone.from_dict(zone_model_json)
+ assert zone_model != False
- resource_group_reference_model = {} # ResourceGroupReference
- resource_group_reference_model['href'] = 'https://resource-controller.cloud.ibm.com/v2/resource_groups/fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['id'] = 'fee82deba12e4c0fb69c3b09d1f12345'
- resource_group_reference_model['name'] = 'my-resource-group'
+ # Construct a model instance of Zone by calling from_dict on the json representation
+ zone_model_dict = Zone.from_dict(zone_model_json).__dict__
+ zone_model2 = Zone(**zone_model_dict)
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert zone_model == zone_model2
- image_reference_model = {} # ImageReference
- image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['deleted'] = image_reference_deleted_model
- image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['name'] = 'my-image'
+ # Convert model instance back to dict and verify no loss of data
+ zone_model_json2 = zone_model.to_dict()
+ assert zone_model_json2 == zone_model_json
- snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
- snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_ZoneCollection():
+ """
+ Test Class for ZoneCollection
+ """
- snapshot_reference_model = {} # SnapshotReference
- snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_reference_model['deleted'] = snapshot_reference_deleted_model
- snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_reference_model['name'] = 'my-snapshot'
- snapshot_reference_model['resource_type'] = 'snapshot'
+ def test_zone_collection_serialization(self):
+ """
+ Test serialization/deserialization for ZoneCollection
+ """
- volume_status_reason_model = {} # VolumeStatusReason
- volume_status_reason_model['code'] = 'encryption_key_deleted'
- volume_status_reason_model['message'] = 'testString'
- volume_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
+ # Construct dict forms of any model objects needed in order to build this model.
- volume_attachment_reference_volume_context_deleted_model = {} # VolumeAttachmentReferenceVolumeContextDeleted
- volume_attachment_reference_volume_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ region_reference_model = {} # RegionReference
+ region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
+ region_reference_model['name'] = 'us-south'
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ zone_model = {} # Zone
+ zone_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_model['name'] = 'us-south-1'
+ zone_model['region'] = region_reference_model
+ zone_model['status'] = 'available'
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a ZoneCollection model
+ zone_collection_model_json = {}
+ zone_collection_model_json['zones'] = [zone_model]
- instance_reference_model = {} # InstanceReference
- instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['deleted'] = instance_reference_deleted_model
- instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['name'] = 'my-instance'
+ # Construct a model instance of ZoneCollection by calling from_dict on the json representation
+ zone_collection_model = ZoneCollection.from_dict(zone_collection_model_json)
+ assert zone_collection_model != False
- volume_attachment_reference_volume_context_model = {} # VolumeAttachmentReferenceVolumeContext
- volume_attachment_reference_volume_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_reference_volume_context_model['deleted'] = volume_attachment_reference_volume_context_deleted_model
- volume_attachment_reference_volume_context_model['device'] = volume_attachment_device_model
- volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_volume_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_volume_context_model['instance'] = instance_reference_model
- volume_attachment_reference_volume_context_model['name'] = 'my-volume-attachment'
- volume_attachment_reference_volume_context_model['type'] = 'boot'
+ # Construct a model instance of ZoneCollection by calling from_dict on the json representation
+ zone_collection_model_dict = ZoneCollection.from_dict(zone_collection_model_json).__dict__
+ zone_collection_model2 = ZoneCollection(**zone_collection_model_dict)
- zone_reference_model = {} # ZoneReference
- zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model['name'] = 'us-south-1'
+ # Verify the model instances are equivalent
+ assert zone_collection_model == zone_collection_model2
- # Construct a json representation of a Volume model
- volume_model_json = {}
- volume_model_json['active'] = True
- volume_model_json['bandwidth'] = 1000
- volume_model_json['busy'] = True
- volume_model_json['capacity'] = 1000
- volume_model_json['created_at'] = "2019-01-01T12:00:00Z"
- volume_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model_json['encryption'] = 'provider_managed'
- volume_model_json['encryption_key'] = encryption_key_reference_model
- volume_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model_json['iops'] = 10000
- volume_model_json['name'] = 'my-volume'
- volume_model_json['operating_system'] = operating_system_reference_model
- volume_model_json['profile'] = volume_profile_reference_model
- volume_model_json['resource_group'] = resource_group_reference_model
- volume_model_json['source_image'] = image_reference_model
- volume_model_json['source_snapshot'] = snapshot_reference_model
- volume_model_json['status'] = 'available'
- volume_model_json['status_reasons'] = [volume_status_reason_model]
- volume_model_json['volume_attachments'] = [volume_attachment_reference_volume_context_model]
- volume_model_json['zone'] = zone_reference_model
+ # Convert model instance back to dict and verify no loss of data
+ zone_collection_model_json2 = zone_collection_model.to_dict()
+ assert zone_collection_model_json2 == zone_collection_model_json
- # Construct a model instance of Volume by calling from_dict on the json representation
- volume_model = Volume.from_dict(volume_model_json)
- assert volume_model != False
+class TestModel_ZoneReference():
+ """
+ Test Class for ZoneReference
+ """
+
+ def test_zone_reference_serialization(self):
+ """
+ Test serialization/deserialization for ZoneReference
+ """
+
+ # Construct a json representation of a ZoneReference model
+ zone_reference_model_json = {}
+ zone_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
+ zone_reference_model_json['name'] = 'us-south-1'
+
+ # Construct a model instance of ZoneReference by calling from_dict on the json representation
+ zone_reference_model = ZoneReference.from_dict(zone_reference_model_json)
+ assert zone_reference_model != False
- # Construct a model instance of Volume by calling from_dict on the json representation
- volume_model_dict = Volume.from_dict(volume_model_json).__dict__
- volume_model2 = Volume(**volume_model_dict)
+ # Construct a model instance of ZoneReference by calling from_dict on the json representation
+ zone_reference_model_dict = ZoneReference.from_dict(zone_reference_model_json).__dict__
+ zone_reference_model2 = ZoneReference(**zone_reference_model_dict)
# Verify the model instances are equivalent
- assert volume_model == volume_model2
+ assert zone_reference_model == zone_reference_model2
# Convert model instance back to dict and verify no loss of data
- volume_model_json2 = volume_model.to_dict()
- assert volume_model_json2 == volume_model_json
+ zone_reference_model_json2 = zone_reference_model.to_dict()
+ assert zone_reference_model_json2 == zone_reference_model_json
-class TestModel_VolumeAttachment():
+class TestModel_BareMetalServerBootTargetBareMetalServerDiskReference():
"""
- Test Class for VolumeAttachment
+ Test Class for BareMetalServerBootTargetBareMetalServerDiskReference
"""
- def test_volume_attachment_serialization(self):
+ def test_bare_metal_server_boot_target_bare_metal_server_disk_reference_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachment
+ Test serialization/deserialization for BareMetalServerBootTargetBareMetalServerDiskReference
"""
# Construct dict forms of any model objects needed in order to build this model.
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
-
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_reference_model = {} # VolumeReference
- volume_reference_model['crn'] = 'crn:[...]'
- volume_reference_model['deleted'] = volume_reference_deleted_model
- volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ca4b6df3-f5a8-4667-b5f2-f3b9b4160781'
- volume_reference_model['id'] = 'ca4b6df3-f5a8-4667-b5f2-f3b9b4160781'
- volume_reference_model['name'] = 'my-data-volume'
+ bare_metal_server_disk_reference_deleted_model = {} # BareMetalServerDiskReferenceDeleted
+ bare_metal_server_disk_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a VolumeAttachment model
- volume_attachment_model_json = {}
- volume_attachment_model_json['bandwidth'] = 250
- volume_attachment_model_json['created_at'] = "2019-01-01T12:00:00Z"
- volume_attachment_model_json['delete_volume_on_instance_delete'] = True
- volume_attachment_model_json['device'] = volume_attachment_device_model
- volume_attachment_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_model_json['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_model_json['name'] = 'my-volume-attachment'
- volume_attachment_model_json['status'] = 'attached'
- volume_attachment_model_json['type'] = 'boot'
- volume_attachment_model_json['volume'] = volume_reference_model
+ # Construct a json representation of a BareMetalServerBootTargetBareMetalServerDiskReference model
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json = {}
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['deleted'] = bare_metal_server_disk_reference_deleted_model
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/disks/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['name'] = 'my-bare-metal-disk'
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json['resource_type'] = 'bare_metal_server_disk'
- # Construct a model instance of VolumeAttachment by calling from_dict on the json representation
- volume_attachment_model = VolumeAttachment.from_dict(volume_attachment_model_json)
- assert volume_attachment_model != False
+ # Construct a model instance of BareMetalServerBootTargetBareMetalServerDiskReference by calling from_dict on the json representation
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model = BareMetalServerBootTargetBareMetalServerDiskReference.from_dict(bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json)
+ assert bare_metal_server_boot_target_bare_metal_server_disk_reference_model != False
- # Construct a model instance of VolumeAttachment by calling from_dict on the json representation
- volume_attachment_model_dict = VolumeAttachment.from_dict(volume_attachment_model_json).__dict__
- volume_attachment_model2 = VolumeAttachment(**volume_attachment_model_dict)
+ # Construct a model instance of BareMetalServerBootTargetBareMetalServerDiskReference by calling from_dict on the json representation
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_dict = BareMetalServerBootTargetBareMetalServerDiskReference.from_dict(bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json).__dict__
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model2 = BareMetalServerBootTargetBareMetalServerDiskReference(**bare_metal_server_boot_target_bare_metal_server_disk_reference_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_model == volume_attachment_model2
+ assert bare_metal_server_boot_target_bare_metal_server_disk_reference_model == bare_metal_server_boot_target_bare_metal_server_disk_reference_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_model_json2 = volume_attachment_model.to_dict()
- assert volume_attachment_model_json2 == volume_attachment_model_json
+ bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json2 = bare_metal_server_boot_target_bare_metal_server_disk_reference_model.to_dict()
+ assert bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json2 == bare_metal_server_boot_target_bare_metal_server_disk_reference_model_json
-class TestModel_VolumeAttachmentCollection():
+class TestModel_BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount():
"""
- Test Class for VolumeAttachmentCollection
+ Test Class for BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount
"""
- def test_volume_attachment_collection_serialization(self):
+ def test_bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentCollection
+ Test serialization/deserialization for BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount
"""
# Construct dict forms of any model objects needed in order to build this model.
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
-
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- volume_reference_model = {} # VolumeReference
- volume_reference_model['crn'] = 'crn:[...]'
- volume_reference_model['deleted'] = volume_reference_deleted_model
- volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6'
- volume_reference_model['id'] = 'ac0b16a5-ccc2-47dd-90e2-b9e5f367b6c6'
- volume_reference_model['name'] = 'my-boot-volume'
+ key_reference_deleted_model = {} # KeyReferenceDeleted
+ key_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- volume_attachment_model = {} # VolumeAttachment
- volume_attachment_model['bandwidth'] = 250
- volume_attachment_model['created_at'] = "2019-02-28T16:32:05Z"
- volume_attachment_model['delete_volume_on_instance_delete'] = False
- volume_attachment_model['device'] = volume_attachment_device_model
- volume_attachment_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/8f06378c-ed0e-481e-b98c-9a6dfbee1ed5/volume_attachments/fdb3642d-c849-4c29-97a9-03b868616f88'
- volume_attachment_model['id'] = 'fdb3642d-c849-4c29-97a9-03b868616f88'
- volume_attachment_model['name'] = 'my-boot-volume-attachment'
- volume_attachment_model['status'] = 'attached'
- volume_attachment_model['type'] = 'boot'
- volume_attachment_model['volume'] = volume_reference_model
+ key_reference_model = {} # KeyReference
+ key_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::key:a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_reference_model['deleted'] = key_reference_deleted_model
+ key_reference_model['fingerprint'] = 'SHA256:yxavE4CIOL2NlsqcurRO3xGjkP6m/0mp8ugojH5yxlY'
+ key_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/keys/a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_reference_model['id'] = 'a6b1a881-2ce8-41a3-80fc-36316a73f803'
+ key_reference_model['name'] = 'my-key'
- # Construct a json representation of a VolumeAttachmentCollection model
- volume_attachment_collection_model_json = {}
- volume_attachment_collection_model_json['volume_attachments'] = [volume_attachment_model]
+ # Construct a json representation of a BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount model
+ bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json = {}
+ bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json['encrypted_password'] = 'VGhpcyBpcyBhIG1vY2sgYnl0ZSBhcnJheSB2YWx1ZS4='
+ bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json['encryption_key'] = key_reference_model
+ bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json['resource_type'] = 'host_user_account'
+ bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json['username'] = 'Administrator'
- # Construct a model instance of VolumeAttachmentCollection by calling from_dict on the json representation
- volume_attachment_collection_model = VolumeAttachmentCollection.from_dict(volume_attachment_collection_model_json)
- assert volume_attachment_collection_model != False
+ # Construct a model instance of BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount by calling from_dict on the json representation
+ bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model = BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.from_dict(bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json)
+ assert bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model != False
- # Construct a model instance of VolumeAttachmentCollection by calling from_dict on the json representation
- volume_attachment_collection_model_dict = VolumeAttachmentCollection.from_dict(volume_attachment_collection_model_json).__dict__
- volume_attachment_collection_model2 = VolumeAttachmentCollection(**volume_attachment_collection_model_dict)
+ # Construct a model instance of BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount by calling from_dict on the json representation
+ bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_dict = BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount.from_dict(bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json).__dict__
+ bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model2 = BareMetalServerInitializationUserAccountBareMetalServerInitializationHostUserAccount(**bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_collection_model == volume_attachment_collection_model2
+ assert bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model == bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_collection_model_json2 = volume_attachment_collection_model.to_dict()
- assert volume_attachment_collection_model_json2 == volume_attachment_collection_model_json
+ bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json2 = bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model.to_dict()
+ assert bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json2 == bare_metal_server_initialization_user_account_bare_metal_server_initialization_host_user_account_model_json
-class TestModel_VolumeAttachmentDevice():
+class TestModel_BareMetalServerNetworkInterfaceByPCI():
"""
- Test Class for VolumeAttachmentDevice
+ Test Class for BareMetalServerNetworkInterfaceByPCI
"""
- def test_volume_attachment_device_serialization(self):
+ def test_bare_metal_server_network_interface_by_pci_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentDevice
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceByPCI
"""
- # Construct a json representation of a VolumeAttachmentDevice model
- volume_attachment_device_model_json = {}
- volume_attachment_device_model_json['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ # Construct dict forms of any model objects needed in order to build this model.
- # Construct a model instance of VolumeAttachmentDevice by calling from_dict on the json representation
- volume_attachment_device_model = VolumeAttachmentDevice.from_dict(volume_attachment_device_model_json)
- assert volume_attachment_device_model != False
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of VolumeAttachmentDevice by calling from_dict on the json representation
- volume_attachment_device_model_dict = VolumeAttachmentDevice.from_dict(volume_attachment_device_model_json).__dict__
- volume_attachment_device_model2 = VolumeAttachmentDevice(**volume_attachment_device_model_dict)
+ floating_ip_reference_model = {} # FloatingIPReference
+ floating_ip_reference_model['address'] = '203.0.113.1'
+ floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
+ floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['name'] = 'my-floating-ip'
- # Verify the model instances are equivalent
- assert volume_attachment_device_model == volume_attachment_device_model2
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Convert model instance back to dict and verify no loss of data
- volume_attachment_device_model_json2 = volume_attachment_device_model.to_dict()
- assert volume_attachment_device_model_json2 == volume_attachment_device_model_json
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
-class TestModel_VolumeAttachmentPatch():
- """
- Test Class for VolumeAttachmentPatch
- """
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- def test_volume_attachment_patch_serialization(self):
- """
- Test serialization/deserialization for VolumeAttachmentPatch
- """
+ 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'
- # Construct a json representation of a VolumeAttachmentPatch model
- volume_attachment_patch_model_json = {}
- volume_attachment_patch_model_json['delete_volume_on_instance_delete'] = True
- volume_attachment_patch_model_json['name'] = 'my-volume-attachment'
+ # Construct a json representation of a BareMetalServerNetworkInterfaceByPCI model
+ bare_metal_server_network_interface_by_pci_model_json = {}
+ bare_metal_server_network_interface_by_pci_model_json['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_by_pci_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ bare_metal_server_network_interface_by_pci_model_json['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_by_pci_model_json['floating_ips'] = [floating_ip_reference_model]
+ bare_metal_server_network_interface_by_pci_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_by_pci_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_by_pci_model_json['interface_type'] = 'pci'
+ bare_metal_server_network_interface_by_pci_model_json['mac_address'] = '02:00:0a:00:23:94'
+ bare_metal_server_network_interface_by_pci_model_json['name'] = 'my-network-interface'
+ bare_metal_server_network_interface_by_pci_model_json['port_speed'] = 1000
+ bare_metal_server_network_interface_by_pci_model_json['primary_ipv4_address'] = '192.168.3.4'
+ bare_metal_server_network_interface_by_pci_model_json['resource_type'] = 'network_interface'
+ bare_metal_server_network_interface_by_pci_model_json['security_groups'] = [security_group_reference_model]
+ bare_metal_server_network_interface_by_pci_model_json['status'] = 'available'
+ bare_metal_server_network_interface_by_pci_model_json['subnet'] = subnet_reference_model
+ bare_metal_server_network_interface_by_pci_model_json['type'] = 'primary'
+ bare_metal_server_network_interface_by_pci_model_json['allowed_vlans'] = [4]
- # Construct a model instance of VolumeAttachmentPatch by calling from_dict on the json representation
- volume_attachment_patch_model = VolumeAttachmentPatch.from_dict(volume_attachment_patch_model_json)
- assert volume_attachment_patch_model != False
+ # Construct a model instance of BareMetalServerNetworkInterfaceByPCI by calling from_dict on the json representation
+ bare_metal_server_network_interface_by_pci_model = BareMetalServerNetworkInterfaceByPCI.from_dict(bare_metal_server_network_interface_by_pci_model_json)
+ assert bare_metal_server_network_interface_by_pci_model != False
- # Construct a model instance of VolumeAttachmentPatch by calling from_dict on the json representation
- volume_attachment_patch_model_dict = VolumeAttachmentPatch.from_dict(volume_attachment_patch_model_json).__dict__
- volume_attachment_patch_model2 = VolumeAttachmentPatch(**volume_attachment_patch_model_dict)
+ # Construct a model instance of BareMetalServerNetworkInterfaceByPCI by calling from_dict on the json representation
+ bare_metal_server_network_interface_by_pci_model_dict = BareMetalServerNetworkInterfaceByPCI.from_dict(bare_metal_server_network_interface_by_pci_model_json).__dict__
+ bare_metal_server_network_interface_by_pci_model2 = BareMetalServerNetworkInterfaceByPCI(**bare_metal_server_network_interface_by_pci_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_patch_model == volume_attachment_patch_model2
+ assert bare_metal_server_network_interface_by_pci_model == bare_metal_server_network_interface_by_pci_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_patch_model_json2 = volume_attachment_patch_model.to_dict()
- assert volume_attachment_patch_model_json2 == volume_attachment_patch_model_json
+ bare_metal_server_network_interface_by_pci_model_json2 = bare_metal_server_network_interface_by_pci_model.to_dict()
+ assert bare_metal_server_network_interface_by_pci_model_json2 == bare_metal_server_network_interface_by_pci_model_json
-class TestModel_VolumeAttachmentPrototypeInstanceByImageContext():
+class TestModel_BareMetalServerNetworkInterfaceByVLAN():
"""
- Test Class for VolumeAttachmentPrototypeInstanceByImageContext
+ Test Class for BareMetalServerNetworkInterfaceByVLAN
"""
- def test_volume_attachment_prototype_instance_by_image_context_serialization(self):
+ def test_bare_metal_server_network_interface_by_vlan_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByImageContext
+ Test serialization/deserialization for BareMetalServerNetworkInterfaceByVLAN
"""
# Construct dict forms of any model objects needed in order to build this model.
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
+ floating_ip_reference_deleted_model = {} # FloatingIPReferenceDeleted
+ floating_ip_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
+ floating_ip_reference_model = {} # FloatingIPReference
+ floating_ip_reference_model['address'] = '203.0.113.1'
+ floating_ip_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::floating-ip:39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['deleted'] = floating_ip_reference_deleted_model
+ floating_ip_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/floating_ips/39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['id'] = '39300233-9995-4806-89a5-3c1b6eb88689'
+ floating_ip_reference_model['name'] = 'my-floating-ip'
- volume_prototype_instance_by_image_context_model = {} # VolumePrototypeInstanceByImageContext
- volume_prototype_instance_by_image_context_model['capacity'] = 38
- volume_prototype_instance_by_image_context_model['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model['iops'] = 10000
- volume_prototype_instance_by_image_context_model['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model['profile'] = volume_profile_identity_model
+ security_group_reference_deleted_model = {} # SecurityGroupReferenceDeleted
+ security_group_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a json representation of a VolumeAttachmentPrototypeInstanceByImageContext model
- volume_attachment_prototype_instance_by_image_context_model_json = {}
- volume_attachment_prototype_instance_by_image_context_model_json['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_by_image_context_model_json['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_image_context_model_json['volume'] = volume_prototype_instance_by_image_context_model
+ security_group_reference_model = {} # SecurityGroupReference
+ security_group_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::security-group:be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['deleted'] = security_group_reference_deleted_model
+ security_group_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/security_groups/be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
+ security_group_reference_model['name'] = 'my-security-group'
- # Construct a model instance of VolumeAttachmentPrototypeInstanceByImageContext by calling from_dict on the json representation
- volume_attachment_prototype_instance_by_image_context_model = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(volume_attachment_prototype_instance_by_image_context_model_json)
- assert volume_attachment_prototype_instance_by_image_context_model != False
+ subnet_reference_deleted_model = {} # SubnetReferenceDeleted
+ subnet_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
- # Construct a model instance of VolumeAttachmentPrototypeInstanceByImageContext by calling from_dict on the json representation
- volume_attachment_prototype_instance_by_image_context_model_dict = VolumeAttachmentPrototypeInstanceByImageContext.from_dict(volume_attachment_prototype_instance_by_image_context_model_json).__dict__
- volume_attachment_prototype_instance_by_image_context_model2 = VolumeAttachmentPrototypeInstanceByImageContext(**volume_attachment_prototype_instance_by_image_context_model_dict)
+ 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'
+
+ # Construct a json representation of a BareMetalServerNetworkInterfaceByVLAN model
+ bare_metal_server_network_interface_by_vlan_model_json = {}
+ bare_metal_server_network_interface_by_vlan_model_json['allow_ip_spoofing'] = True
+ bare_metal_server_network_interface_by_vlan_model_json['created_at'] = "2019-01-01T12:00:00Z"
+ bare_metal_server_network_interface_by_vlan_model_json['enable_infrastructure_nat'] = True
+ bare_metal_server_network_interface_by_vlan_model_json['floating_ips'] = [floating_ip_reference_model]
+ bare_metal_server_network_interface_by_vlan_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_by_vlan_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+ bare_metal_server_network_interface_by_vlan_model_json['interface_type'] = 'vlan'
+ bare_metal_server_network_interface_by_vlan_model_json['mac_address'] = '02:00:0a:00:23:94'
+ bare_metal_server_network_interface_by_vlan_model_json['name'] = 'my-network-interface'
+ bare_metal_server_network_interface_by_vlan_model_json['port_speed'] = 1000
+ bare_metal_server_network_interface_by_vlan_model_json['primary_ipv4_address'] = '192.168.3.4'
+ bare_metal_server_network_interface_by_vlan_model_json['resource_type'] = 'network_interface'
+ bare_metal_server_network_interface_by_vlan_model_json['security_groups'] = [security_group_reference_model]
+ bare_metal_server_network_interface_by_vlan_model_json['status'] = 'available'
+ bare_metal_server_network_interface_by_vlan_model_json['subnet'] = subnet_reference_model
+ bare_metal_server_network_interface_by_vlan_model_json['type'] = 'primary'
+ bare_metal_server_network_interface_by_vlan_model_json['allow_interface_to_float'] = False
+ bare_metal_server_network_interface_by_vlan_model_json['vlan'] = 4
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceByVLAN by calling from_dict on the json representation
+ bare_metal_server_network_interface_by_vlan_model = BareMetalServerNetworkInterfaceByVLAN.from_dict(bare_metal_server_network_interface_by_vlan_model_json)
+ assert bare_metal_server_network_interface_by_vlan_model != False
+
+ # Construct a model instance of BareMetalServerNetworkInterfaceByVLAN by calling from_dict on the json representation
+ bare_metal_server_network_interface_by_vlan_model_dict = BareMetalServerNetworkInterfaceByVLAN.from_dict(bare_metal_server_network_interface_by_vlan_model_json).__dict__
+ bare_metal_server_network_interface_by_vlan_model2 = BareMetalServerNetworkInterfaceByVLAN(**bare_metal_server_network_interface_by_vlan_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_prototype_instance_by_image_context_model == volume_attachment_prototype_instance_by_image_context_model2
+ assert bare_metal_server_network_interface_by_vlan_model == bare_metal_server_network_interface_by_vlan_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_prototype_instance_by_image_context_model_json2 = volume_attachment_prototype_instance_by_image_context_model.to_dict()
- assert volume_attachment_prototype_instance_by_image_context_model_json2 == volume_attachment_prototype_instance_by_image_context_model_json
+ bare_metal_server_network_interface_by_vlan_model_json2 = bare_metal_server_network_interface_by_vlan_model.to_dict()
+ assert bare_metal_server_network_interface_by_vlan_model_json2 == bare_metal_server_network_interface_by_vlan_model_json
-class TestModel_VolumeAttachmentPrototypeInstanceByVolumeContext():
+class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype():
"""
- Test Class for VolumeAttachmentPrototypeInstanceByVolumeContext
+ Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype
"""
- def test_volume_attachment_prototype_instance_by_volume_context_serialization(self):
+ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentPrototypeInstanceByVolumeContext
+ Test serialization/deserialization for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
-
- snapshot_identity_model = {} # SnapshotIdentityById
- snapshot_identity_model['id'] = '349a61d8-7ab1-420f-a690-5fed76ef9d4f'
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- volume_attachment_volume_prototype_instance_by_volume_context_model = {} # VolumeAttachmentVolumePrototypeInstanceByVolumeContextVolumePrototypeInstanceByVolumeContext
- volume_attachment_volume_prototype_instance_by_volume_context_model['capacity'] = 38
- volume_attachment_volume_prototype_instance_by_volume_context_model['encryption_key'] = encryption_key_identity_model
- volume_attachment_volume_prototype_instance_by_volume_context_model['iops'] = 10000
- volume_attachment_volume_prototype_instance_by_volume_context_model['name'] = 'my-volume'
- volume_attachment_volume_prototype_instance_by_volume_context_model['profile'] = volume_profile_identity_model
- volume_attachment_volume_prototype_instance_by_volume_context_model['source_snapshot'] = snapshot_identity_model
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a json representation of a VolumeAttachmentPrototypeInstanceByVolumeContext model
- volume_attachment_prototype_instance_by_volume_context_model_json = {}
- volume_attachment_prototype_instance_by_volume_context_model_json['delete_volume_on_instance_delete'] = False
- volume_attachment_prototype_instance_by_volume_context_model_json['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_by_volume_context_model_json['volume'] = volume_attachment_volume_prototype_instance_by_volume_context_model
+ # Construct a json representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype model
+ 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['interface_type'] = 'pci'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['name'] = 'my-network-interface'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['primary_ipv4_address'] = '10.0.0.5'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json['allowed_vlans'] = [4]
- # Construct a model instance of VolumeAttachmentPrototypeInstanceByVolumeContext by calling from_dict on the json representation
- volume_attachment_prototype_instance_by_volume_context_model = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(volume_attachment_prototype_instance_by_volume_context_model_json)
- assert volume_attachment_prototype_instance_by_volume_context_model != False
+ # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype by calling from_dict on the json representation
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json)
+ assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model != False
- # Construct a model instance of VolumeAttachmentPrototypeInstanceByVolumeContext by calling from_dict on the json representation
- volume_attachment_prototype_instance_by_volume_context_model_dict = VolumeAttachmentPrototypeInstanceByVolumeContext.from_dict(volume_attachment_prototype_instance_by_volume_context_model_json).__dict__
- volume_attachment_prototype_instance_by_volume_context_model2 = VolumeAttachmentPrototypeInstanceByVolumeContext(**volume_attachment_prototype_instance_by_volume_context_model_dict)
+ # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype by calling from_dict on the json representation
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_dict = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json).__dict__
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model2 = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByPCIPrototype(**bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_prototype_instance_by_volume_context_model == volume_attachment_prototype_instance_by_volume_context_model2
+ assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_prototype_instance_by_volume_context_model_json2 = volume_attachment_prototype_instance_by_volume_context_model.to_dict()
- assert volume_attachment_prototype_instance_by_volume_context_model_json2 == volume_attachment_prototype_instance_by_volume_context_model_json
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json2 = bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model.to_dict()
+ assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json2 == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_pci_prototype_model_json
-class TestModel_VolumeAttachmentPrototypeInstanceContext():
+class TestModel_BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype():
"""
- Test Class for VolumeAttachmentPrototypeInstanceContext
+ Test Class for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype
"""
- def test_volume_attachment_prototype_instance_context_serialization(self):
+ def test_bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentPrototypeInstanceContext
+ Test serialization/deserialization for BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype
"""
# Construct dict forms of any model objects needed in order to build this model.
- volume_attachment_volume_prototype_instance_context_model = {} # VolumeAttachmentVolumePrototypeInstanceContextVolumeIdentityVolumeIdentityById
- volume_attachment_volume_prototype_instance_context_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
+ security_group_identity_model = {} # SecurityGroupIdentityById
+ security_group_identity_model['id'] = 'be5df5ca-12a0-494b-907e-aa6ec2bfa271'
- # Construct a json representation of a VolumeAttachmentPrototypeInstanceContext model
- volume_attachment_prototype_instance_context_model_json = {}
- volume_attachment_prototype_instance_context_model_json['delete_volume_on_instance_delete'] = True
- volume_attachment_prototype_instance_context_model_json['name'] = 'my-volume-attachment'
- volume_attachment_prototype_instance_context_model_json['volume'] = volume_attachment_volume_prototype_instance_context_model
+ subnet_identity_model = {} # SubnetIdentityById
+ subnet_identity_model['id'] = '7ec86020-1c6e-4889-b3f0-a15f2e50f87e'
- # Construct a model instance of VolumeAttachmentPrototypeInstanceContext by calling from_dict on the json representation
- volume_attachment_prototype_instance_context_model = VolumeAttachmentPrototypeInstanceContext.from_dict(volume_attachment_prototype_instance_context_model_json)
- assert volume_attachment_prototype_instance_context_model != False
+ # Construct a json representation of a BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype model
+ 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['interface_type'] = 'vlan'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['name'] = 'my-network-interface'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['primary_ipv4_address'] = '10.0.0.5'
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['security_groups'] = [security_group_identity_model]
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['subnet'] = subnet_identity_model
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['allow_interface_to_float'] = False
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json['vlan'] = 4
- # Construct a model instance of VolumeAttachmentPrototypeInstanceContext by calling from_dict on the json representation
- volume_attachment_prototype_instance_context_model_dict = VolumeAttachmentPrototypeInstanceContext.from_dict(volume_attachment_prototype_instance_context_model_json).__dict__
- volume_attachment_prototype_instance_context_model2 = VolumeAttachmentPrototypeInstanceContext(**volume_attachment_prototype_instance_context_model_dict)
+ # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype by calling from_dict on the json representation
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json)
+ assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model != False
+
+ # Construct a model instance of BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype by calling from_dict on the json representation
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_dict = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype.from_dict(bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json).__dict__
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model2 = BareMetalServerNetworkInterfacePrototypeBareMetalServerNetworkInterfaceByVLANPrototype(**bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_prototype_instance_context_model == volume_attachment_prototype_instance_context_model2
+ assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_prototype_instance_context_model_json2 = volume_attachment_prototype_instance_context_model.to_dict()
- assert volume_attachment_prototype_instance_context_model_json2 == volume_attachment_prototype_instance_context_model_json
+ bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json2 = bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model.to_dict()
+ assert bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json2 == bare_metal_server_network_interface_prototype_bare_metal_server_network_interface_by_vlan_prototype_model_json
-class TestModel_VolumeAttachmentReferenceInstanceContext():
+class TestModel_BareMetalServerProfileBandwidthDependent():
"""
- Test Class for VolumeAttachmentReferenceInstanceContext
+ Test Class for BareMetalServerProfileBandwidthDependent
"""
- def test_volume_attachment_reference_instance_context_serialization(self):
+ def test_bare_metal_server_profile_bandwidth_dependent_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentReferenceInstanceContext
+ Test serialization/deserialization for BareMetalServerProfileBandwidthDependent
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a BareMetalServerProfileBandwidthDependent model
+ bare_metal_server_profile_bandwidth_dependent_model_json = {}
+ bare_metal_server_profile_bandwidth_dependent_model_json['type'] = 'dependent'
- volume_attachment_reference_instance_context_deleted_model = {} # VolumeAttachmentReferenceInstanceContextDeleted
- volume_attachment_reference_instance_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of BareMetalServerProfileBandwidthDependent by calling from_dict on the json representation
+ bare_metal_server_profile_bandwidth_dependent_model = BareMetalServerProfileBandwidthDependent.from_dict(bare_metal_server_profile_bandwidth_dependent_model_json)
+ assert bare_metal_server_profile_bandwidth_dependent_model != False
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ # Construct a model instance of BareMetalServerProfileBandwidthDependent by calling from_dict on the json representation
+ bare_metal_server_profile_bandwidth_dependent_model_dict = BareMetalServerProfileBandwidthDependent.from_dict(bare_metal_server_profile_bandwidth_dependent_model_json).__dict__
+ bare_metal_server_profile_bandwidth_dependent_model2 = BareMetalServerProfileBandwidthDependent(**bare_metal_server_profile_bandwidth_dependent_model_dict)
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_bandwidth_dependent_model == bare_metal_server_profile_bandwidth_dependent_model2
- volume_reference_model = {} # VolumeReference
- volume_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['deleted'] = volume_reference_deleted_model
- volume_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model['name'] = 'my-volume'
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_bandwidth_dependent_model_json2 = bare_metal_server_profile_bandwidth_dependent_model.to_dict()
+ assert bare_metal_server_profile_bandwidth_dependent_model_json2 == bare_metal_server_profile_bandwidth_dependent_model_json
- # Construct a json representation of a VolumeAttachmentReferenceInstanceContext model
- volume_attachment_reference_instance_context_model_json = {}
- volume_attachment_reference_instance_context_model_json['deleted'] = volume_attachment_reference_instance_context_deleted_model
- volume_attachment_reference_instance_context_model_json['device'] = volume_attachment_device_model
- volume_attachment_reference_instance_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_instance_context_model_json['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_instance_context_model_json['name'] = 'my-volume-attachment'
- volume_attachment_reference_instance_context_model_json['volume'] = volume_reference_model
+class TestModel_BareMetalServerProfileBandwidthEnum():
+ """
+ Test Class for BareMetalServerProfileBandwidthEnum
+ """
- # Construct a model instance of VolumeAttachmentReferenceInstanceContext by calling from_dict on the json representation
- volume_attachment_reference_instance_context_model = VolumeAttachmentReferenceInstanceContext.from_dict(volume_attachment_reference_instance_context_model_json)
- assert volume_attachment_reference_instance_context_model != False
+ def test_bare_metal_server_profile_bandwidth_enum_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileBandwidthEnum
+ """
- # Construct a model instance of VolumeAttachmentReferenceInstanceContext by calling from_dict on the json representation
- volume_attachment_reference_instance_context_model_dict = VolumeAttachmentReferenceInstanceContext.from_dict(volume_attachment_reference_instance_context_model_json).__dict__
- volume_attachment_reference_instance_context_model2 = VolumeAttachmentReferenceInstanceContext(**volume_attachment_reference_instance_context_model_dict)
+ # Construct a json representation of a BareMetalServerProfileBandwidthEnum model
+ bare_metal_server_profile_bandwidth_enum_model_json = {}
+ bare_metal_server_profile_bandwidth_enum_model_json['default'] = 38
+ bare_metal_server_profile_bandwidth_enum_model_json['type'] = 'enum'
+ bare_metal_server_profile_bandwidth_enum_model_json['values'] = [16000, 32000, 48000]
+
+ # Construct a model instance of BareMetalServerProfileBandwidthEnum by calling from_dict on the json representation
+ bare_metal_server_profile_bandwidth_enum_model = BareMetalServerProfileBandwidthEnum.from_dict(bare_metal_server_profile_bandwidth_enum_model_json)
+ assert bare_metal_server_profile_bandwidth_enum_model != False
+
+ # Construct a model instance of BareMetalServerProfileBandwidthEnum by calling from_dict on the json representation
+ bare_metal_server_profile_bandwidth_enum_model_dict = BareMetalServerProfileBandwidthEnum.from_dict(bare_metal_server_profile_bandwidth_enum_model_json).__dict__
+ bare_metal_server_profile_bandwidth_enum_model2 = BareMetalServerProfileBandwidthEnum(**bare_metal_server_profile_bandwidth_enum_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_reference_instance_context_model == volume_attachment_reference_instance_context_model2
+ assert bare_metal_server_profile_bandwidth_enum_model == bare_metal_server_profile_bandwidth_enum_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_reference_instance_context_model_json2 = volume_attachment_reference_instance_context_model.to_dict()
- assert volume_attachment_reference_instance_context_model_json2 == volume_attachment_reference_instance_context_model_json
+ bare_metal_server_profile_bandwidth_enum_model_json2 = bare_metal_server_profile_bandwidth_enum_model.to_dict()
+ assert bare_metal_server_profile_bandwidth_enum_model_json2 == bare_metal_server_profile_bandwidth_enum_model_json
-class TestModel_VolumeAttachmentReferenceInstanceContextDeleted():
+class TestModel_BareMetalServerProfileBandwidthFixed():
"""
- Test Class for VolumeAttachmentReferenceInstanceContextDeleted
+ Test Class for BareMetalServerProfileBandwidthFixed
"""
- def test_volume_attachment_reference_instance_context_deleted_serialization(self):
+ def test_bare_metal_server_profile_bandwidth_fixed_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentReferenceInstanceContextDeleted
+ Test serialization/deserialization for BareMetalServerProfileBandwidthFixed
"""
- # Construct a json representation of a VolumeAttachmentReferenceInstanceContextDeleted model
- volume_attachment_reference_instance_context_deleted_model_json = {}
- volume_attachment_reference_instance_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a BareMetalServerProfileBandwidthFixed model
+ bare_metal_server_profile_bandwidth_fixed_model_json = {}
+ bare_metal_server_profile_bandwidth_fixed_model_json['type'] = 'fixed'
+ bare_metal_server_profile_bandwidth_fixed_model_json['value'] = 20000
- # Construct a model instance of VolumeAttachmentReferenceInstanceContextDeleted by calling from_dict on the json representation
- volume_attachment_reference_instance_context_deleted_model = VolumeAttachmentReferenceInstanceContextDeleted.from_dict(volume_attachment_reference_instance_context_deleted_model_json)
- assert volume_attachment_reference_instance_context_deleted_model != False
+ # Construct a model instance of BareMetalServerProfileBandwidthFixed by calling from_dict on the json representation
+ bare_metal_server_profile_bandwidth_fixed_model = BareMetalServerProfileBandwidthFixed.from_dict(bare_metal_server_profile_bandwidth_fixed_model_json)
+ assert bare_metal_server_profile_bandwidth_fixed_model != False
- # Construct a model instance of VolumeAttachmentReferenceInstanceContextDeleted by calling from_dict on the json representation
- volume_attachment_reference_instance_context_deleted_model_dict = VolumeAttachmentReferenceInstanceContextDeleted.from_dict(volume_attachment_reference_instance_context_deleted_model_json).__dict__
- volume_attachment_reference_instance_context_deleted_model2 = VolumeAttachmentReferenceInstanceContextDeleted(**volume_attachment_reference_instance_context_deleted_model_dict)
+ # Construct a model instance of BareMetalServerProfileBandwidthFixed by calling from_dict on the json representation
+ bare_metal_server_profile_bandwidth_fixed_model_dict = BareMetalServerProfileBandwidthFixed.from_dict(bare_metal_server_profile_bandwidth_fixed_model_json).__dict__
+ bare_metal_server_profile_bandwidth_fixed_model2 = BareMetalServerProfileBandwidthFixed(**bare_metal_server_profile_bandwidth_fixed_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_reference_instance_context_deleted_model == volume_attachment_reference_instance_context_deleted_model2
+ assert bare_metal_server_profile_bandwidth_fixed_model == bare_metal_server_profile_bandwidth_fixed_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_reference_instance_context_deleted_model_json2 = volume_attachment_reference_instance_context_deleted_model.to_dict()
- assert volume_attachment_reference_instance_context_deleted_model_json2 == volume_attachment_reference_instance_context_deleted_model_json
+ bare_metal_server_profile_bandwidth_fixed_model_json2 = bare_metal_server_profile_bandwidth_fixed_model.to_dict()
+ assert bare_metal_server_profile_bandwidth_fixed_model_json2 == bare_metal_server_profile_bandwidth_fixed_model_json
-class TestModel_VolumeAttachmentReferenceVolumeContext():
+class TestModel_BareMetalServerProfileBandwidthRange():
"""
- Test Class for VolumeAttachmentReferenceVolumeContext
+ Test Class for BareMetalServerProfileBandwidthRange
"""
- def test_volume_attachment_reference_volume_context_serialization(self):
+ def test_bare_metal_server_profile_bandwidth_range_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentReferenceVolumeContext
+ Test serialization/deserialization for BareMetalServerProfileBandwidthRange
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a BareMetalServerProfileBandwidthRange model
+ bare_metal_server_profile_bandwidth_range_model_json = {}
+ bare_metal_server_profile_bandwidth_range_model_json['default'] = 20000
+ bare_metal_server_profile_bandwidth_range_model_json['max'] = 100000
+ bare_metal_server_profile_bandwidth_range_model_json['min'] = 10000
+ bare_metal_server_profile_bandwidth_range_model_json['step'] = 10000
+ bare_metal_server_profile_bandwidth_range_model_json['type'] = 'range'
- volume_attachment_reference_volume_context_deleted_model = {} # VolumeAttachmentReferenceVolumeContextDeleted
- volume_attachment_reference_volume_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of BareMetalServerProfileBandwidthRange by calling from_dict on the json representation
+ bare_metal_server_profile_bandwidth_range_model = BareMetalServerProfileBandwidthRange.from_dict(bare_metal_server_profile_bandwidth_range_model_json)
+ assert bare_metal_server_profile_bandwidth_range_model != False
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ # Construct a model instance of BareMetalServerProfileBandwidthRange by calling from_dict on the json representation
+ bare_metal_server_profile_bandwidth_range_model_dict = BareMetalServerProfileBandwidthRange.from_dict(bare_metal_server_profile_bandwidth_range_model_json).__dict__
+ bare_metal_server_profile_bandwidth_range_model2 = BareMetalServerProfileBandwidthRange(**bare_metal_server_profile_bandwidth_range_model_dict)
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_bandwidth_range_model == bare_metal_server_profile_bandwidth_range_model2
- instance_reference_model = {} # InstanceReference
- instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['deleted'] = instance_reference_deleted_model
- instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['name'] = 'my-instance'
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_bandwidth_range_model_json2 = bare_metal_server_profile_bandwidth_range_model.to_dict()
+ assert bare_metal_server_profile_bandwidth_range_model_json2 == bare_metal_server_profile_bandwidth_range_model_json
- # Construct a json representation of a VolumeAttachmentReferenceVolumeContext model
- volume_attachment_reference_volume_context_model_json = {}
- volume_attachment_reference_volume_context_model_json['delete_volume_on_instance_delete'] = True
- volume_attachment_reference_volume_context_model_json['deleted'] = volume_attachment_reference_volume_context_deleted_model
- volume_attachment_reference_volume_context_model_json['device'] = volume_attachment_device_model
- volume_attachment_reference_volume_context_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_volume_context_model_json['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_volume_context_model_json['instance'] = instance_reference_model
- volume_attachment_reference_volume_context_model_json['name'] = 'my-volume-attachment'
- volume_attachment_reference_volume_context_model_json['type'] = 'boot'
+class TestModel_BareMetalServerProfileCPUCoreCountDependent():
+ """
+ Test Class for BareMetalServerProfileCPUCoreCountDependent
+ """
- # Construct a model instance of VolumeAttachmentReferenceVolumeContext by calling from_dict on the json representation
- volume_attachment_reference_volume_context_model = VolumeAttachmentReferenceVolumeContext.from_dict(volume_attachment_reference_volume_context_model_json)
- assert volume_attachment_reference_volume_context_model != False
+ def test_bare_metal_server_profile_cpu_core_count_dependent_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCPUCoreCountDependent
+ """
- # Construct a model instance of VolumeAttachmentReferenceVolumeContext by calling from_dict on the json representation
- volume_attachment_reference_volume_context_model_dict = VolumeAttachmentReferenceVolumeContext.from_dict(volume_attachment_reference_volume_context_model_json).__dict__
- volume_attachment_reference_volume_context_model2 = VolumeAttachmentReferenceVolumeContext(**volume_attachment_reference_volume_context_model_dict)
+ # Construct a json representation of a BareMetalServerProfileCPUCoreCountDependent model
+ bare_metal_server_profile_cpu_core_count_dependent_model_json = {}
+ bare_metal_server_profile_cpu_core_count_dependent_model_json['type'] = 'dependent'
+
+ # Construct a model instance of BareMetalServerProfileCPUCoreCountDependent by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_core_count_dependent_model = BareMetalServerProfileCPUCoreCountDependent.from_dict(bare_metal_server_profile_cpu_core_count_dependent_model_json)
+ assert bare_metal_server_profile_cpu_core_count_dependent_model != False
+
+ # Construct a model instance of BareMetalServerProfileCPUCoreCountDependent by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_core_count_dependent_model_dict = BareMetalServerProfileCPUCoreCountDependent.from_dict(bare_metal_server_profile_cpu_core_count_dependent_model_json).__dict__
+ bare_metal_server_profile_cpu_core_count_dependent_model2 = BareMetalServerProfileCPUCoreCountDependent(**bare_metal_server_profile_cpu_core_count_dependent_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_reference_volume_context_model == volume_attachment_reference_volume_context_model2
+ assert bare_metal_server_profile_cpu_core_count_dependent_model == bare_metal_server_profile_cpu_core_count_dependent_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_reference_volume_context_model_json2 = volume_attachment_reference_volume_context_model.to_dict()
- assert volume_attachment_reference_volume_context_model_json2 == volume_attachment_reference_volume_context_model_json
+ bare_metal_server_profile_cpu_core_count_dependent_model_json2 = bare_metal_server_profile_cpu_core_count_dependent_model.to_dict()
+ assert bare_metal_server_profile_cpu_core_count_dependent_model_json2 == bare_metal_server_profile_cpu_core_count_dependent_model_json
-class TestModel_VolumeAttachmentReferenceVolumeContextDeleted():
+class TestModel_BareMetalServerProfileCPUCoreCountEnum():
"""
- Test Class for VolumeAttachmentReferenceVolumeContextDeleted
+ Test Class for BareMetalServerProfileCPUCoreCountEnum
"""
- def test_volume_attachment_reference_volume_context_deleted_serialization(self):
+ def test_bare_metal_server_profile_cpu_core_count_enum_serialization(self):
"""
- Test serialization/deserialization for VolumeAttachmentReferenceVolumeContextDeleted
+ Test serialization/deserialization for BareMetalServerProfileCPUCoreCountEnum
"""
- # Construct a json representation of a VolumeAttachmentReferenceVolumeContextDeleted model
- volume_attachment_reference_volume_context_deleted_model_json = {}
- volume_attachment_reference_volume_context_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a BareMetalServerProfileCPUCoreCountEnum model
+ bare_metal_server_profile_cpu_core_count_enum_model_json = {}
+ bare_metal_server_profile_cpu_core_count_enum_model_json['default'] = 38
+ bare_metal_server_profile_cpu_core_count_enum_model_json['type'] = 'enum'
+ bare_metal_server_profile_cpu_core_count_enum_model_json['values'] = [40, 60, 80]
- # Construct a model instance of VolumeAttachmentReferenceVolumeContextDeleted by calling from_dict on the json representation
- volume_attachment_reference_volume_context_deleted_model = VolumeAttachmentReferenceVolumeContextDeleted.from_dict(volume_attachment_reference_volume_context_deleted_model_json)
- assert volume_attachment_reference_volume_context_deleted_model != False
+ # Construct a model instance of BareMetalServerProfileCPUCoreCountEnum by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_core_count_enum_model = BareMetalServerProfileCPUCoreCountEnum.from_dict(bare_metal_server_profile_cpu_core_count_enum_model_json)
+ assert bare_metal_server_profile_cpu_core_count_enum_model != False
- # Construct a model instance of VolumeAttachmentReferenceVolumeContextDeleted by calling from_dict on the json representation
- volume_attachment_reference_volume_context_deleted_model_dict = VolumeAttachmentReferenceVolumeContextDeleted.from_dict(volume_attachment_reference_volume_context_deleted_model_json).__dict__
- volume_attachment_reference_volume_context_deleted_model2 = VolumeAttachmentReferenceVolumeContextDeleted(**volume_attachment_reference_volume_context_deleted_model_dict)
+ # Construct a model instance of BareMetalServerProfileCPUCoreCountEnum by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_core_count_enum_model_dict = BareMetalServerProfileCPUCoreCountEnum.from_dict(bare_metal_server_profile_cpu_core_count_enum_model_json).__dict__
+ bare_metal_server_profile_cpu_core_count_enum_model2 = BareMetalServerProfileCPUCoreCountEnum(**bare_metal_server_profile_cpu_core_count_enum_model_dict)
# Verify the model instances are equivalent
- assert volume_attachment_reference_volume_context_deleted_model == volume_attachment_reference_volume_context_deleted_model2
+ assert bare_metal_server_profile_cpu_core_count_enum_model == bare_metal_server_profile_cpu_core_count_enum_model2
# Convert model instance back to dict and verify no loss of data
- volume_attachment_reference_volume_context_deleted_model_json2 = volume_attachment_reference_volume_context_deleted_model.to_dict()
- assert volume_attachment_reference_volume_context_deleted_model_json2 == volume_attachment_reference_volume_context_deleted_model_json
+ bare_metal_server_profile_cpu_core_count_enum_model_json2 = bare_metal_server_profile_cpu_core_count_enum_model.to_dict()
+ assert bare_metal_server_profile_cpu_core_count_enum_model_json2 == bare_metal_server_profile_cpu_core_count_enum_model_json
-class TestModel_VolumeCollection():
+class TestModel_BareMetalServerProfileCPUCoreCountFixed():
"""
- Test Class for VolumeCollection
+ Test Class for BareMetalServerProfileCPUCoreCountFixed
"""
- def test_volume_collection_serialization(self):
+ def test_bare_metal_server_profile_cpu_core_count_fixed_serialization(self):
"""
- Test serialization/deserialization for VolumeCollection
+ Test serialization/deserialization for BareMetalServerProfileCPUCoreCountFixed
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a BareMetalServerProfileCPUCoreCountFixed model
+ bare_metal_server_profile_cpu_core_count_fixed_model_json = {}
+ bare_metal_server_profile_cpu_core_count_fixed_model_json['type'] = 'fixed'
+ bare_metal_server_profile_cpu_core_count_fixed_model_json['value'] = 80
- volume_collection_first_model = {} # VolumeCollectionFirst
- volume_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20'
+ # Construct a model instance of BareMetalServerProfileCPUCoreCountFixed by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_core_count_fixed_model = BareMetalServerProfileCPUCoreCountFixed.from_dict(bare_metal_server_profile_cpu_core_count_fixed_model_json)
+ assert bare_metal_server_profile_cpu_core_count_fixed_model != False
- volume_collection_next_model = {} # VolumeCollectionNext
- volume_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a model instance of BareMetalServerProfileCPUCoreCountFixed by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_core_count_fixed_model_dict = BareMetalServerProfileCPUCoreCountFixed.from_dict(bare_metal_server_profile_cpu_core_count_fixed_model_json).__dict__
+ bare_metal_server_profile_cpu_core_count_fixed_model2 = BareMetalServerProfileCPUCoreCountFixed(**bare_metal_server_profile_cpu_core_count_fixed_model_dict)
- 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'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_cpu_core_count_fixed_model == bare_metal_server_profile_cpu_core_count_fixed_model2
- operating_system_reference_model = {} # OperatingSystemReference
- operating_system_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/operating_systems/ubuntu-16-amd64'
- operating_system_reference_model['name'] = 'ubuntu-16-amd64'
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_cpu_core_count_fixed_model_json2 = bare_metal_server_profile_cpu_core_count_fixed_model.to_dict()
+ assert bare_metal_server_profile_cpu_core_count_fixed_model_json2 == bare_metal_server_profile_cpu_core_count_fixed_model_json
- volume_profile_reference_model = {} # VolumeProfileReference
- volume_profile_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
- volume_profile_reference_model['name'] = 'general-purpose'
+class TestModel_BareMetalServerProfileCPUCoreCountRange():
+ """
+ Test Class for BareMetalServerProfileCPUCoreCountRange
+ """
- 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'
+ def test_bare_metal_server_profile_cpu_core_count_range_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCPUCoreCountRange
+ """
- image_reference_deleted_model = {} # ImageReferenceDeleted
- image_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a BareMetalServerProfileCPUCoreCountRange model
+ bare_metal_server_profile_cpu_core_count_range_model_json = {}
+ bare_metal_server_profile_cpu_core_count_range_model_json['default'] = 80
+ bare_metal_server_profile_cpu_core_count_range_model_json['max'] = 80
+ bare_metal_server_profile_cpu_core_count_range_model_json['min'] = 40
+ bare_metal_server_profile_cpu_core_count_range_model_json['step'] = 4
+ bare_metal_server_profile_cpu_core_count_range_model_json['type'] = 'range'
- image_reference_model = {} # ImageReference
- image_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::image:72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['deleted'] = image_reference_deleted_model
- image_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/images/72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['id'] = '72b27b5c-f4b0-48bb-b954-5becc7c1dcb8'
- image_reference_model['name'] = 'my-image'
+ # Construct a model instance of BareMetalServerProfileCPUCoreCountRange by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_core_count_range_model = BareMetalServerProfileCPUCoreCountRange.from_dict(bare_metal_server_profile_cpu_core_count_range_model_json)
+ assert bare_metal_server_profile_cpu_core_count_range_model != False
- snapshot_reference_deleted_model = {} # SnapshotReferenceDeleted
- snapshot_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a model instance of BareMetalServerProfileCPUCoreCountRange by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_core_count_range_model_dict = BareMetalServerProfileCPUCoreCountRange.from_dict(bare_metal_server_profile_cpu_core_count_range_model_json).__dict__
+ bare_metal_server_profile_cpu_core_count_range_model2 = BareMetalServerProfileCPUCoreCountRange(**bare_metal_server_profile_cpu_core_count_range_model_dict)
- snapshot_reference_model = {} # SnapshotReference
- snapshot_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::snapshot:r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_reference_model['deleted'] = snapshot_reference_deleted_model
- snapshot_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/snapshots/r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_reference_model['id'] = 'r134-f6bfa329-0e36-433f-a3bb-0df632e79263'
- snapshot_reference_model['name'] = 'my-snapshot'
- snapshot_reference_model['resource_type'] = 'snapshot'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_cpu_core_count_range_model == bare_metal_server_profile_cpu_core_count_range_model2
- volume_status_reason_model = {} # VolumeStatusReason
- volume_status_reason_model['code'] = 'encryption_key_deleted'
- volume_status_reason_model['message'] = 'testString'
- volume_status_reason_model['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_cpu_core_count_range_model_json2 = bare_metal_server_profile_cpu_core_count_range_model.to_dict()
+ assert bare_metal_server_profile_cpu_core_count_range_model_json2 == bare_metal_server_profile_cpu_core_count_range_model_json
- volume_attachment_reference_volume_context_deleted_model = {} # VolumeAttachmentReferenceVolumeContextDeleted
- volume_attachment_reference_volume_context_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+class TestModel_BareMetalServerProfileCPUSocketCountDependent():
+ """
+ Test Class for BareMetalServerProfileCPUSocketCountDependent
+ """
- volume_attachment_device_model = {} # VolumeAttachmentDevice
- volume_attachment_device_model['id'] = '80b3e36e-41f4-40e9-bd56-beae81792a68'
+ def test_bare_metal_server_profile_cpu_socket_count_dependent_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCPUSocketCountDependent
+ """
- instance_reference_deleted_model = {} # InstanceReferenceDeleted
- instance_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a BareMetalServerProfileCPUSocketCountDependent model
+ bare_metal_server_profile_cpu_socket_count_dependent_model_json = {}
+ bare_metal_server_profile_cpu_socket_count_dependent_model_json['type'] = 'dependent'
- instance_reference_model = {} # InstanceReference
- instance_reference_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::instance:1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['deleted'] = instance_reference_deleted_model
- instance_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
- instance_reference_model['name'] = 'my-instance'
+ # Construct a model instance of BareMetalServerProfileCPUSocketCountDependent by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_socket_count_dependent_model = BareMetalServerProfileCPUSocketCountDependent.from_dict(bare_metal_server_profile_cpu_socket_count_dependent_model_json)
+ assert bare_metal_server_profile_cpu_socket_count_dependent_model != False
- volume_attachment_reference_volume_context_model = {} # VolumeAttachmentReferenceVolumeContext
- volume_attachment_reference_volume_context_model['delete_volume_on_instance_delete'] = True
- volume_attachment_reference_volume_context_model['deleted'] = volume_attachment_reference_volume_context_deleted_model
- volume_attachment_reference_volume_context_model['device'] = volume_attachment_device_model
- volume_attachment_reference_volume_context_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/volume_attachments/82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_volume_context_model['id'] = '82cbf856-9cbb-45fb-b62f-d7bcef32399a'
- volume_attachment_reference_volume_context_model['instance'] = instance_reference_model
- volume_attachment_reference_volume_context_model['name'] = 'my-volume-attachment'
- volume_attachment_reference_volume_context_model['type'] = 'boot'
+ # Construct a model instance of BareMetalServerProfileCPUSocketCountDependent by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_socket_count_dependent_model_dict = BareMetalServerProfileCPUSocketCountDependent.from_dict(bare_metal_server_profile_cpu_socket_count_dependent_model_json).__dict__
+ bare_metal_server_profile_cpu_socket_count_dependent_model2 = BareMetalServerProfileCPUSocketCountDependent(**bare_metal_server_profile_cpu_socket_count_dependent_model_dict)
- zone_reference_model = {} # ZoneReference
- zone_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model['name'] = 'us-south-1'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_cpu_socket_count_dependent_model == bare_metal_server_profile_cpu_socket_count_dependent_model2
- volume_model = {} # Volume
- volume_model['active'] = True
- volume_model['bandwidth'] = 1000
- volume_model['busy'] = True
- volume_model['capacity'] = 1000
- volume_model['created_at'] = "2019-01-01T12:00:00Z"
- volume_model['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model['encryption'] = 'provider_managed'
- volume_model['encryption_key'] = encryption_key_reference_model
- volume_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_model['iops'] = 10000
- volume_model['name'] = 'my-volume'
- volume_model['operating_system'] = operating_system_reference_model
- volume_model['profile'] = volume_profile_reference_model
- volume_model['resource_group'] = resource_group_reference_model
- volume_model['source_image'] = image_reference_model
- volume_model['source_snapshot'] = snapshot_reference_model
- volume_model['status'] = 'available'
- volume_model['status_reasons'] = [volume_status_reason_model]
- volume_model['volume_attachments'] = [volume_attachment_reference_volume_context_model]
- volume_model['zone'] = zone_reference_model
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_cpu_socket_count_dependent_model_json2 = bare_metal_server_profile_cpu_socket_count_dependent_model.to_dict()
+ assert bare_metal_server_profile_cpu_socket_count_dependent_model_json2 == bare_metal_server_profile_cpu_socket_count_dependent_model_json
- # Construct a json representation of a VolumeCollection model
- volume_collection_model_json = {}
- volume_collection_model_json['first'] = volume_collection_first_model
- volume_collection_model_json['limit'] = 20
- volume_collection_model_json['next'] = volume_collection_next_model
- volume_collection_model_json['volumes'] = [volume_model]
+class TestModel_BareMetalServerProfileCPUSocketCountEnum():
+ """
+ Test Class for BareMetalServerProfileCPUSocketCountEnum
+ """
- # Construct a model instance of VolumeCollection by calling from_dict on the json representation
- volume_collection_model = VolumeCollection.from_dict(volume_collection_model_json)
- assert volume_collection_model != False
+ def test_bare_metal_server_profile_cpu_socket_count_enum_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileCPUSocketCountEnum
+ """
+
+ # Construct a json representation of a BareMetalServerProfileCPUSocketCountEnum model
+ bare_metal_server_profile_cpu_socket_count_enum_model_json = {}
+ bare_metal_server_profile_cpu_socket_count_enum_model_json['default'] = 38
+ bare_metal_server_profile_cpu_socket_count_enum_model_json['type'] = 'enum'
+ bare_metal_server_profile_cpu_socket_count_enum_model_json['values'] = [1, 2, 3, 4]
- # Construct a model instance of VolumeCollection by calling from_dict on the json representation
- volume_collection_model_dict = VolumeCollection.from_dict(volume_collection_model_json).__dict__
- volume_collection_model2 = VolumeCollection(**volume_collection_model_dict)
+ # Construct a model instance of BareMetalServerProfileCPUSocketCountEnum by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_socket_count_enum_model = BareMetalServerProfileCPUSocketCountEnum.from_dict(bare_metal_server_profile_cpu_socket_count_enum_model_json)
+ assert bare_metal_server_profile_cpu_socket_count_enum_model != False
+
+ # Construct a model instance of BareMetalServerProfileCPUSocketCountEnum by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_socket_count_enum_model_dict = BareMetalServerProfileCPUSocketCountEnum.from_dict(bare_metal_server_profile_cpu_socket_count_enum_model_json).__dict__
+ bare_metal_server_profile_cpu_socket_count_enum_model2 = BareMetalServerProfileCPUSocketCountEnum(**bare_metal_server_profile_cpu_socket_count_enum_model_dict)
# Verify the model instances are equivalent
- assert volume_collection_model == volume_collection_model2
+ assert bare_metal_server_profile_cpu_socket_count_enum_model == bare_metal_server_profile_cpu_socket_count_enum_model2
# Convert model instance back to dict and verify no loss of data
- volume_collection_model_json2 = volume_collection_model.to_dict()
- assert volume_collection_model_json2 == volume_collection_model_json
+ bare_metal_server_profile_cpu_socket_count_enum_model_json2 = bare_metal_server_profile_cpu_socket_count_enum_model.to_dict()
+ assert bare_metal_server_profile_cpu_socket_count_enum_model_json2 == bare_metal_server_profile_cpu_socket_count_enum_model_json
-class TestModel_VolumeCollectionFirst():
+class TestModel_BareMetalServerProfileCPUSocketCountFixed():
"""
- Test Class for VolumeCollectionFirst
+ Test Class for BareMetalServerProfileCPUSocketCountFixed
"""
- def test_volume_collection_first_serialization(self):
+ def test_bare_metal_server_profile_cpu_socket_count_fixed_serialization(self):
"""
- Test serialization/deserialization for VolumeCollectionFirst
+ Test serialization/deserialization for BareMetalServerProfileCPUSocketCountFixed
"""
- # Construct a json representation of a VolumeCollectionFirst model
- volume_collection_first_model_json = {}
- volume_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?limit=20'
+ # Construct a json representation of a BareMetalServerProfileCPUSocketCountFixed model
+ bare_metal_server_profile_cpu_socket_count_fixed_model_json = {}
+ bare_metal_server_profile_cpu_socket_count_fixed_model_json['type'] = 'fixed'
+ bare_metal_server_profile_cpu_socket_count_fixed_model_json['value'] = 4
- # Construct a model instance of VolumeCollectionFirst by calling from_dict on the json representation
- volume_collection_first_model = VolumeCollectionFirst.from_dict(volume_collection_first_model_json)
- assert volume_collection_first_model != False
+ # Construct a model instance of BareMetalServerProfileCPUSocketCountFixed by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_socket_count_fixed_model = BareMetalServerProfileCPUSocketCountFixed.from_dict(bare_metal_server_profile_cpu_socket_count_fixed_model_json)
+ assert bare_metal_server_profile_cpu_socket_count_fixed_model != False
- # Construct a model instance of VolumeCollectionFirst by calling from_dict on the json representation
- volume_collection_first_model_dict = VolumeCollectionFirst.from_dict(volume_collection_first_model_json).__dict__
- volume_collection_first_model2 = VolumeCollectionFirst(**volume_collection_first_model_dict)
+ # Construct a model instance of BareMetalServerProfileCPUSocketCountFixed by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_socket_count_fixed_model_dict = BareMetalServerProfileCPUSocketCountFixed.from_dict(bare_metal_server_profile_cpu_socket_count_fixed_model_json).__dict__
+ bare_metal_server_profile_cpu_socket_count_fixed_model2 = BareMetalServerProfileCPUSocketCountFixed(**bare_metal_server_profile_cpu_socket_count_fixed_model_dict)
# Verify the model instances are equivalent
- assert volume_collection_first_model == volume_collection_first_model2
+ assert bare_metal_server_profile_cpu_socket_count_fixed_model == bare_metal_server_profile_cpu_socket_count_fixed_model2
# Convert model instance back to dict and verify no loss of data
- volume_collection_first_model_json2 = volume_collection_first_model.to_dict()
- assert volume_collection_first_model_json2 == volume_collection_first_model_json
+ bare_metal_server_profile_cpu_socket_count_fixed_model_json2 = bare_metal_server_profile_cpu_socket_count_fixed_model.to_dict()
+ assert bare_metal_server_profile_cpu_socket_count_fixed_model_json2 == bare_metal_server_profile_cpu_socket_count_fixed_model_json
-class TestModel_VolumeCollectionNext():
+class TestModel_BareMetalServerProfileCPUSocketCountRange():
"""
- Test Class for VolumeCollectionNext
+ Test Class for BareMetalServerProfileCPUSocketCountRange
"""
- def test_volume_collection_next_serialization(self):
+ def test_bare_metal_server_profile_cpu_socket_count_range_serialization(self):
"""
- Test serialization/deserialization for VolumeCollectionNext
+ Test serialization/deserialization for BareMetalServerProfileCPUSocketCountRange
"""
- # Construct a json representation of a VolumeCollectionNext model
- volume_collection_next_model_json = {}
- volume_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a BareMetalServerProfileCPUSocketCountRange model
+ bare_metal_server_profile_cpu_socket_count_range_model_json = {}
+ bare_metal_server_profile_cpu_socket_count_range_model_json['default'] = 4
+ bare_metal_server_profile_cpu_socket_count_range_model_json['max'] = 8
+ bare_metal_server_profile_cpu_socket_count_range_model_json['min'] = 1
+ bare_metal_server_profile_cpu_socket_count_range_model_json['step'] = 1
+ bare_metal_server_profile_cpu_socket_count_range_model_json['type'] = 'range'
- # Construct a model instance of VolumeCollectionNext by calling from_dict on the json representation
- volume_collection_next_model = VolumeCollectionNext.from_dict(volume_collection_next_model_json)
- assert volume_collection_next_model != False
+ # Construct a model instance of BareMetalServerProfileCPUSocketCountRange by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_socket_count_range_model = BareMetalServerProfileCPUSocketCountRange.from_dict(bare_metal_server_profile_cpu_socket_count_range_model_json)
+ assert bare_metal_server_profile_cpu_socket_count_range_model != False
- # Construct a model instance of VolumeCollectionNext by calling from_dict on the json representation
- volume_collection_next_model_dict = VolumeCollectionNext.from_dict(volume_collection_next_model_json).__dict__
- volume_collection_next_model2 = VolumeCollectionNext(**volume_collection_next_model_dict)
+ # Construct a model instance of BareMetalServerProfileCPUSocketCountRange by calling from_dict on the json representation
+ bare_metal_server_profile_cpu_socket_count_range_model_dict = BareMetalServerProfileCPUSocketCountRange.from_dict(bare_metal_server_profile_cpu_socket_count_range_model_json).__dict__
+ bare_metal_server_profile_cpu_socket_count_range_model2 = BareMetalServerProfileCPUSocketCountRange(**bare_metal_server_profile_cpu_socket_count_range_model_dict)
# Verify the model instances are equivalent
- assert volume_collection_next_model == volume_collection_next_model2
+ assert bare_metal_server_profile_cpu_socket_count_range_model == bare_metal_server_profile_cpu_socket_count_range_model2
# Convert model instance back to dict and verify no loss of data
- volume_collection_next_model_json2 = volume_collection_next_model.to_dict()
- assert volume_collection_next_model_json2 == volume_collection_next_model_json
+ bare_metal_server_profile_cpu_socket_count_range_model_json2 = bare_metal_server_profile_cpu_socket_count_range_model.to_dict()
+ assert bare_metal_server_profile_cpu_socket_count_range_model_json2 == bare_metal_server_profile_cpu_socket_count_range_model_json
-class TestModel_VolumePatch():
+class TestModel_BareMetalServerProfileDiskQuantityDependent():
"""
- Test Class for VolumePatch
+ Test Class for BareMetalServerProfileDiskQuantityDependent
"""
- def test_volume_patch_serialization(self):
+ def test_bare_metal_server_profile_disk_quantity_dependent_serialization(self):
"""
- Test serialization/deserialization for VolumePatch
+ Test serialization/deserialization for BareMetalServerProfileDiskQuantityDependent
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
-
- # Construct a json representation of a VolumePatch model
- volume_patch_model_json = {}
- volume_patch_model_json['capacity'] = 100
- volume_patch_model_json['iops'] = 10000
- volume_patch_model_json['name'] = 'my-volume'
- volume_patch_model_json['profile'] = volume_profile_identity_model
+ # Construct a json representation of a BareMetalServerProfileDiskQuantityDependent model
+ bare_metal_server_profile_disk_quantity_dependent_model_json = {}
+ bare_metal_server_profile_disk_quantity_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of VolumePatch by calling from_dict on the json representation
- volume_patch_model = VolumePatch.from_dict(volume_patch_model_json)
- assert volume_patch_model != False
+ # Construct a model instance of BareMetalServerProfileDiskQuantityDependent by calling from_dict on the json representation
+ bare_metal_server_profile_disk_quantity_dependent_model = BareMetalServerProfileDiskQuantityDependent.from_dict(bare_metal_server_profile_disk_quantity_dependent_model_json)
+ assert bare_metal_server_profile_disk_quantity_dependent_model != False
- # Construct a model instance of VolumePatch by calling from_dict on the json representation
- volume_patch_model_dict = VolumePatch.from_dict(volume_patch_model_json).__dict__
- volume_patch_model2 = VolumePatch(**volume_patch_model_dict)
+ # Construct a model instance of BareMetalServerProfileDiskQuantityDependent by calling from_dict on the json representation
+ bare_metal_server_profile_disk_quantity_dependent_model_dict = BareMetalServerProfileDiskQuantityDependent.from_dict(bare_metal_server_profile_disk_quantity_dependent_model_json).__dict__
+ bare_metal_server_profile_disk_quantity_dependent_model2 = BareMetalServerProfileDiskQuantityDependent(**bare_metal_server_profile_disk_quantity_dependent_model_dict)
# Verify the model instances are equivalent
- assert volume_patch_model == volume_patch_model2
+ assert bare_metal_server_profile_disk_quantity_dependent_model == bare_metal_server_profile_disk_quantity_dependent_model2
# Convert model instance back to dict and verify no loss of data
- volume_patch_model_json2 = volume_patch_model.to_dict()
- assert volume_patch_model_json2 == volume_patch_model_json
+ bare_metal_server_profile_disk_quantity_dependent_model_json2 = bare_metal_server_profile_disk_quantity_dependent_model.to_dict()
+ assert bare_metal_server_profile_disk_quantity_dependent_model_json2 == bare_metal_server_profile_disk_quantity_dependent_model_json
-class TestModel_VolumeProfile():
+class TestModel_BareMetalServerProfileDiskQuantityEnum():
"""
- Test Class for VolumeProfile
+ Test Class for BareMetalServerProfileDiskQuantityEnum
"""
- def test_volume_profile_serialization(self):
+ def test_bare_metal_server_profile_disk_quantity_enum_serialization(self):
"""
- Test serialization/deserialization for VolumeProfile
+ Test serialization/deserialization for BareMetalServerProfileDiskQuantityEnum
"""
- # Construct a json representation of a VolumeProfile model
- volume_profile_model_json = {}
- volume_profile_model_json['family'] = 'tiered'
- volume_profile_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
- volume_profile_model_json['name'] = 'general-purpose'
+ # Construct a json representation of a BareMetalServerProfileDiskQuantityEnum model
+ bare_metal_server_profile_disk_quantity_enum_model_json = {}
+ bare_metal_server_profile_disk_quantity_enum_model_json['default'] = 38
+ bare_metal_server_profile_disk_quantity_enum_model_json['type'] = 'enum'
+ bare_metal_server_profile_disk_quantity_enum_model_json['values'] = [1, 2, 4, 8]
- # Construct a model instance of VolumeProfile by calling from_dict on the json representation
- volume_profile_model = VolumeProfile.from_dict(volume_profile_model_json)
- assert volume_profile_model != False
+ # Construct a model instance of BareMetalServerProfileDiskQuantityEnum by calling from_dict on the json representation
+ bare_metal_server_profile_disk_quantity_enum_model = BareMetalServerProfileDiskQuantityEnum.from_dict(bare_metal_server_profile_disk_quantity_enum_model_json)
+ assert bare_metal_server_profile_disk_quantity_enum_model != False
- # Construct a model instance of VolumeProfile by calling from_dict on the json representation
- volume_profile_model_dict = VolumeProfile.from_dict(volume_profile_model_json).__dict__
- volume_profile_model2 = VolumeProfile(**volume_profile_model_dict)
+ # Construct a model instance of BareMetalServerProfileDiskQuantityEnum by calling from_dict on the json representation
+ bare_metal_server_profile_disk_quantity_enum_model_dict = BareMetalServerProfileDiskQuantityEnum.from_dict(bare_metal_server_profile_disk_quantity_enum_model_json).__dict__
+ bare_metal_server_profile_disk_quantity_enum_model2 = BareMetalServerProfileDiskQuantityEnum(**bare_metal_server_profile_disk_quantity_enum_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_model == volume_profile_model2
+ assert bare_metal_server_profile_disk_quantity_enum_model == bare_metal_server_profile_disk_quantity_enum_model2
# Convert model instance back to dict and verify no loss of data
- volume_profile_model_json2 = volume_profile_model.to_dict()
- assert volume_profile_model_json2 == volume_profile_model_json
+ bare_metal_server_profile_disk_quantity_enum_model_json2 = bare_metal_server_profile_disk_quantity_enum_model.to_dict()
+ assert bare_metal_server_profile_disk_quantity_enum_model_json2 == bare_metal_server_profile_disk_quantity_enum_model_json
-class TestModel_VolumeProfileCollection():
+class TestModel_BareMetalServerProfileDiskQuantityFixed():
"""
- Test Class for VolumeProfileCollection
+ Test Class for BareMetalServerProfileDiskQuantityFixed
"""
- def test_volume_profile_collection_serialization(self):
+ def test_bare_metal_server_profile_disk_quantity_fixed_serialization(self):
"""
- Test serialization/deserialization for VolumeProfileCollection
+ Test serialization/deserialization for BareMetalServerProfileDiskQuantityFixed
"""
- # Construct dict forms of any model objects needed in order to build this model.
+ # Construct a json representation of a BareMetalServerProfileDiskQuantityFixed model
+ bare_metal_server_profile_disk_quantity_fixed_model_json = {}
+ bare_metal_server_profile_disk_quantity_fixed_model_json['type'] = 'fixed'
+ bare_metal_server_profile_disk_quantity_fixed_model_json['value'] = 4
- volume_profile_collection_first_model = {} # VolumeProfileCollectionFirst
- volume_profile_collection_first_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20'
+ # Construct a model instance of BareMetalServerProfileDiskQuantityFixed by calling from_dict on the json representation
+ bare_metal_server_profile_disk_quantity_fixed_model = BareMetalServerProfileDiskQuantityFixed.from_dict(bare_metal_server_profile_disk_quantity_fixed_model_json)
+ assert bare_metal_server_profile_disk_quantity_fixed_model != False
- volume_profile_collection_next_model = {} # VolumeProfileCollectionNext
- volume_profile_collection_next_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a model instance of BareMetalServerProfileDiskQuantityFixed by calling from_dict on the json representation
+ bare_metal_server_profile_disk_quantity_fixed_model_dict = BareMetalServerProfileDiskQuantityFixed.from_dict(bare_metal_server_profile_disk_quantity_fixed_model_json).__dict__
+ bare_metal_server_profile_disk_quantity_fixed_model2 = BareMetalServerProfileDiskQuantityFixed(**bare_metal_server_profile_disk_quantity_fixed_model_dict)
- volume_profile_model = {} # VolumeProfile
- volume_profile_model['family'] = 'tiered'
- volume_profile_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
- volume_profile_model['name'] = 'general-purpose'
+ # Verify the model instances are equivalent
+ assert bare_metal_server_profile_disk_quantity_fixed_model == bare_metal_server_profile_disk_quantity_fixed_model2
- # Construct a json representation of a VolumeProfileCollection model
- volume_profile_collection_model_json = {}
- volume_profile_collection_model_json['first'] = volume_profile_collection_first_model
- volume_profile_collection_model_json['limit'] = 20
- volume_profile_collection_model_json['next'] = volume_profile_collection_next_model
- volume_profile_collection_model_json['profiles'] = [volume_profile_model]
- volume_profile_collection_model_json['total_count'] = 132
+ # Convert model instance back to dict and verify no loss of data
+ bare_metal_server_profile_disk_quantity_fixed_model_json2 = bare_metal_server_profile_disk_quantity_fixed_model.to_dict()
+ assert bare_metal_server_profile_disk_quantity_fixed_model_json2 == bare_metal_server_profile_disk_quantity_fixed_model_json
- # Construct a model instance of VolumeProfileCollection by calling from_dict on the json representation
- volume_profile_collection_model = VolumeProfileCollection.from_dict(volume_profile_collection_model_json)
- assert volume_profile_collection_model != False
+class TestModel_BareMetalServerProfileDiskQuantityRange():
+ """
+ Test Class for BareMetalServerProfileDiskQuantityRange
+ """
- # Construct a model instance of VolumeProfileCollection by calling from_dict on the json representation
- volume_profile_collection_model_dict = VolumeProfileCollection.from_dict(volume_profile_collection_model_json).__dict__
- volume_profile_collection_model2 = VolumeProfileCollection(**volume_profile_collection_model_dict)
+ def test_bare_metal_server_profile_disk_quantity_range_serialization(self):
+ """
+ Test serialization/deserialization for BareMetalServerProfileDiskQuantityRange
+ """
+
+ # Construct a json representation of a BareMetalServerProfileDiskQuantityRange model
+ bare_metal_server_profile_disk_quantity_range_model_json = {}
+ bare_metal_server_profile_disk_quantity_range_model_json['default'] = 1
+ bare_metal_server_profile_disk_quantity_range_model_json['max'] = 4
+ bare_metal_server_profile_disk_quantity_range_model_json['min'] = 1
+ bare_metal_server_profile_disk_quantity_range_model_json['step'] = 1
+ bare_metal_server_profile_disk_quantity_range_model_json['type'] = 'range'
+
+ # Construct a model instance of BareMetalServerProfileDiskQuantityRange by calling from_dict on the json representation
+ bare_metal_server_profile_disk_quantity_range_model = BareMetalServerProfileDiskQuantityRange.from_dict(bare_metal_server_profile_disk_quantity_range_model_json)
+ assert bare_metal_server_profile_disk_quantity_range_model != False
+
+ # Construct a model instance of BareMetalServerProfileDiskQuantityRange by calling from_dict on the json representation
+ bare_metal_server_profile_disk_quantity_range_model_dict = BareMetalServerProfileDiskQuantityRange.from_dict(bare_metal_server_profile_disk_quantity_range_model_json).__dict__
+ bare_metal_server_profile_disk_quantity_range_model2 = BareMetalServerProfileDiskQuantityRange(**bare_metal_server_profile_disk_quantity_range_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_collection_model == volume_profile_collection_model2
+ assert bare_metal_server_profile_disk_quantity_range_model == bare_metal_server_profile_disk_quantity_range_model2
# Convert model instance back to dict and verify no loss of data
- volume_profile_collection_model_json2 = volume_profile_collection_model.to_dict()
- assert volume_profile_collection_model_json2 == volume_profile_collection_model_json
+ bare_metal_server_profile_disk_quantity_range_model_json2 = bare_metal_server_profile_disk_quantity_range_model.to_dict()
+ assert bare_metal_server_profile_disk_quantity_range_model_json2 == bare_metal_server_profile_disk_quantity_range_model_json
-class TestModel_VolumeProfileCollectionFirst():
+class TestModel_BareMetalServerProfileDiskSizeDependent():
"""
- Test Class for VolumeProfileCollectionFirst
+ Test Class for BareMetalServerProfileDiskSizeDependent
"""
- def test_volume_profile_collection_first_serialization(self):
+ def test_bare_metal_server_profile_disk_size_dependent_serialization(self):
"""
- Test serialization/deserialization for VolumeProfileCollectionFirst
+ Test serialization/deserialization for BareMetalServerProfileDiskSizeDependent
"""
- # Construct a json representation of a VolumeProfileCollectionFirst model
- volume_profile_collection_first_model_json = {}
- volume_profile_collection_first_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?limit=20'
+ # Construct a json representation of a BareMetalServerProfileDiskSizeDependent model
+ bare_metal_server_profile_disk_size_dependent_model_json = {}
+ bare_metal_server_profile_disk_size_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of VolumeProfileCollectionFirst by calling from_dict on the json representation
- volume_profile_collection_first_model = VolumeProfileCollectionFirst.from_dict(volume_profile_collection_first_model_json)
- assert volume_profile_collection_first_model != False
+ # Construct a model instance of BareMetalServerProfileDiskSizeDependent by calling from_dict on the json representation
+ bare_metal_server_profile_disk_size_dependent_model = BareMetalServerProfileDiskSizeDependent.from_dict(bare_metal_server_profile_disk_size_dependent_model_json)
+ assert bare_metal_server_profile_disk_size_dependent_model != False
- # Construct a model instance of VolumeProfileCollectionFirst by calling from_dict on the json representation
- volume_profile_collection_first_model_dict = VolumeProfileCollectionFirst.from_dict(volume_profile_collection_first_model_json).__dict__
- volume_profile_collection_first_model2 = VolumeProfileCollectionFirst(**volume_profile_collection_first_model_dict)
+ # Construct a model instance of BareMetalServerProfileDiskSizeDependent by calling from_dict on the json representation
+ bare_metal_server_profile_disk_size_dependent_model_dict = BareMetalServerProfileDiskSizeDependent.from_dict(bare_metal_server_profile_disk_size_dependent_model_json).__dict__
+ bare_metal_server_profile_disk_size_dependent_model2 = BareMetalServerProfileDiskSizeDependent(**bare_metal_server_profile_disk_size_dependent_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_collection_first_model == volume_profile_collection_first_model2
+ assert bare_metal_server_profile_disk_size_dependent_model == bare_metal_server_profile_disk_size_dependent_model2
# Convert model instance back to dict and verify no loss of data
- volume_profile_collection_first_model_json2 = volume_profile_collection_first_model.to_dict()
- assert volume_profile_collection_first_model_json2 == volume_profile_collection_first_model_json
+ bare_metal_server_profile_disk_size_dependent_model_json2 = bare_metal_server_profile_disk_size_dependent_model.to_dict()
+ assert bare_metal_server_profile_disk_size_dependent_model_json2 == bare_metal_server_profile_disk_size_dependent_model_json
-class TestModel_VolumeProfileCollectionNext():
+class TestModel_BareMetalServerProfileDiskSizeEnum():
"""
- Test Class for VolumeProfileCollectionNext
+ Test Class for BareMetalServerProfileDiskSizeEnum
"""
- def test_volume_profile_collection_next_serialization(self):
+ def test_bare_metal_server_profile_disk_size_enum_serialization(self):
"""
- Test serialization/deserialization for VolumeProfileCollectionNext
+ Test serialization/deserialization for BareMetalServerProfileDiskSizeEnum
"""
- # Construct a json representation of a VolumeProfileCollectionNext model
- volume_profile_collection_next_model_json = {}
- volume_profile_collection_next_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles?start=9d5a91a3e2cbd233b5a5b33436855ed1&limit=20'
+ # Construct a json representation of a BareMetalServerProfileDiskSizeEnum model
+ bare_metal_server_profile_disk_size_enum_model_json = {}
+ bare_metal_server_profile_disk_size_enum_model_json['default'] = 38
+ bare_metal_server_profile_disk_size_enum_model_json['type'] = 'enum'
+ bare_metal_server_profile_disk_size_enum_model_json['values'] = [1, 2, 4, 8]
- # Construct a model instance of VolumeProfileCollectionNext by calling from_dict on the json representation
- volume_profile_collection_next_model = VolumeProfileCollectionNext.from_dict(volume_profile_collection_next_model_json)
- assert volume_profile_collection_next_model != False
+ # Construct a model instance of BareMetalServerProfileDiskSizeEnum by calling from_dict on the json representation
+ bare_metal_server_profile_disk_size_enum_model = BareMetalServerProfileDiskSizeEnum.from_dict(bare_metal_server_profile_disk_size_enum_model_json)
+ assert bare_metal_server_profile_disk_size_enum_model != False
- # Construct a model instance of VolumeProfileCollectionNext by calling from_dict on the json representation
- volume_profile_collection_next_model_dict = VolumeProfileCollectionNext.from_dict(volume_profile_collection_next_model_json).__dict__
- volume_profile_collection_next_model2 = VolumeProfileCollectionNext(**volume_profile_collection_next_model_dict)
+ # Construct a model instance of BareMetalServerProfileDiskSizeEnum by calling from_dict on the json representation
+ bare_metal_server_profile_disk_size_enum_model_dict = BareMetalServerProfileDiskSizeEnum.from_dict(bare_metal_server_profile_disk_size_enum_model_json).__dict__
+ bare_metal_server_profile_disk_size_enum_model2 = BareMetalServerProfileDiskSizeEnum(**bare_metal_server_profile_disk_size_enum_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_collection_next_model == volume_profile_collection_next_model2
+ assert bare_metal_server_profile_disk_size_enum_model == bare_metal_server_profile_disk_size_enum_model2
# Convert model instance back to dict and verify no loss of data
- volume_profile_collection_next_model_json2 = volume_profile_collection_next_model.to_dict()
- assert volume_profile_collection_next_model_json2 == volume_profile_collection_next_model_json
+ bare_metal_server_profile_disk_size_enum_model_json2 = bare_metal_server_profile_disk_size_enum_model.to_dict()
+ assert bare_metal_server_profile_disk_size_enum_model_json2 == bare_metal_server_profile_disk_size_enum_model_json
-class TestModel_VolumeProfileReference():
+class TestModel_BareMetalServerProfileDiskSizeFixed():
"""
- Test Class for VolumeProfileReference
+ Test Class for BareMetalServerProfileDiskSizeFixed
"""
- def test_volume_profile_reference_serialization(self):
+ def test_bare_metal_server_profile_disk_size_fixed_serialization(self):
"""
- Test serialization/deserialization for VolumeProfileReference
+ Test serialization/deserialization for BareMetalServerProfileDiskSizeFixed
"""
- # Construct a json representation of a VolumeProfileReference model
- volume_profile_reference_model_json = {}
- volume_profile_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volume/profiles/general-purpose'
- volume_profile_reference_model_json['name'] = 'general-purpose'
+ # Construct a json representation of a BareMetalServerProfileDiskSizeFixed model
+ bare_metal_server_profile_disk_size_fixed_model_json = {}
+ bare_metal_server_profile_disk_size_fixed_model_json['type'] = 'fixed'
+ bare_metal_server_profile_disk_size_fixed_model_json['value'] = 100
- # Construct a model instance of VolumeProfileReference by calling from_dict on the json representation
- volume_profile_reference_model = VolumeProfileReference.from_dict(volume_profile_reference_model_json)
- assert volume_profile_reference_model != False
+ # Construct a model instance of BareMetalServerProfileDiskSizeFixed by calling from_dict on the json representation
+ bare_metal_server_profile_disk_size_fixed_model = BareMetalServerProfileDiskSizeFixed.from_dict(bare_metal_server_profile_disk_size_fixed_model_json)
+ assert bare_metal_server_profile_disk_size_fixed_model != False
- # Construct a model instance of VolumeProfileReference by calling from_dict on the json representation
- volume_profile_reference_model_dict = VolumeProfileReference.from_dict(volume_profile_reference_model_json).__dict__
- volume_profile_reference_model2 = VolumeProfileReference(**volume_profile_reference_model_dict)
+ # Construct a model instance of BareMetalServerProfileDiskSizeFixed by calling from_dict on the json representation
+ bare_metal_server_profile_disk_size_fixed_model_dict = BareMetalServerProfileDiskSizeFixed.from_dict(bare_metal_server_profile_disk_size_fixed_model_json).__dict__
+ bare_metal_server_profile_disk_size_fixed_model2 = BareMetalServerProfileDiskSizeFixed(**bare_metal_server_profile_disk_size_fixed_model_dict)
# Verify the model instances are equivalent
- assert volume_profile_reference_model == volume_profile_reference_model2
+ assert bare_metal_server_profile_disk_size_fixed_model == bare_metal_server_profile_disk_size_fixed_model2
# Convert model instance back to dict and verify no loss of data
- volume_profile_reference_model_json2 = volume_profile_reference_model.to_dict()
- assert volume_profile_reference_model_json2 == volume_profile_reference_model_json
+ bare_metal_server_profile_disk_size_fixed_model_json2 = bare_metal_server_profile_disk_size_fixed_model.to_dict()
+ assert bare_metal_server_profile_disk_size_fixed_model_json2 == bare_metal_server_profile_disk_size_fixed_model_json
-class TestModel_VolumePrototypeInstanceByImageContext():
+class TestModel_BareMetalServerProfileDiskSizeRange():
"""
- Test Class for VolumePrototypeInstanceByImageContext
+ Test Class for BareMetalServerProfileDiskSizeRange
"""
- def test_volume_prototype_instance_by_image_context_serialization(self):
+ def test_bare_metal_server_profile_disk_size_range_serialization(self):
"""
- Test serialization/deserialization for VolumePrototypeInstanceByImageContext
+ Test serialization/deserialization for BareMetalServerProfileDiskSizeRange
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- encryption_key_identity_model = {} # EncryptionKeyIdentityByCRN
- encryption_key_identity_model['crn'] = 'crn:v1:bluemix:public:kms:us-south:a/dffc98a0f1f0f95f6613b3b752286b87:e4a29d1a-2ef0-42a6-8fd2-350deb1c647e:key:5437653b-c4b1-447f-9646-b2a2a4cd6179'
-
- volume_profile_identity_model = {} # VolumeProfileIdentityByName
- volume_profile_identity_model['name'] = 'general-purpose'
-
- # Construct a json representation of a VolumePrototypeInstanceByImageContext model
- volume_prototype_instance_by_image_context_model_json = {}
- volume_prototype_instance_by_image_context_model_json['capacity'] = 38
- volume_prototype_instance_by_image_context_model_json['encryption_key'] = encryption_key_identity_model
- volume_prototype_instance_by_image_context_model_json['iops'] = 10000
- volume_prototype_instance_by_image_context_model_json['name'] = 'my-volume'
- volume_prototype_instance_by_image_context_model_json['profile'] = volume_profile_identity_model
+ # Construct a json representation of a BareMetalServerProfileDiskSizeRange model
+ bare_metal_server_profile_disk_size_range_model_json = {}
+ bare_metal_server_profile_disk_size_range_model_json['default'] = 100
+ bare_metal_server_profile_disk_size_range_model_json['max'] = 1000
+ bare_metal_server_profile_disk_size_range_model_json['min'] = 100
+ bare_metal_server_profile_disk_size_range_model_json['step'] = 10
+ bare_metal_server_profile_disk_size_range_model_json['type'] = 'range'
- # Construct a model instance of VolumePrototypeInstanceByImageContext by calling from_dict on the json representation
- volume_prototype_instance_by_image_context_model = VolumePrototypeInstanceByImageContext.from_dict(volume_prototype_instance_by_image_context_model_json)
- assert volume_prototype_instance_by_image_context_model != False
+ # Construct a model instance of BareMetalServerProfileDiskSizeRange by calling from_dict on the json representation
+ bare_metal_server_profile_disk_size_range_model = BareMetalServerProfileDiskSizeRange.from_dict(bare_metal_server_profile_disk_size_range_model_json)
+ assert bare_metal_server_profile_disk_size_range_model != False
- # Construct a model instance of VolumePrototypeInstanceByImageContext by calling from_dict on the json representation
- volume_prototype_instance_by_image_context_model_dict = VolumePrototypeInstanceByImageContext.from_dict(volume_prototype_instance_by_image_context_model_json).__dict__
- volume_prototype_instance_by_image_context_model2 = VolumePrototypeInstanceByImageContext(**volume_prototype_instance_by_image_context_model_dict)
+ # Construct a model instance of BareMetalServerProfileDiskSizeRange by calling from_dict on the json representation
+ bare_metal_server_profile_disk_size_range_model_dict = BareMetalServerProfileDiskSizeRange.from_dict(bare_metal_server_profile_disk_size_range_model_json).__dict__
+ bare_metal_server_profile_disk_size_range_model2 = BareMetalServerProfileDiskSizeRange(**bare_metal_server_profile_disk_size_range_model_dict)
# Verify the model instances are equivalent
- assert volume_prototype_instance_by_image_context_model == volume_prototype_instance_by_image_context_model2
+ assert bare_metal_server_profile_disk_size_range_model == bare_metal_server_profile_disk_size_range_model2
# Convert model instance back to dict and verify no loss of data
- volume_prototype_instance_by_image_context_model_json2 = volume_prototype_instance_by_image_context_model.to_dict()
- assert volume_prototype_instance_by_image_context_model_json2 == volume_prototype_instance_by_image_context_model_json
+ bare_metal_server_profile_disk_size_range_model_json2 = bare_metal_server_profile_disk_size_range_model.to_dict()
+ assert bare_metal_server_profile_disk_size_range_model_json2 == bare_metal_server_profile_disk_size_range_model_json
-class TestModel_VolumeReference():
+class TestModel_BareMetalServerProfileIdentityByHref():
"""
- Test Class for VolumeReference
+ Test Class for BareMetalServerProfileIdentityByHref
"""
- def test_volume_reference_serialization(self):
+ def test_bare_metal_server_profile_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for VolumeReference
+ Test serialization/deserialization for BareMetalServerProfileIdentityByHref
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- volume_reference_deleted_model = {} # VolumeReferenceDeleted
- volume_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
-
- # Construct a json representation of a VolumeReference model
- volume_reference_model_json = {}
- volume_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::volume:1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model_json['deleted'] = volume_reference_deleted_model
- volume_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/volumes/1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model_json['id'] = '1a6b7274-678d-4dfb-8981-c71dd9d4daa5'
- volume_reference_model_json['name'] = 'my-volume'
+ # Construct a json representation of a BareMetalServerProfileIdentityByHref model
+ bare_metal_server_profile_identity_by_href_model_json = {}
+ bare_metal_server_profile_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/bare_metal_servers/profiles/bx2-metal-192x768'
- # Construct a model instance of VolumeReference by calling from_dict on the json representation
- volume_reference_model = VolumeReference.from_dict(volume_reference_model_json)
- assert volume_reference_model != False
+ # Construct a model instance of BareMetalServerProfileIdentityByHref by calling from_dict on the json representation
+ bare_metal_server_profile_identity_by_href_model = BareMetalServerProfileIdentityByHref.from_dict(bare_metal_server_profile_identity_by_href_model_json)
+ assert bare_metal_server_profile_identity_by_href_model != False
- # Construct a model instance of VolumeReference by calling from_dict on the json representation
- volume_reference_model_dict = VolumeReference.from_dict(volume_reference_model_json).__dict__
- volume_reference_model2 = VolumeReference(**volume_reference_model_dict)
+ # Construct a model instance of BareMetalServerProfileIdentityByHref by calling from_dict on the json representation
+ bare_metal_server_profile_identity_by_href_model_dict = BareMetalServerProfileIdentityByHref.from_dict(bare_metal_server_profile_identity_by_href_model_json).__dict__
+ bare_metal_server_profile_identity_by_href_model2 = BareMetalServerProfileIdentityByHref(**bare_metal_server_profile_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert volume_reference_model == volume_reference_model2
+ assert bare_metal_server_profile_identity_by_href_model == bare_metal_server_profile_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- volume_reference_model_json2 = volume_reference_model.to_dict()
- assert volume_reference_model_json2 == volume_reference_model_json
+ bare_metal_server_profile_identity_by_href_model_json2 = bare_metal_server_profile_identity_by_href_model.to_dict()
+ assert bare_metal_server_profile_identity_by_href_model_json2 == bare_metal_server_profile_identity_by_href_model_json
-class TestModel_VolumeReferenceDeleted():
+class TestModel_BareMetalServerProfileIdentityByName():
"""
- Test Class for VolumeReferenceDeleted
+ Test Class for BareMetalServerProfileIdentityByName
"""
- def test_volume_reference_deleted_serialization(self):
+ def test_bare_metal_server_profile_identity_by_name_serialization(self):
"""
- Test serialization/deserialization for VolumeReferenceDeleted
+ Test serialization/deserialization for BareMetalServerProfileIdentityByName
"""
- # Construct a json representation of a VolumeReferenceDeleted model
- volume_reference_deleted_model_json = {}
- volume_reference_deleted_model_json['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+ # Construct a json representation of a BareMetalServerProfileIdentityByName model
+ bare_metal_server_profile_identity_by_name_model_json = {}
+ bare_metal_server_profile_identity_by_name_model_json['name'] = 'bx2-metal-192x768'
- # Construct a model instance of VolumeReferenceDeleted by calling from_dict on the json representation
- volume_reference_deleted_model = VolumeReferenceDeleted.from_dict(volume_reference_deleted_model_json)
- assert volume_reference_deleted_model != False
+ # Construct a model instance of BareMetalServerProfileIdentityByName by calling from_dict on the json representation
+ bare_metal_server_profile_identity_by_name_model = BareMetalServerProfileIdentityByName.from_dict(bare_metal_server_profile_identity_by_name_model_json)
+ assert bare_metal_server_profile_identity_by_name_model != False
- # Construct a model instance of VolumeReferenceDeleted by calling from_dict on the json representation
- volume_reference_deleted_model_dict = VolumeReferenceDeleted.from_dict(volume_reference_deleted_model_json).__dict__
- volume_reference_deleted_model2 = VolumeReferenceDeleted(**volume_reference_deleted_model_dict)
+ # Construct a model instance of BareMetalServerProfileIdentityByName by calling from_dict on the json representation
+ bare_metal_server_profile_identity_by_name_model_dict = BareMetalServerProfileIdentityByName.from_dict(bare_metal_server_profile_identity_by_name_model_json).__dict__
+ bare_metal_server_profile_identity_by_name_model2 = BareMetalServerProfileIdentityByName(**bare_metal_server_profile_identity_by_name_model_dict)
# Verify the model instances are equivalent
- assert volume_reference_deleted_model == volume_reference_deleted_model2
+ assert bare_metal_server_profile_identity_by_name_model == bare_metal_server_profile_identity_by_name_model2
# Convert model instance back to dict and verify no loss of data
- volume_reference_deleted_model_json2 = volume_reference_deleted_model.to_dict()
- assert volume_reference_deleted_model_json2 == volume_reference_deleted_model_json
+ bare_metal_server_profile_identity_by_name_model_json2 = bare_metal_server_profile_identity_by_name_model.to_dict()
+ assert bare_metal_server_profile_identity_by_name_model_json2 == bare_metal_server_profile_identity_by_name_model_json
-class TestModel_VolumeStatusReason():
+class TestModel_BareMetalServerProfileMemoryDependent():
"""
- Test Class for VolumeStatusReason
+ Test Class for BareMetalServerProfileMemoryDependent
"""
- def test_volume_status_reason_serialization(self):
+ def test_bare_metal_server_profile_memory_dependent_serialization(self):
"""
- Test serialization/deserialization for VolumeStatusReason
+ Test serialization/deserialization for BareMetalServerProfileMemoryDependent
"""
- # Construct a json representation of a VolumeStatusReason model
- volume_status_reason_model_json = {}
- volume_status_reason_model_json['code'] = 'encryption_key_deleted'
- volume_status_reason_model_json['message'] = 'testString'
- volume_status_reason_model_json['more_info'] = 'https://cloud.ibm.com/docs/key-protect?topic=key-protect-restore-keys'
+ # Construct a json representation of a BareMetalServerProfileMemoryDependent model
+ bare_metal_server_profile_memory_dependent_model_json = {}
+ bare_metal_server_profile_memory_dependent_model_json['type'] = 'dependent'
- # Construct a model instance of VolumeStatusReason by calling from_dict on the json representation
- volume_status_reason_model = VolumeStatusReason.from_dict(volume_status_reason_model_json)
- assert volume_status_reason_model != False
+ # Construct a model instance of BareMetalServerProfileMemoryDependent by calling from_dict on the json representation
+ bare_metal_server_profile_memory_dependent_model = BareMetalServerProfileMemoryDependent.from_dict(bare_metal_server_profile_memory_dependent_model_json)
+ assert bare_metal_server_profile_memory_dependent_model != False
- # Construct a model instance of VolumeStatusReason by calling from_dict on the json representation
- volume_status_reason_model_dict = VolumeStatusReason.from_dict(volume_status_reason_model_json).__dict__
- volume_status_reason_model2 = VolumeStatusReason(**volume_status_reason_model_dict)
+ # Construct a model instance of BareMetalServerProfileMemoryDependent by calling from_dict on the json representation
+ bare_metal_server_profile_memory_dependent_model_dict = BareMetalServerProfileMemoryDependent.from_dict(bare_metal_server_profile_memory_dependent_model_json).__dict__
+ bare_metal_server_profile_memory_dependent_model2 = BareMetalServerProfileMemoryDependent(**bare_metal_server_profile_memory_dependent_model_dict)
# Verify the model instances are equivalent
- assert volume_status_reason_model == volume_status_reason_model2
+ assert bare_metal_server_profile_memory_dependent_model == bare_metal_server_profile_memory_dependent_model2
# Convert model instance back to dict and verify no loss of data
- volume_status_reason_model_json2 = volume_status_reason_model.to_dict()
- assert volume_status_reason_model_json2 == volume_status_reason_model_json
+ bare_metal_server_profile_memory_dependent_model_json2 = bare_metal_server_profile_memory_dependent_model.to_dict()
+ assert bare_metal_server_profile_memory_dependent_model_json2 == bare_metal_server_profile_memory_dependent_model_json
-class TestModel_Zone():
+class TestModel_BareMetalServerProfileMemoryEnum():
"""
- Test Class for Zone
+ Test Class for BareMetalServerProfileMemoryEnum
"""
- def test_zone_serialization(self):
+ def test_bare_metal_server_profile_memory_enum_serialization(self):
"""
- Test serialization/deserialization for Zone
+ Test serialization/deserialization for BareMetalServerProfileMemoryEnum
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- region_reference_model = {} # RegionReference
- region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
- region_reference_model['name'] = 'us-south'
-
- # Construct a json representation of a Zone model
- zone_model_json = {}
- zone_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_model_json['name'] = 'us-south-1'
- zone_model_json['region'] = region_reference_model
- zone_model_json['status'] = 'available'
+ # Construct a json representation of a BareMetalServerProfileMemoryEnum model
+ bare_metal_server_profile_memory_enum_model_json = {}
+ bare_metal_server_profile_memory_enum_model_json['default'] = 38
+ bare_metal_server_profile_memory_enum_model_json['type'] = 'enum'
+ bare_metal_server_profile_memory_enum_model_json['values'] = [8, 16, 32]
- # Construct a model instance of Zone by calling from_dict on the json representation
- zone_model = Zone.from_dict(zone_model_json)
- assert zone_model != False
+ # Construct a model instance of BareMetalServerProfileMemoryEnum by calling from_dict on the json representation
+ bare_metal_server_profile_memory_enum_model = BareMetalServerProfileMemoryEnum.from_dict(bare_metal_server_profile_memory_enum_model_json)
+ assert bare_metal_server_profile_memory_enum_model != False
- # Construct a model instance of Zone by calling from_dict on the json representation
- zone_model_dict = Zone.from_dict(zone_model_json).__dict__
- zone_model2 = Zone(**zone_model_dict)
+ # Construct a model instance of BareMetalServerProfileMemoryEnum by calling from_dict on the json representation
+ bare_metal_server_profile_memory_enum_model_dict = BareMetalServerProfileMemoryEnum.from_dict(bare_metal_server_profile_memory_enum_model_json).__dict__
+ bare_metal_server_profile_memory_enum_model2 = BareMetalServerProfileMemoryEnum(**bare_metal_server_profile_memory_enum_model_dict)
# Verify the model instances are equivalent
- assert zone_model == zone_model2
+ assert bare_metal_server_profile_memory_enum_model == bare_metal_server_profile_memory_enum_model2
# Convert model instance back to dict and verify no loss of data
- zone_model_json2 = zone_model.to_dict()
- assert zone_model_json2 == zone_model_json
+ bare_metal_server_profile_memory_enum_model_json2 = bare_metal_server_profile_memory_enum_model.to_dict()
+ assert bare_metal_server_profile_memory_enum_model_json2 == bare_metal_server_profile_memory_enum_model_json
-class TestModel_ZoneCollection():
+class TestModel_BareMetalServerProfileMemoryFixed():
"""
- Test Class for ZoneCollection
+ Test Class for BareMetalServerProfileMemoryFixed
"""
- def test_zone_collection_serialization(self):
+ def test_bare_metal_server_profile_memory_fixed_serialization(self):
"""
- Test serialization/deserialization for ZoneCollection
+ Test serialization/deserialization for BareMetalServerProfileMemoryFixed
"""
- # Construct dict forms of any model objects needed in order to build this model.
-
- region_reference_model = {} # RegionReference
- region_reference_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south'
- region_reference_model['name'] = 'us-south'
-
- zone_model = {} # Zone
- zone_model['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_model['name'] = 'us-south-1'
- zone_model['region'] = region_reference_model
- zone_model['status'] = 'available'
-
- # Construct a json representation of a ZoneCollection model
- zone_collection_model_json = {}
- zone_collection_model_json['zones'] = [zone_model]
+ # Construct a json representation of a BareMetalServerProfileMemoryFixed model
+ bare_metal_server_profile_memory_fixed_model_json = {}
+ bare_metal_server_profile_memory_fixed_model_json['type'] = 'fixed'
+ bare_metal_server_profile_memory_fixed_model_json['value'] = 16
- # Construct a model instance of ZoneCollection by calling from_dict on the json representation
- zone_collection_model = ZoneCollection.from_dict(zone_collection_model_json)
- assert zone_collection_model != False
+ # Construct a model instance of BareMetalServerProfileMemoryFixed by calling from_dict on the json representation
+ bare_metal_server_profile_memory_fixed_model = BareMetalServerProfileMemoryFixed.from_dict(bare_metal_server_profile_memory_fixed_model_json)
+ assert bare_metal_server_profile_memory_fixed_model != False
- # Construct a model instance of ZoneCollection by calling from_dict on the json representation
- zone_collection_model_dict = ZoneCollection.from_dict(zone_collection_model_json).__dict__
- zone_collection_model2 = ZoneCollection(**zone_collection_model_dict)
+ # Construct a model instance of BareMetalServerProfileMemoryFixed by calling from_dict on the json representation
+ bare_metal_server_profile_memory_fixed_model_dict = BareMetalServerProfileMemoryFixed.from_dict(bare_metal_server_profile_memory_fixed_model_json).__dict__
+ bare_metal_server_profile_memory_fixed_model2 = BareMetalServerProfileMemoryFixed(**bare_metal_server_profile_memory_fixed_model_dict)
# Verify the model instances are equivalent
- assert zone_collection_model == zone_collection_model2
+ assert bare_metal_server_profile_memory_fixed_model == bare_metal_server_profile_memory_fixed_model2
# Convert model instance back to dict and verify no loss of data
- zone_collection_model_json2 = zone_collection_model.to_dict()
- assert zone_collection_model_json2 == zone_collection_model_json
+ bare_metal_server_profile_memory_fixed_model_json2 = bare_metal_server_profile_memory_fixed_model.to_dict()
+ assert bare_metal_server_profile_memory_fixed_model_json2 == bare_metal_server_profile_memory_fixed_model_json
-class TestModel_ZoneReference():
+class TestModel_BareMetalServerProfileMemoryRange():
"""
- Test Class for ZoneReference
+ Test Class for BareMetalServerProfileMemoryRange
"""
- def test_zone_reference_serialization(self):
+ def test_bare_metal_server_profile_memory_range_serialization(self):
"""
- Test serialization/deserialization for ZoneReference
+ Test serialization/deserialization for BareMetalServerProfileMemoryRange
"""
- # Construct a json representation of a ZoneReference model
- zone_reference_model_json = {}
- zone_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/regions/us-south/zones/us-south-1'
- zone_reference_model_json['name'] = 'us-south-1'
+ # Construct a json representation of a BareMetalServerProfileMemoryRange model
+ bare_metal_server_profile_memory_range_model_json = {}
+ bare_metal_server_profile_memory_range_model_json['default'] = 16
+ bare_metal_server_profile_memory_range_model_json['max'] = 384
+ bare_metal_server_profile_memory_range_model_json['min'] = 8
+ bare_metal_server_profile_memory_range_model_json['step'] = 8
+ bare_metal_server_profile_memory_range_model_json['type'] = 'range'
- # Construct a model instance of ZoneReference by calling from_dict on the json representation
- zone_reference_model = ZoneReference.from_dict(zone_reference_model_json)
- assert zone_reference_model != False
+ # Construct a model instance of BareMetalServerProfileMemoryRange by calling from_dict on the json representation
+ bare_metal_server_profile_memory_range_model = BareMetalServerProfileMemoryRange.from_dict(bare_metal_server_profile_memory_range_model_json)
+ assert bare_metal_server_profile_memory_range_model != False
- # Construct a model instance of ZoneReference by calling from_dict on the json representation
- zone_reference_model_dict = ZoneReference.from_dict(zone_reference_model_json).__dict__
- zone_reference_model2 = ZoneReference(**zone_reference_model_dict)
+ # Construct a model instance of BareMetalServerProfileMemoryRange by calling from_dict on the json representation
+ bare_metal_server_profile_memory_range_model_dict = BareMetalServerProfileMemoryRange.from_dict(bare_metal_server_profile_memory_range_model_json).__dict__
+ bare_metal_server_profile_memory_range_model2 = BareMetalServerProfileMemoryRange(**bare_metal_server_profile_memory_range_model_dict)
# Verify the model instances are equivalent
- assert zone_reference_model == zone_reference_model2
+ assert bare_metal_server_profile_memory_range_model == bare_metal_server_profile_memory_range_model2
# Convert model instance back to dict and verify no loss of data
- zone_reference_model_json2 = zone_reference_model.to_dict()
- assert zone_reference_model_json2 == zone_reference_model_json
+ bare_metal_server_profile_memory_range_model_json2 = bare_metal_server_profile_memory_range_model.to_dict()
+ assert bare_metal_server_profile_memory_range_model_json2 == bare_metal_server_profile_memory_range_model_json
class TestModel_CertificateInstanceIdentityByCRN():
"""
@@ -46358,64 +48559,6 @@ def test_floating_ip_by_target_network_interface_identity_network_interface_iden
floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model.to_dict()
assert floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json2 == floating_ip_by_target_network_interface_identity_network_interface_identity_by_id_model_json
-class TestModel_FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref():
- """
- Test Class for FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
- """
-
- def test_floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_serialization(self):
- """
- Test serialization/deserialization for FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref
- """
-
- # Construct a json representation of a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref model
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json = {}
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
-
- # Construct a model instance of FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json)
- assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model != False
-
- # Construct a model instance of FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref by calling from_dict on the json representation
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_dict = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref.from_dict(floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json).__dict__
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model2 = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityByHref(**floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_dict)
-
- # Verify the model instances are equivalent
- assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model == floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model2
-
- # Convert model instance back to dict and verify no loss of data
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json2 = floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model.to_dict()
- assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json2 == floating_ip_patch_target_network_interface_identity_network_interface_identity_by_href_model_json
-
-class TestModel_FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById():
- """
- Test Class for FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById
- """
-
- def test_floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_serialization(self):
- """
- Test serialization/deserialization for FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById
- """
-
- # Construct a json representation of a FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById model
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json = {}
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
-
- # Construct a model instance of FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json)
- assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model != False
-
- # Construct a model instance of FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById by calling from_dict on the json representation
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_dict = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById.from_dict(floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json).__dict__
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model2 = FloatingIPPatchTargetNetworkInterfaceIdentityNetworkInterfaceIdentityById(**floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_dict)
-
- # Verify the model instances are equivalent
- assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model == floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model2
-
- # Convert model instance back to dict and verify no loss of data
- floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json2 = floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model.to_dict()
- assert floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json2 == floating_ip_patch_target_network_interface_identity_network_interface_identity_by_id_model_json
-
class TestModel_FloatingIPPrototypeFloatingIPByTarget():
"""
Test Class for FloatingIPPrototypeFloatingIPByTarget
@@ -46494,6 +48637,64 @@ def test_floating_ip_prototype_floating_ip_by_zone_serialization(self):
floating_ip_prototype_floating_ip_by_zone_model_json2 = floating_ip_prototype_floating_ip_by_zone_model.to_dict()
assert floating_ip_prototype_floating_ip_by_zone_model_json2 == floating_ip_prototype_floating_ip_by_zone_model_json
+class TestModel_FloatingIPTargetPatchNetworkInterfaceIdentityByHref():
+ """
+ Test Class for FloatingIPTargetPatchNetworkInterfaceIdentityByHref
+ """
+
+ def test_floating_ip_target_patch_network_interface_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for FloatingIPTargetPatchNetworkInterfaceIdentityByHref
+ """
+
+ # Construct a json representation of a FloatingIPTargetPatchNetworkInterfaceIdentityByHref model
+ floating_ip_target_patch_network_interface_identity_by_href_model_json = {}
+ floating_ip_target_patch_network_interface_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/instances/1e09281b-f177-46fb-baf1-bc152b2e391a/network_interfaces/10c02d81-0ecb-4dc5-897d-28392913b81e'
+
+ # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_patch_network_interface_identity_by_href_model = FloatingIPTargetPatchNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_network_interface_identity_by_href_model_json)
+ assert floating_ip_target_patch_network_interface_identity_by_href_model != False
+
+ # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityByHref by calling from_dict on the json representation
+ floating_ip_target_patch_network_interface_identity_by_href_model_dict = FloatingIPTargetPatchNetworkInterfaceIdentityByHref.from_dict(floating_ip_target_patch_network_interface_identity_by_href_model_json).__dict__
+ floating_ip_target_patch_network_interface_identity_by_href_model2 = FloatingIPTargetPatchNetworkInterfaceIdentityByHref(**floating_ip_target_patch_network_interface_identity_by_href_model_dict)
+
+ # Verify the model instances are equivalent
+ assert floating_ip_target_patch_network_interface_identity_by_href_model == floating_ip_target_patch_network_interface_identity_by_href_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ floating_ip_target_patch_network_interface_identity_by_href_model_json2 = floating_ip_target_patch_network_interface_identity_by_href_model.to_dict()
+ assert floating_ip_target_patch_network_interface_identity_by_href_model_json2 == floating_ip_target_patch_network_interface_identity_by_href_model_json
+
+class TestModel_FloatingIPTargetPatchNetworkInterfaceIdentityById():
+ """
+ Test Class for FloatingIPTargetPatchNetworkInterfaceIdentityById
+ """
+
+ def test_floating_ip_target_patch_network_interface_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for FloatingIPTargetPatchNetworkInterfaceIdentityById
+ """
+
+ # Construct a json representation of a FloatingIPTargetPatchNetworkInterfaceIdentityById model
+ floating_ip_target_patch_network_interface_identity_by_id_model_json = {}
+ floating_ip_target_patch_network_interface_identity_by_id_model_json['id'] = '10c02d81-0ecb-4dc5-897d-28392913b81e'
+
+ # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_patch_network_interface_identity_by_id_model = FloatingIPTargetPatchNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_network_interface_identity_by_id_model_json)
+ assert floating_ip_target_patch_network_interface_identity_by_id_model != False
+
+ # Construct a model instance of FloatingIPTargetPatchNetworkInterfaceIdentityById by calling from_dict on the json representation
+ floating_ip_target_patch_network_interface_identity_by_id_model_dict = FloatingIPTargetPatchNetworkInterfaceIdentityById.from_dict(floating_ip_target_patch_network_interface_identity_by_id_model_json).__dict__
+ floating_ip_target_patch_network_interface_identity_by_id_model2 = FloatingIPTargetPatchNetworkInterfaceIdentityById(**floating_ip_target_patch_network_interface_identity_by_id_model_dict)
+
+ # Verify the model instances are equivalent
+ assert floating_ip_target_patch_network_interface_identity_by_id_model == floating_ip_target_patch_network_interface_identity_by_id_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ floating_ip_target_patch_network_interface_identity_by_id_model_json2 = floating_ip_target_patch_network_interface_identity_by_id_model.to_dict()
+ assert floating_ip_target_patch_network_interface_identity_by_id_model_json2 == floating_ip_target_patch_network_interface_identity_by_id_model_json
+
class TestModel_FloatingIPTargetNetworkInterfaceReference():
"""
Test Class for FloatingIPTargetNetworkInterfaceReference
@@ -51157,92 +53358,92 @@ def test_public_gateway_floating_ip_prototype_floating_ip_prototype_target_conte
public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json2 = public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model.to_dict()
assert public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json2 == public_gateway_floating_ip_prototype_floating_ip_prototype_target_context_model_json
-class TestModel_PublicGatewayIdentityByCRN():
+class TestModel_PublicGatewayIdentityPublicGatewayIdentityByCRN():
"""
- Test Class for PublicGatewayIdentityByCRN
+ Test Class for PublicGatewayIdentityPublicGatewayIdentityByCRN
"""
- def test_public_gateway_identity_by_crn_serialization(self):
+ def test_public_gateway_identity_public_gateway_identity_by_crn_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayIdentityByCRN
+ Test serialization/deserialization for PublicGatewayIdentityPublicGatewayIdentityByCRN
"""
- # Construct a json representation of a PublicGatewayIdentityByCRN model
- public_gateway_identity_by_crn_model_json = {}
- public_gateway_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ # Construct a json representation of a PublicGatewayIdentityPublicGatewayIdentityByCRN model
+ public_gateway_identity_public_gateway_identity_by_crn_model_json = {}
+ public_gateway_identity_public_gateway_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
- # Construct a model instance of PublicGatewayIdentityByCRN by calling from_dict on the json representation
- public_gateway_identity_by_crn_model = PublicGatewayIdentityByCRN.from_dict(public_gateway_identity_by_crn_model_json)
- assert public_gateway_identity_by_crn_model != False
+ # Construct a model instance of PublicGatewayIdentityPublicGatewayIdentityByCRN by calling from_dict on the json representation
+ public_gateway_identity_public_gateway_identity_by_crn_model = PublicGatewayIdentityPublicGatewayIdentityByCRN.from_dict(public_gateway_identity_public_gateway_identity_by_crn_model_json)
+ assert public_gateway_identity_public_gateway_identity_by_crn_model != False
- # Construct a model instance of PublicGatewayIdentityByCRN by calling from_dict on the json representation
- public_gateway_identity_by_crn_model_dict = PublicGatewayIdentityByCRN.from_dict(public_gateway_identity_by_crn_model_json).__dict__
- public_gateway_identity_by_crn_model2 = PublicGatewayIdentityByCRN(**public_gateway_identity_by_crn_model_dict)
+ # Construct a model instance of PublicGatewayIdentityPublicGatewayIdentityByCRN by calling from_dict on the json representation
+ public_gateway_identity_public_gateway_identity_by_crn_model_dict = PublicGatewayIdentityPublicGatewayIdentityByCRN.from_dict(public_gateway_identity_public_gateway_identity_by_crn_model_json).__dict__
+ public_gateway_identity_public_gateway_identity_by_crn_model2 = PublicGatewayIdentityPublicGatewayIdentityByCRN(**public_gateway_identity_public_gateway_identity_by_crn_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_identity_by_crn_model == public_gateway_identity_by_crn_model2
+ assert public_gateway_identity_public_gateway_identity_by_crn_model == public_gateway_identity_public_gateway_identity_by_crn_model2
# Convert model instance back to dict and verify no loss of data
- public_gateway_identity_by_crn_model_json2 = public_gateway_identity_by_crn_model.to_dict()
- assert public_gateway_identity_by_crn_model_json2 == public_gateway_identity_by_crn_model_json
+ public_gateway_identity_public_gateway_identity_by_crn_model_json2 = public_gateway_identity_public_gateway_identity_by_crn_model.to_dict()
+ assert public_gateway_identity_public_gateway_identity_by_crn_model_json2 == public_gateway_identity_public_gateway_identity_by_crn_model_json
-class TestModel_PublicGatewayIdentityByHref():
+class TestModel_PublicGatewayIdentityPublicGatewayIdentityByHref():
"""
- Test Class for PublicGatewayIdentityByHref
+ Test Class for PublicGatewayIdentityPublicGatewayIdentityByHref
"""
- def test_public_gateway_identity_by_href_serialization(self):
+ def test_public_gateway_identity_public_gateway_identity_by_href_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayIdentityByHref
+ Test serialization/deserialization for PublicGatewayIdentityPublicGatewayIdentityByHref
"""
- # Construct a json representation of a PublicGatewayIdentityByHref model
- public_gateway_identity_by_href_model_json = {}
- public_gateway_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ # Construct a json representation of a PublicGatewayIdentityPublicGatewayIdentityByHref model
+ public_gateway_identity_public_gateway_identity_by_href_model_json = {}
+ public_gateway_identity_public_gateway_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
- # Construct a model instance of PublicGatewayIdentityByHref by calling from_dict on the json representation
- public_gateway_identity_by_href_model = PublicGatewayIdentityByHref.from_dict(public_gateway_identity_by_href_model_json)
- assert public_gateway_identity_by_href_model != False
+ # Construct a model instance of PublicGatewayIdentityPublicGatewayIdentityByHref by calling from_dict on the json representation
+ public_gateway_identity_public_gateway_identity_by_href_model = PublicGatewayIdentityPublicGatewayIdentityByHref.from_dict(public_gateway_identity_public_gateway_identity_by_href_model_json)
+ assert public_gateway_identity_public_gateway_identity_by_href_model != False
- # Construct a model instance of PublicGatewayIdentityByHref by calling from_dict on the json representation
- public_gateway_identity_by_href_model_dict = PublicGatewayIdentityByHref.from_dict(public_gateway_identity_by_href_model_json).__dict__
- public_gateway_identity_by_href_model2 = PublicGatewayIdentityByHref(**public_gateway_identity_by_href_model_dict)
+ # Construct a model instance of PublicGatewayIdentityPublicGatewayIdentityByHref by calling from_dict on the json representation
+ public_gateway_identity_public_gateway_identity_by_href_model_dict = PublicGatewayIdentityPublicGatewayIdentityByHref.from_dict(public_gateway_identity_public_gateway_identity_by_href_model_json).__dict__
+ public_gateway_identity_public_gateway_identity_by_href_model2 = PublicGatewayIdentityPublicGatewayIdentityByHref(**public_gateway_identity_public_gateway_identity_by_href_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_identity_by_href_model == public_gateway_identity_by_href_model2
+ assert public_gateway_identity_public_gateway_identity_by_href_model == public_gateway_identity_public_gateway_identity_by_href_model2
# Convert model instance back to dict and verify no loss of data
- public_gateway_identity_by_href_model_json2 = public_gateway_identity_by_href_model.to_dict()
- assert public_gateway_identity_by_href_model_json2 == public_gateway_identity_by_href_model_json
+ public_gateway_identity_public_gateway_identity_by_href_model_json2 = public_gateway_identity_public_gateway_identity_by_href_model.to_dict()
+ assert public_gateway_identity_public_gateway_identity_by_href_model_json2 == public_gateway_identity_public_gateway_identity_by_href_model_json
-class TestModel_PublicGatewayIdentityById():
+class TestModel_PublicGatewayIdentityPublicGatewayIdentityById():
"""
- Test Class for PublicGatewayIdentityById
+ Test Class for PublicGatewayIdentityPublicGatewayIdentityById
"""
- def test_public_gateway_identity_by_id_serialization(self):
+ def test_public_gateway_identity_public_gateway_identity_by_id_serialization(self):
"""
- Test serialization/deserialization for PublicGatewayIdentityById
+ Test serialization/deserialization for PublicGatewayIdentityPublicGatewayIdentityById
"""
- # Construct a json representation of a PublicGatewayIdentityById model
- public_gateway_identity_by_id_model_json = {}
- public_gateway_identity_by_id_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+ # Construct a json representation of a PublicGatewayIdentityPublicGatewayIdentityById model
+ public_gateway_identity_public_gateway_identity_by_id_model_json = {}
+ public_gateway_identity_public_gateway_identity_by_id_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
- # Construct a model instance of PublicGatewayIdentityById by calling from_dict on the json representation
- public_gateway_identity_by_id_model = PublicGatewayIdentityById.from_dict(public_gateway_identity_by_id_model_json)
- assert public_gateway_identity_by_id_model != False
+ # Construct a model instance of PublicGatewayIdentityPublicGatewayIdentityById by calling from_dict on the json representation
+ public_gateway_identity_public_gateway_identity_by_id_model = PublicGatewayIdentityPublicGatewayIdentityById.from_dict(public_gateway_identity_public_gateway_identity_by_id_model_json)
+ assert public_gateway_identity_public_gateway_identity_by_id_model != False
- # Construct a model instance of PublicGatewayIdentityById by calling from_dict on the json representation
- public_gateway_identity_by_id_model_dict = PublicGatewayIdentityById.from_dict(public_gateway_identity_by_id_model_json).__dict__
- public_gateway_identity_by_id_model2 = PublicGatewayIdentityById(**public_gateway_identity_by_id_model_dict)
+ # Construct a model instance of PublicGatewayIdentityPublicGatewayIdentityById by calling from_dict on the json representation
+ public_gateway_identity_public_gateway_identity_by_id_model_dict = PublicGatewayIdentityPublicGatewayIdentityById.from_dict(public_gateway_identity_public_gateway_identity_by_id_model_json).__dict__
+ public_gateway_identity_public_gateway_identity_by_id_model2 = PublicGatewayIdentityPublicGatewayIdentityById(**public_gateway_identity_public_gateway_identity_by_id_model_dict)
# Verify the model instances are equivalent
- assert public_gateway_identity_by_id_model == public_gateway_identity_by_id_model2
+ assert public_gateway_identity_public_gateway_identity_by_id_model == public_gateway_identity_public_gateway_identity_by_id_model2
# Convert model instance back to dict and verify no loss of data
- public_gateway_identity_by_id_model_json2 = public_gateway_identity_by_id_model.to_dict()
- assert public_gateway_identity_by_id_model_json2 == public_gateway_identity_by_id_model_json
+ public_gateway_identity_public_gateway_identity_by_id_model_json2 = public_gateway_identity_public_gateway_identity_by_id_model.to_dict()
+ assert public_gateway_identity_public_gateway_identity_by_id_model_json2 == public_gateway_identity_public_gateway_identity_by_id_model_json
class TestModel_ReservedIPTargetEndpointGatewayReference():
"""
@@ -52001,6 +54202,45 @@ def test_security_group_rule_security_group_rule_protocol_tcpudp_serialization(s
security_group_rule_security_group_rule_protocol_tcpudp_model_json2 = security_group_rule_security_group_rule_protocol_tcpudp_model.to_dict()
assert security_group_rule_security_group_rule_protocol_tcpudp_model_json2 == security_group_rule_security_group_rule_protocol_tcpudp_model_json
+class TestModel_SecurityGroupTargetReferenceEndpointGatewayReference():
+ """
+ Test Class for SecurityGroupTargetReferenceEndpointGatewayReference
+ """
+
+ def test_security_group_target_reference_endpoint_gateway_reference_serialization(self):
+ """
+ Test serialization/deserialization for SecurityGroupTargetReferenceEndpointGatewayReference
+ """
+
+ # Construct dict forms of any model objects needed in order to build this model.
+
+ endpoint_gateway_reference_deleted_model = {} # EndpointGatewayReferenceDeleted
+ endpoint_gateway_reference_deleted_model['more_info'] = 'https://cloud.ibm.com/apidocs/vpc#deleted-resources'
+
+ # Construct a json representation of a SecurityGroupTargetReferenceEndpointGatewayReference model
+ security_group_target_reference_endpoint_gateway_reference_model_json = {}
+ security_group_target_reference_endpoint_gateway_reference_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south:a/123456::endpoint-gateway:d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ security_group_target_reference_endpoint_gateway_reference_model_json['deleted'] = endpoint_gateway_reference_deleted_model
+ security_group_target_reference_endpoint_gateway_reference_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/endpoint_gateways/d7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ security_group_target_reference_endpoint_gateway_reference_model_json['id'] = 'd7cc5196-9864-48c4-82d8-3f30da41fcc5'
+ security_group_target_reference_endpoint_gateway_reference_model_json['name'] = 'my-endpoint-gateway'
+ security_group_target_reference_endpoint_gateway_reference_model_json['resource_type'] = 'endpoint_gateway'
+
+ # Construct a model instance of SecurityGroupTargetReferenceEndpointGatewayReference by calling from_dict on the json representation
+ security_group_target_reference_endpoint_gateway_reference_model = SecurityGroupTargetReferenceEndpointGatewayReference.from_dict(security_group_target_reference_endpoint_gateway_reference_model_json)
+ assert security_group_target_reference_endpoint_gateway_reference_model != False
+
+ # Construct a model instance of SecurityGroupTargetReferenceEndpointGatewayReference by calling from_dict on the json representation
+ security_group_target_reference_endpoint_gateway_reference_model_dict = SecurityGroupTargetReferenceEndpointGatewayReference.from_dict(security_group_target_reference_endpoint_gateway_reference_model_json).__dict__
+ security_group_target_reference_endpoint_gateway_reference_model2 = SecurityGroupTargetReferenceEndpointGatewayReference(**security_group_target_reference_endpoint_gateway_reference_model_dict)
+
+ # Verify the model instances are equivalent
+ assert security_group_target_reference_endpoint_gateway_reference_model == security_group_target_reference_endpoint_gateway_reference_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ security_group_target_reference_endpoint_gateway_reference_model_json2 = security_group_target_reference_endpoint_gateway_reference_model.to_dict()
+ assert security_group_target_reference_endpoint_gateway_reference_model_json2 == security_group_target_reference_endpoint_gateway_reference_model_json
+
class TestModel_SecurityGroupTargetReferenceLoadBalancerReference():
"""
Test Class for SecurityGroupTargetReferenceLoadBalancerReference
@@ -52266,7 +54506,7 @@ def test_subnet_prototype_subnet_by_cidr_serialization(self):
network_acl_identity_model = {} # NetworkACLIdentityById
network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- public_gateway_identity_model = {} # PublicGatewayIdentityById
+ public_gateway_identity_model = {} # PublicGatewayIdentityPublicGatewayIdentityById
public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
resource_group_identity_model = {} # ResourceGroupIdentityById
@@ -52323,7 +54563,7 @@ def test_subnet_prototype_subnet_by_total_count_serialization(self):
network_acl_identity_model = {} # NetworkACLIdentityById
network_acl_identity_model['id'] = 'a4e28308-8ee7-46ab-8108-9f881f22bdbf'
- public_gateway_identity_model = {} # PublicGatewayIdentityById
+ public_gateway_identity_model = {} # PublicGatewayIdentityPublicGatewayIdentityById
public_gateway_identity_model['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
resource_group_identity_model = {} # ResourceGroupIdentityById
@@ -52365,6 +54605,93 @@ def test_subnet_prototype_subnet_by_total_count_serialization(self):
subnet_prototype_subnet_by_total_count_model_json2 = subnet_prototype_subnet_by_total_count_model.to_dict()
assert subnet_prototype_subnet_by_total_count_model_json2 == subnet_prototype_subnet_by_total_count_model_json
+class TestModel_SubnetPublicGatewayPatchPublicGatewayIdentityByCRN():
+ """
+ Test Class for SubnetPublicGatewayPatchPublicGatewayIdentityByCRN
+ """
+
+ def test_subnet_public_gateway_patch_public_gateway_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for SubnetPublicGatewayPatchPublicGatewayIdentityByCRN
+ """
+
+ # Construct a json representation of a SubnetPublicGatewayPatchPublicGatewayIdentityByCRN model
+ subnet_public_gateway_patch_public_gateway_identity_by_crn_model_json = {}
+ subnet_public_gateway_patch_public_gateway_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::public-gateway:dc5431ef-1fc6-4861-adc9-a59d077d1241'
+
+ # Construct a model instance of SubnetPublicGatewayPatchPublicGatewayIdentityByCRN by calling from_dict on the json representation
+ subnet_public_gateway_patch_public_gateway_identity_by_crn_model = SubnetPublicGatewayPatchPublicGatewayIdentityByCRN.from_dict(subnet_public_gateway_patch_public_gateway_identity_by_crn_model_json)
+ assert subnet_public_gateway_patch_public_gateway_identity_by_crn_model != False
+
+ # Construct a model instance of SubnetPublicGatewayPatchPublicGatewayIdentityByCRN by calling from_dict on the json representation
+ subnet_public_gateway_patch_public_gateway_identity_by_crn_model_dict = SubnetPublicGatewayPatchPublicGatewayIdentityByCRN.from_dict(subnet_public_gateway_patch_public_gateway_identity_by_crn_model_json).__dict__
+ subnet_public_gateway_patch_public_gateway_identity_by_crn_model2 = SubnetPublicGatewayPatchPublicGatewayIdentityByCRN(**subnet_public_gateway_patch_public_gateway_identity_by_crn_model_dict)
+
+ # Verify the model instances are equivalent
+ assert subnet_public_gateway_patch_public_gateway_identity_by_crn_model == subnet_public_gateway_patch_public_gateway_identity_by_crn_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ subnet_public_gateway_patch_public_gateway_identity_by_crn_model_json2 = subnet_public_gateway_patch_public_gateway_identity_by_crn_model.to_dict()
+ assert subnet_public_gateway_patch_public_gateway_identity_by_crn_model_json2 == subnet_public_gateway_patch_public_gateway_identity_by_crn_model_json
+
+class TestModel_SubnetPublicGatewayPatchPublicGatewayIdentityByHref():
+ """
+ Test Class for SubnetPublicGatewayPatchPublicGatewayIdentityByHref
+ """
+
+ def test_subnet_public_gateway_patch_public_gateway_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for SubnetPublicGatewayPatchPublicGatewayIdentityByHref
+ """
+
+ # Construct a json representation of a SubnetPublicGatewayPatchPublicGatewayIdentityByHref model
+ subnet_public_gateway_patch_public_gateway_identity_by_href_model_json = {}
+ subnet_public_gateway_patch_public_gateway_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/public_gateways/dc5431ef-1fc6-4861-adc9-a59d077d1241'
+
+ # Construct a model instance of SubnetPublicGatewayPatchPublicGatewayIdentityByHref by calling from_dict on the json representation
+ subnet_public_gateway_patch_public_gateway_identity_by_href_model = SubnetPublicGatewayPatchPublicGatewayIdentityByHref.from_dict(subnet_public_gateway_patch_public_gateway_identity_by_href_model_json)
+ assert subnet_public_gateway_patch_public_gateway_identity_by_href_model != False
+
+ # Construct a model instance of SubnetPublicGatewayPatchPublicGatewayIdentityByHref by calling from_dict on the json representation
+ subnet_public_gateway_patch_public_gateway_identity_by_href_model_dict = SubnetPublicGatewayPatchPublicGatewayIdentityByHref.from_dict(subnet_public_gateway_patch_public_gateway_identity_by_href_model_json).__dict__
+ subnet_public_gateway_patch_public_gateway_identity_by_href_model2 = SubnetPublicGatewayPatchPublicGatewayIdentityByHref(**subnet_public_gateway_patch_public_gateway_identity_by_href_model_dict)
+
+ # Verify the model instances are equivalent
+ assert subnet_public_gateway_patch_public_gateway_identity_by_href_model == subnet_public_gateway_patch_public_gateway_identity_by_href_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ subnet_public_gateway_patch_public_gateway_identity_by_href_model_json2 = subnet_public_gateway_patch_public_gateway_identity_by_href_model.to_dict()
+ assert subnet_public_gateway_patch_public_gateway_identity_by_href_model_json2 == subnet_public_gateway_patch_public_gateway_identity_by_href_model_json
+
+class TestModel_SubnetPublicGatewayPatchPublicGatewayIdentityById():
+ """
+ Test Class for SubnetPublicGatewayPatchPublicGatewayIdentityById
+ """
+
+ def test_subnet_public_gateway_patch_public_gateway_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for SubnetPublicGatewayPatchPublicGatewayIdentityById
+ """
+
+ # Construct a json representation of a SubnetPublicGatewayPatchPublicGatewayIdentityById model
+ subnet_public_gateway_patch_public_gateway_identity_by_id_model_json = {}
+ subnet_public_gateway_patch_public_gateway_identity_by_id_model_json['id'] = 'dc5431ef-1fc6-4861-adc9-a59d077d1241'
+
+ # Construct a model instance of SubnetPublicGatewayPatchPublicGatewayIdentityById by calling from_dict on the json representation
+ subnet_public_gateway_patch_public_gateway_identity_by_id_model = SubnetPublicGatewayPatchPublicGatewayIdentityById.from_dict(subnet_public_gateway_patch_public_gateway_identity_by_id_model_json)
+ assert subnet_public_gateway_patch_public_gateway_identity_by_id_model != False
+
+ # Construct a model instance of SubnetPublicGatewayPatchPublicGatewayIdentityById by calling from_dict on the json representation
+ subnet_public_gateway_patch_public_gateway_identity_by_id_model_dict = SubnetPublicGatewayPatchPublicGatewayIdentityById.from_dict(subnet_public_gateway_patch_public_gateway_identity_by_id_model_json).__dict__
+ subnet_public_gateway_patch_public_gateway_identity_by_id_model2 = SubnetPublicGatewayPatchPublicGatewayIdentityById(**subnet_public_gateway_patch_public_gateway_identity_by_id_model_dict)
+
+ # Verify the model instances are equivalent
+ assert subnet_public_gateway_patch_public_gateway_identity_by_id_model == subnet_public_gateway_patch_public_gateway_identity_by_id_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ subnet_public_gateway_patch_public_gateway_identity_by_id_model_json2 = subnet_public_gateway_patch_public_gateway_identity_by_id_model.to_dict()
+ assert subnet_public_gateway_patch_public_gateway_identity_by_id_model_json2 == subnet_public_gateway_patch_public_gateway_identity_by_id_model_json
+
class TestModel_VPCIdentityByCRN():
"""
Test Class for VPCIdentityByCRN
@@ -54111,6 +56438,180 @@ def test_instance_group_manager_scheduled_action_manager_prototype_auto_scale_pr
instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json2 = instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model.to_dict()
assert instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json2 == instance_group_manager_scheduled_action_manager_prototype_auto_scale_prototype_by_id_model_json
+class TestModel_InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN():
+ """
+ Test Class for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
+ """
+
+ def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
+ """
+
+ # Construct a json representation of a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN model
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json = {}
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host-group:bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json)
+ assert instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model != False
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_dict = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN.from_dict(instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json).__dict__
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model2 = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN(**instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_dict)
+
+ # Verify the model instances are equivalent
+ assert instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model == instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json2 = instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model.to_dict()
+ assert instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json2 == instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_crn_model_json
+
+class TestModel_InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref():
+ """
+ Test Class for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
+ """
+
+ def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref
+ """
+
+ # Construct a json representation of a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref model
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json = {}
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_host/groups/bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json)
+ assert instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model != False
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_dict = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref.from_dict(instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json).__dict__
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model2 = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityByHref(**instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_dict)
+
+ # Verify the model instances are equivalent
+ assert instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model == instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json2 = instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model.to_dict()
+ assert instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json2 == instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_href_model_json
+
+class TestModel_InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById():
+ """
+ Test Class for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
+ """
+
+ def test_instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById
+ """
+
+ # Construct a json representation of a InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById model
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json = {}
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json['id'] = 'bcc5b834-1258-4b9c-c3b4-43bc9cf5cde0'
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json)
+ assert instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model != False
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_dict = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById.from_dict(instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json).__dict__
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model2 = InstancePlacementTargetPatchDedicatedHostGroupIdentityDedicatedHostGroupIdentityById(**instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_dict)
+
+ # Verify the model instances are equivalent
+ assert instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model == instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json2 = instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model.to_dict()
+ assert instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json2 == instance_placement_target_patch_dedicated_host_group_identity_dedicated_host_group_identity_by_id_model_json
+
+class TestModel_InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN():
+ """
+ Test Class for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN
+ """
+
+ def test_instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_serialization(self):
+ """
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN
+ """
+
+ # Construct a json representation of a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN model
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model_json = {}
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model_json['crn'] = 'crn:v1:bluemix:public:is:us-south-1:a/123456::dedicated-host:1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model = InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN.from_dict(instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model_json)
+ assert instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model != False
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model_dict = InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN.from_dict(instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model_json).__dict__
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model2 = InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByCRN(**instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model_dict)
+
+ # Verify the model instances are equivalent
+ assert instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model == instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model_json2 = instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model.to_dict()
+ assert instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model_json2 == instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_crn_model_json
+
+class TestModel_InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref():
+ """
+ Test Class for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref
+ """
+
+ def test_instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_serialization(self):
+ """
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref
+ """
+
+ # Construct a json representation of a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref model
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model_json = {}
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model_json['href'] = 'https://us-south.iaas.cloud.ibm.com/v1/dedicated_hosts/1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model = InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.from_dict(instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model_json)
+ assert instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model != False
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model_dict = InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref.from_dict(instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model_json).__dict__
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model2 = InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityByHref(**instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model_dict)
+
+ # Verify the model instances are equivalent
+ assert instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model == instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model_json2 = instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model.to_dict()
+ assert instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model_json2 == instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_href_model_json
+
+class TestModel_InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById():
+ """
+ Test Class for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById
+ """
+
+ def test_instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_serialization(self):
+ """
+ Test serialization/deserialization for InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById
+ """
+
+ # Construct a json representation of a InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById model
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model_json = {}
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model_json['id'] = '1e09281b-f177-46fb-baf1-bc152b2e391a'
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model = InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.from_dict(instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model_json)
+ assert instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model != False
+
+ # Construct a model instance of InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById by calling from_dict on the json representation
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model_dict = InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById.from_dict(instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model_json).__dict__
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model2 = InstancePlacementTargetPatchDedicatedHostIdentityDedicatedHostIdentityById(**instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model_dict)
+
+ # Verify the model instances are equivalent
+ assert instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model == instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model2
+
+ # Convert model instance back to dict and verify no loss of data
+ instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model_json2 = instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model.to_dict()
+ assert instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model_json2 == instance_placement_target_patch_dedicated_host_identity_dedicated_host_identity_by_id_model_json
+
class TestModel_InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN():
"""
Test Class for InstancePlacementTargetPrototypeDedicatedHostGroupIdentityDedicatedHostGroupIdentityByCRN
diff --git a/tox.ini b/tox.ini
index 14f426c..a410091 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist = py37-lint, py36, py37, py38, py39
+envlist = py37-lint, py37, py38, py39
[testenv:py37-lint]
basepython = python3.7